Skip to content

Fix filtering edge cases and validation gaps - #44

Merged
ndbroadbent merged 1 commit into
mainfrom
review/blog-readiness
Oct 21, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
review/blog-readiness

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Nested query parameters, short Basic credentials and deeply nested Symbols could reach log output without redaction. A filter that raised could expose its value or repeatedly log/report its own failures.

This change closes those gaps, filters values when a matcher fails, and prevents recursive error handling. It also applies size limits before walking omitted values, avoiding unnecessary recursive copies of large inputs.

  • Correct the filtering and integration documentation, security support versions, schema examples, release instructions and docs setup prerequisites.
  • Make local CI verify committed RBIs instead of downloading annotations during typechecking.
  • Make code generation fail when formatting or JSON export fails, and ensure the site's integration tests run with a broken local Watchman installation.
  • Add regression tests for the runtime and generation failures.

Validation on 06738d4:

  • GitHub CI passed, including the Ruby/Rails matrix, Railties-only smoke test, lint, site build and browser tests.
  • Local task ci RAILS_VERSION=8.1.2 and cd docs && pnpm check passed: 508 Ruby tests, 184 JavaScript tests, five static-site tests and 14 browser tests.
  • Local integration tests passed on Rails 7.1.6, 7.2.3, 8.0.4 and 8.1.2, with 78 tests per version. Gem packaging and YARD generation also passed.

Summary by CodeRabbit

  • Bug Fixes

    • Improved protection for nested and encoded sensitive parameters.
    • Filter errors now safely exclude affected values while preserving unrelated data.
    • Improved handling of short Basic credentials, Bearer tokens, circular data, and oversized values.
    • Prevented recursive reporting of errors during log formatting.
  • Documentation

    • Clarified filtering, limits, SQL credential detection, integrations, schemas, security support, and development workflows.
    • Updated guidance for current tooling, supported versions, and deployment processes.
  • Chores

    • CI now verifies generated type annotations and reports generation or formatting failures reliably.

@ndbroadbent ndbroadbent added bug Something isn't working documentation Improvements or additions to documentation priority: high High priority review: careful Requires a careful review labels Oct 21, 2026
@ndbroadbent

Copy link
Copy Markdown
Member Author

QA — 2026-10-21, commit 06738d4

  • GitHub CI passed: lint, the latest Ruby/Rails pilot, all four compatibility combinations, Railties-only boot, site build and browser tests.
  • Local full CI and docs checks passed. Regression coverage includes nested query names, short Basic credentials, deeply nested Symbols, failing filters, recursive error reporting, omitted-value traversal and generator failures.
  • Gem packaging and YARD generation passed. No production deployment or published-gem installation was tested.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 98e68038-b740-4a50-a0fc-16dc8c64fa10
📥 Commits

Reviewing files that changed from the base of the PR and between fccdbb3 and 06738d4.

📒 Files selected for processing: 31
  • AGENTS.md
  • CHANGELOG.md
  • DEVELOPMENT.md
  • INTEGRATIONS.md
  • README.md
  • SECURITY.md
  • Taskfile.ruby.yml
  • Taskfile.yml
  • docs/AGENTS.md
  • docs/README.md
  • docs/app/docs/configuration/page.tsx
  • docs/app/docs/filtering-sensitive-data/page.tsx
  • docs/app/docs/integrations/sql/page.tsx
  • docs/e2e/pages.test.ts
  • docs/jest.integration.config.ts
  • docs/lib/integration-helpers.ts
  • lib/log_struct/concerns/configuration.rb
  • lib/log_struct/concerns/error_handling.rb
  • lib/log_struct/formatter.rb
  • lib/log_struct/integrations/shrine.rb
  • lib/log_struct/monkey_patches/active_support/tagged_logging/formatter.rb
  • lib/log_struct/param_filters.rb
  • lib/log_struct/string_scrubber.rb
  • logstruct.gemspec
  • schemas/README.md
  • scripts/generate_structs.rb
  • test/log_struct/configuration_test.rb
  • test/log_struct/formatter_test.rb
  • test/log_struct/param_filters_test.rb
  • test/log_struct/string_scrubber_test.rb
  • test/workflows/generation_test.rb

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Walkthrough

