-
Notifications
You must be signed in to change notification settings - Fork 33
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
Include term Attribute in Violations and Warnings Output #2045
Include term Attribute in Violations and Warnings Output #2045
Conversation
Signed-off-by: arpit529srivastava <[email protected]>
@simonbaird @ralphbean @caugello @zregvart Please review this and add the label |
@@ -217,9 +217,12 @@ func keepSomeMetadata(results []evaluator.Result) { | |||
} | |||
} | |||
|
|||
// keepSomeMetadataSingle retains only specific metadata keys in the result. | |||
// **Updated to include "term" by default as per the acceptance criteria.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this line.
func keepSomeMetadataSingle(result evaluator.Result) { | ||
for key := range result.Metadata { | ||
if key == "code" || key == "effective_on" { | ||
// Retain "code", "effective_on", and "term" keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment doesn't seem very helpful. Let's drop it.
Thanks! Looks reasonable. Just a couple of minor comments. Could you also update the git commit with a more specific title and description? Let's also update the tests as needed. See the Testing section in the README for how to run those locally if you want. |
@lcarva please let me know if there is any issue or any changes that you want |
@lcarva please add label |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2045 +/- ##
=======================================
Coverage 73.70% 73.70%
=======================================
Files 85 85
Lines 5561 5561
=======================================
Hits 4099 4099
Misses 1462 1462
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@lcarva can you please merge it |
@Arpit529Srivastava, please see my comments and the failed test. |
+1 to fixing the commit message so it describes the change. https://cbea.ms/git-commit/ is a useful guide to follow. |
/ok-to-test |
Apart from a nicer commit message and making sure tests pass, we could also update the text output? A change to the |
Sure will do it by today |
@Arpit529Srivastava, are you still interested in driving these changes? |
Closing this due to lack of activity. Please, feel free to re-open it if you get back to it! |
issue #1668
About
This Pull Request modifies the output format of the ec validate image command to include the term attribute in the violations and warnings reported through YAML or JSON formats. This change ensures that users can view important contextual information alongside each violation and warning without needing to provide the --info flag.
Before:
Violations and warnings were reported without the term attribute by default, making it harder for users to understand the context and significance of each issue.
Users had to remember to use the --info flag to access additional details, which could lead to confusion or oversight.
After:
Enhances Output: Automatically includes the term attribute in the JSON/YAML output for all violations and warnings, providing users with more context about each issue.
Improves Usability: Eliminates the need for the --info flag to access the term, making the output more user-friendly and informative by default.
Facilitates Filtering: Users can utilize the term for include/exclude causes more effectively, aiding in better decision-making during validation processes.