Commit 2fddab5a authored by Max Woolf's avatar Max Woolf
Browse files

Merge branch 'master' into rate-limit/unique-cardinality

Resolves conflicts in evaluator.rb from !291's cost-aware Lua INCR landing:
- check_rules/evaluate_rule retain master's cost: parameter
- count_distinct branch layers on top, calling sadd_with_ttl for SET-mode
  rules and incr_with_ttl(redis_key, period, cost) for the rest
- cost is ignored for count_distinct rules (SADD is binary)

Also rewrites the "falls through to a following matching rule" spec to
use real Redis + stored_count, matching master's evaluator_spec style.

Co-Authored-By: default avatarClaude Opus 4.7 (1M context) <noreply@anthropic.com>
parents 85ffa31a d4b76198
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3,13 +3,15 @@
# See the project for instructions on how to update the project
#
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v1.46.0
_commit: v1.49.2
_src_path: https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git
ee_licensed: false
gitlab_namespace: gitlab-org/ruby/gems
golang: false
helm: false
initial_codeowners: '@reprazent @andrewn @mkaeppler @ayufan'
jsonnet: false
measure_performance: false
project_name: labkit-ruby
release_platform: false
ruby: true
+5 −0
Original line number Diff line number Diff line
# This file should contain dependency versions not managed directly by mise
# Use Renovate annotation comments to manage dependencies. Renovate is configured
# to read this file automatically.

variables: {}  # None yet...
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ include:
# so this augments the base job (and is inherited by anything that extends it).
rspec:
  services:
    - name: redis:7-alpine
    - name: redis:8-alpine
      alias: redis
  variables:
    LABKIT_TEST_REDIS_URL: redis://redis
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ LabKit-Ruby provides functionality in a number of areas:
1. `Labkit::FIPS` for checking for FIPS mode and using FIPS-compliant algorithms.
1. `Labkit::Logging` for sanitizing log messages.
1. `Labkit::Metrics` for metrics. More on the [README](./lib/labkit/metrics/README.md).
1. `Labkit::RateLimit` for rules-based, Redis-backed rate limiting. More on the [README](./lib/labkit/rate_limit/README.md).
1. `Labkit::RSpec` for RSpec matchers to test Labkit functionality (requires selective loading). More on the [README](./lib/labkit/rspec/README.md).
1. `Labkit::Tracing` for handling and propagating distributed traces.

+2 −1
Original line number Diff line number Diff line
@@ -18,7 +18,8 @@ For the architectural decision and rationale, see

Offense
: A unique combination of file path, deprecated field, and logger class.
  Multiple log calls in the same file using the same deprecated field count as
  Multiple log calls in the same file using the same deprecated field or multiple
  log calls originating from the application context count as
  one offense.
  An offense exists until the deprecated field is entirely removed from the
  file.
Loading