-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat(cli): lacework query fail_on_count #415
Conversation
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.
It took a lot of Customer interviews and UX sessions to figure out that a fail flag would help, have you reached out to anyone to verify that this is indeed something we want to add to the query commands? If so, go for it! 🙌🏽
One major blocker though, the os.Exit()
.
Would the previous interview and UX sessions not just apply here? I personally haven't reached out to anyone, but we're welcome to stash this until we can validate that customers will adopt such a thing... |
Fix tests ALLY-485
Update expected output for query_run help ALLY-485
Signed-off-by: Salim Afiune Maya <[email protected]>
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.
Should we close this PR?
I thought this was good to go we just wanted to refactor the "policy enforcement flows"...
Also captured in this thread: |
Updated to use new |
Removing dead code from botched merge ALLY-485
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.
Enabling tests for production pipelines Incorporating feedback for flag description ALLY-485
Fixing up test conditions ALLY-485
Fixing up test conditions ALLY-485
Wiring up exit code ALLY-485
var e *vulnerabilityPolicyError | ||
if errors.As(err, &e) { | ||
exitwithCode(e, e.ExitCode) | ||
var vpe *vulnerabilityPolicyError |
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.
cc @afiune . we needed some of this magic.
As a Lacework user I would like the "lacework query" CLI command to return a non-zero exit code when the number of results returned by my query meets a certain criteria.
I believe the cleanest way to implement this functionality would be to implement a "--fail_on_count" flag which can take on values such as ">0", "=1", "<10", etc. This allows us to evaluate the number of results returned by the query without having to alter the semantics of the query in any way.
ALLY-485