The pull request changes filter-error handling, nested query-parameter filtering, credential scrubbing, and bounded formatting. It also adds RBI verification to CI, makes generation failures propagate, and updates development, integration, security, and documentation-site guidance.

Changes

Sensitive-value filtering and formatting

Layer / File(s) Summary
Fail-closed filtering and error handling
lib/log_struct/concerns/configuration.rb, lib/log_struct/concerns/error_handling.rb, lib/log_struct/param_filters.rb, lib/log_struct/formatter.rb, test/log_struct/configuration_test.rb, test/log_struct/param_filters_test.rb, docs/app/docs/filtering-sensitive-data/page.tsx, AGENTS.md, CHANGELOG.md
Filter matcher errors now cause values to be filtered. Internal formatting errors are tracked to prevent recursive reporting when the configured mode is not Raise. Tests and guidance cover these behaviors.
Bounded formatting and key handling
lib/log_struct/formatter.rb, lib/log_struct/param_filters.rb, lib/log_struct/monkey_patches/active_support/tagged_logging/formatter.rb, lib/log_struct/integrations/shrine.rb, test/log_struct/formatter_test.rb, docs/app/docs/configuration/page.tsx, README.md
The formatter preserves serialized keys, normalizes logged keys, and summarizes unprocessed values. Hash summaries use bounded key enumeration. Tests cover depth limits, circular references, input preservation, and values that must not be traversed.
Nested query parameters and credentials
lib/log_struct/string_scrubber.rb, test/log_struct/string_scrubber_test.rb, test/log_struct/configuration_test.rb, docs/app/docs/filtering-sensitive-data/page.tsx, docs/app/docs/integrations/sql/page.tsx
Query filtering checks nested bracketed components and accumulated paths. Credential and nested-parameter tests cover encoded names and preserved non-sensitive parameters.

Generation and RBI verification

Layer / File(s) Summary
Generation errors and CI verification
Taskfile.ruby.yml, Taskfile.yml, scripts/generate_structs.rb, test/workflows/generation_test.rb, AGENTS.md, DEVELOPMENT.md
The generation script reports formatter output and propagates formatter and Sorbet export failures. A Tapioca verification task runs generation before verification, and CI uses that task. Tests cover the failure paths.

Development and project documentation

Layer / File(s) Summary
Development and integration guidance
DEVELOPMENT.md, INTEGRATIONS.md, schemas/README.md, SECURITY.md, logstruct.gemspec, lib/log_struct/integrations/shrine.rb, AGENTS.md
Development examples, release instructions, integration guidance, schema terminology, supported-version policy, and the gem description have been updated.
Documentation site setup and descriptions
docs/README.md, docs/AGENTS.md, docs/e2e/pages.test.ts, docs/jest.integration.config.ts, docs/lib/integration-helpers.ts
Site setup, deployment, and contribution instructions have changed. Documentation descriptions, the home-page test expectation, and Jest configuration have also changed.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 06738

The checked filtering and documentation paths match their intended behavior. No identified issue blocks merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 2.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 45 functions across 20 files. (11 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: fixing filtering edge cases and validation gaps across the pull request.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 2.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 45 functions across 20 files. (11 skipped: 11 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

I’m a rabbit with a careful nose,
I check each bracket where a secret goes.
Long strings shrink, and errors stay contained,
While fresh checks keep generated files explained.
I hop through docs with carrots in my paw.

Comment @coderabbitai help to get the list of available commands.

@ndbroadbent
ndbroadbent merged commit a71c395 into main Oct 21, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation priority: high High priority review: careful Requires a careful review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant