fix(compliance): Store correct metadata of tailored profiles#19375
Conversation
|
This change is part of the following stack:
Change managed by git-spice. |
|
Skipping CI for Draft Pull Request. |
|
Images are ready for the commit at 037619f. To use with deploy scripts, first |
6084289 to
db00a0e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master-base/gualvare/ROX-31229-tailored-profiles-tracking #19375 +/- ##
=============================================================================================
- Coverage 49.65% 49.64% -0.01%
=============================================================================================
Files 2698 2698
Lines 203066 203089 +23
=============================================================================================
- Hits 100825 100817 -8
- Misses 94722 94750 +28
- Partials 7519 7522 +3
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:
|
bff0fec to
9daeeeb
Compare
2f59fc9 to
935fc33
Compare
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
TestProcessEvent_ExtendsProfile, the inline comment// Description intentionally empty to test inheritanceis now incorrect since the tailored profile sets a description; update or remove this to avoid confusion about what the test is validating. - Consider adding a test case where a tailored profile extends a base profile but omits its own description, to explicitly validate the new behavior that no description is stored (rather than inheriting from the base).
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `TestProcessEvent_ExtendsProfile`, the inline comment `// Description intentionally empty to test inheritance` is now incorrect since the tailored profile sets a description; update or remove this to avoid confusion about what the test is validating.
- Consider adding a test case where a tailored profile extends a base profile but omits its own description, to explicitly validate the new behavior that no description is stored (rather than inheriting from the base).Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
e7719e4 to
d86f013
Compare
Using the metadata of the base profile ledas to inconsistencies and bugs because some tailored profiles don't have a base profile. Using a fallback strategy (use base profile's metadata and otherwise fall back to tailored profile's metadata) adds inconsistencies around what data is stored depending on whether a TP extends a base profile. UX is further hindered because our UI shows certain labels and annotations, and a conditional approach creates inconsistent representation of TPs even if they have the same metadata. Therefore the correct approach is to store the TP metadata unconditionally. Imagine TPs A and B, both with annotation "owner=john", where only A extends a base profile X with annotation "owner=alice". Before this commit, only TP A would be stored with "owner=alice", TP B would not have annotations. A fallback strategy would result in TP A with "owner=alice" and TP B with "owner=john", which would be unintuitive. After this commit, both TPs A and B are stored with "owner=john".
935fc33 to
037619f
Compare
Description
Before this PR, the stored tailored profile (TP) annotations and labels as follows:
The description was handled the other way around:
These approaches are not coherent and problematic because:
Using the metadata of the base profile alone leads to inconsistencies and bugs, as some tailored profiles don't have a base profile.
Using a fallback strategy (use base profile's metadata and otherwise fall back to tailored profile's metadata) adds inconsistencies around what data is stored depending on whether a TP extends a base profile.
UX is further hindered because our UI shows certain labels and annotations, and a conditional approach creates inconsistent representation of TPs even if they have the same metadata.
Therefore the correct approach is to store the TP metadata unconditionally. This has been verified with stakeholders.
Imagine TPs
AandB, both with annotationowner=John, where onlyAextends a base profileXwith annotationowner=Alice.Before this PR, only TP
Awould be stored withowner=Alice, TPBwould not have annotations.A fallback strategy would result in TP
Awithowner=Aliceand TPBwithowner=John, which would be unintuitive. After this commit, both TPsAandBare stored withowner=John.User-facing documentation
Testing and quality
Automated testing
How I validated my change
CI, and I have deployed this into a cluster and verified it works as expected.