Skip to content

Conversation

WnP
Copy link
Contributor

@WnP WnP commented Feb 5, 2025

What this PR does / why we need it:

Add --deny-only flag to gator test command.

Which issue(s) this PR fixes:
Fixes #3808

@WnP WnP requested a review from a team as a code owner February 5, 2025 15:17
@WnP WnP force-pushed the gator-test-deny-only-flag branch 2 times, most recently from 8448062 to 7dfd213 Compare February 5, 2025 15:22
@codecov-commenter
Copy link

codecov-commenter commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Project coverage is 47.89%. Comparing base (3350319) to head (bd54b7b).
Report is 285 commits behind head on master.

Files with missing lines Patch % Lines
cmd/gator/test/test.go 84.21% 2 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (3350319) and HEAD (bd54b7b). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3350319) HEAD (bd54b7b)
unittests 2 1
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3809      +/-   ##
==========================================
- Coverage   54.49%   47.89%   -6.61%     
==========================================
  Files         134      234     +100     
  Lines       12329    19881    +7552     
==========================================
+ Hits         6719     9522    +2803     
- Misses       5116     9470    +4354     
- Partials      494      889     +395     
Flag Coverage Δ
unittests 47.89% <84.21%> (-6.61%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@WnP WnP force-pushed the gator-test-deny-only-flag branch from 7dfd213 to 3304001 Compare February 5, 2025 15:54
Copy link
Contributor

@JaydipGabani JaydipGabani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, Thanks for the pr!

Signed-off-by: Steeve Chailloux <me@steeve.io>
@WnP WnP force-pushed the gator-test-deny-only-flag branch from 3304001 to 84bb086 Compare March 4, 2025 08:02
@WnP
Copy link
Contributor Author

WnP commented Mar 4, 2025

Thanks @JaydipGabani,
To easy the review I've rebased my feature branch so it's no longer marked "out of date".

@JaydipGabani
Copy link
Contributor

@ritazh @sozercan PTAL

@@ -86,6 +86,8 @@ cat my-manifest.yaml | gator test --image=localhost:5000/gator/template-library:
--image=localhost:5000/gator/constraints:v1
```

The `--deny-only` will only output violations about denied constraints, not the ones using `warn` enforcement action.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @WnP ! can you pls add a note that this is only available after the v3.19 release. thanks!

@@ -86,6 +86,8 @@ cat my-manifest.yaml | gator test --image=localhost:5000/gator/template-library:
--image=localhost:5000/gator/constraints:v1
```

The `--deny-only` will only output violations about denied constraints, not the ones using `warn` enforcement action.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `--deny-only` will only output violations about denied constraints, not the ones using `warn` enforcement action.
The `--deny-only` flag will only output violations about denied constraints, not the ones using `warn` enforcement action.

Copy link
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
one nit

@ritazh ritazh added this to the v3.19.0 milestone Mar 18, 2025
@JaydipGabani
Copy link
Contributor

@WnP PTAL^^

@JaydipGabani JaydipGabani merged commit 28a5ffc into open-policy-agent:master Mar 25, 2025
19 checks passed
@WnP
Copy link
Contributor Author

WnP commented Mar 27, 2025

Hi @JaydipGabani @ritazh,
Sorry for the delay I was quite busy lastly 🙏
Thanks for the review and merge :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gator test option to log only denied constraints
4 participants