fix(filter:drop): add validation to restrict inclusion of single quote to condition - #3390
fix(filter:drop): add validation to restrict inclusion of single quote to condition#3390jcantrill wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change adds schema and runtime validation for drop-filter expressions, propagates filter and transform errors during configuration generation, adds unit and end-to-end coverage, documents collector termination settings, and corrects sequence descriptions. ChangesDrop-filter validation and generation
Documentation updates
Test adjustment
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Summary by QodoHarden drop filter regex handling: reject single quotes and fix notMatches validation
AI Description
Diagram
High-Level Assessment
Files changed (13)
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcantrill The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/reference/datamodels/viaq/v1.adoc`:
- Line 521: Replace the misspelled word “estblish” with “establish” in every
repeated ViaQ sequence description, including the entries identified in the
review, while leaving the rest of each description unchanged.
In `@internal/validations/observability/filters/validate_filters.go`:
- Around line 58-67: Update validation in
internal/validations/observability/filters/validate_filters.go lines 58-67 to
reject newline and carriage-return characters in both testCondition.Matches and
testCondition.NotMatches, alongside single quotes. Also update the pattern
checks in internal/generator/vector/filter/drop/filter.go lines 33-60 to reject
\n and \r before interpolating either pattern into VRL, keeping both runtime
paths aligned with the API contract.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: b2b4ddb0-ffd6-42d2-8fc5-8dea56889b90
📒 Files selected for processing (13)
api/observability/v1/filter_types.gobundle/manifests/observability.openshift.io_clusterlogforwarders.yamlconfig/crd/bases/observability.openshift.io_clusterlogforwarders.yamldocs/reference/datamodels/viaq/v1.adocdocs/reference/operator/api_observability_v1.adocinternal/generator/vector/filter/drop/filter.gointernal/generator/vector/filter/drop/filter_test.gointernal/validations/observability/filters/validate_filters.gointernal/validations/observability/filters/validate_filters_test.gotest/e2e/collection/apivalidations/api_validations_test.gotest/e2e/collection/apivalidations/drop-filter-single-quote-matches.yamltest/e2e/collection/apivalidations/drop-filter-single-quote-notmatches.yamltest/e2e/collection/apivalidations/drop-filter-valid.yaml
Code Review by Qodo
1.
|
|
/retest |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/generator/vector/adapters/pipeline.go`:
- Around line 29-33: Update Pipeline.Transforms and the NewPipeline generation
flow so a nil result from pf.Transform() returns an error and aborts generation
instead of logging and omitting the transform. Ensure no later filters or
outputs are wired after this failure, and add regression coverage using a
factory that returns nil.
In `@test/helpers/types/types.go`:
- Line 168: Update the comment describing Sequence to use the grammatically
correct wording “Sequence is an increasing ID,” preserving the existing
explanation about its use with the timestamp.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 341ae269-437e-437f-91f7-5e19b79736de
📒 Files selected for processing (6)
internal/generator/vector/adapters/pipeline.gointernal/generator/vector/filter/drop/filter.gointernal/pkg/generator/forwarder/generator.gointernal/validations/observability/filters/validate_filters.gointernal/validations/observability/filters/validate_filters_test.gotest/helpers/types/types.go
🚧 Files skipped from review as they are similar to previous changes (3)
- internal/validations/observability/filters/validate_filters_test.go
- internal/validations/observability/filters/validate_filters.go
- internal/generator/vector/filter/drop/filter.go
7d74b0b to
32c75df
Compare
…e to condition ref: LOG-9704
|
@jcantrill: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
ref: LOG-9704
Description
Links
cc @Clee2691 @vparfonov
Summary by CodeRabbit
Bug Fixes
Documentation
terminationGracePeriodSecondsfor collector pods, including its 10-second default.