ROX-33774: broad pattern warnings for file paths#19847
Draft
ROX-33774: broad pattern warnings for file paths#19847
Conversation
|
Skipping CI for Draft Pull Request. |
Contributor
🚀 Build Images ReadyImages are ready for commit e16c790. To use with deploy scripts: export MAIN_IMAGE_TAG=4.11.x-574-ge16c790726 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19847 +/- ##
==========================================
- Coverage 49.60% 49.58% -0.02%
==========================================
Files 2763 2766 +3
Lines 208339 208530 +191
==========================================
+ Hits 103342 103408 +66
- Misses 97331 97450 +119
- Partials 7666 7672 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Show non-blocking warnings in the policy wizard when users enter overly broad file path glob patterns (root catch-alls, high-churn directory globs) to help prevent excessive alert volume. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
a6da532 to
76ef0ca
Compare
Static helper text was unconditionally marked as a live region, causing screen readers to announce it on initial render. Restrict aria-live behavior to states where dynamic feedback is present. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
…source of truth The nested ternary mapping prefixes to activity labels was disconnected from the array, requiring two updates when adding a prefix. Using a Record<string, string> co-locates the data and uses Array.find() to avoid iterator/generator overhead from for-of loops. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
Collapse multi-line ternary expressions to single lines to satisfy prettier rules flagged by CI style-check. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
…yCriteriaFieldInput Deduplicate the error > warning > default priority logic that was expressed twice in the JSX -- once for the validated/variant prop and once for the displayed message. A single feedbackVariant and feedbackMessage variable now serves both, preventing the two from drifting out of sync. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
The /[*]/ regex uses a character class with a single literal character,
which is functionally identical to String.includes('*') but less readable.
Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
Replace toBeDefined() with toContain() for one representative test per warning branch so branch-swap bugs are caught without being brittle to exact wording changes. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Jira: ROX-33774
Add non-blocking warning messages to file path inputs in the policy wizard when users enter glob patterns that are structurally too broad (e.g.,
/**,/tmp/**). Warnings describe the risk and suggest a narrower alternative.warnproperty toTextDescriptortypewarnBroadFilePathfunction detecting root catch-alls, root single-level globs, and high-churn directory globs (/tmp,/proc,/sys,/var/log)HelperTextItem variant="warning"withisLiveRegionfor accessibilityUser-facing documentation
Testing and quality
Automated testing
How I validated my change
warnBroadFilePathpolicyCriteriaDescriptors.test.tspassScreenshots