-
Notifications
You must be signed in to change notification settings - Fork 171
ROX-27260: Fix policy scope validation for edit/clone #18925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18925 +/- ##
==========================================
- Coverage 49.48% 49.48% -0.01%
==========================================
Files 2661 2661
Lines 200784 200784
==========================================
- Hits 99357 99355 -2
- Misses 94011 94013 +2
Partials 7416 7416
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:
|
|
Images are ready for the commit at beb3999. To use with deploy scripts, first |
|
Delayed observation, not change request:
If frontend code works for both scenarios (for example, via optional chaining) what is pro and con for it to initialize as |
|
For the record, Brad and I discussed possible improvements for later contributions. |
|
/retest-required |
Description
Fixes policy wizard step 4 validation failing on edit/clone when an excluded deployment scope has only a name (e.g. "node-resolver") and no scope.
The backend returns
scope: nullfor name only exclusions, but the UI form initializes new exclusions withscope: { label: {} }. The yup schema didn't accept null, so validation rejected the entry before the custom test (which already handles null via optional chaining) could run. Added.nullable()to the scope schema and updated theWizardExcludedDeploymenttype to allow null.User-facing documentation
Testing and quality
Automated testing
How I validated my change
Added additional automated tests and performed the following manual verification:
The system policy "90-Day Image Age" includes an inclusion/exclusion scope where only a deployment name is specified. Prior to this fix, cloning or editing the policy caused the Next button to be disabled. After this change, the Next button now works as expected.