Skip to content
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

[SNC-10] Process ERROR policy decision state #809

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

sagar-connect
Copy link
Contributor

@sagar-connect sagar-connect commented Nov 24, 2022

Jira: https://circleci.atlassian.net/browse/SNC-10

Checklist

=========

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked for similar issues and haven't found anything relevant.
  • This is not a security issue (which should be reported here: https://circleci.com/security/)
  • I have read Contribution Guidelines.

Internal Checklist

  • I am requesting a review from my own team as well as the owning team
  • I have a plan in place for the monitoring of the changes that I am making (this can include new monitors, logs to be aware of, etc...)

Changes

=======

  • Updated the dependency circle-policy-agent, this brings the new policy decision status ERROR.
  • Updated strict mode for ``policy decisioncommand to return non-zero status code forERROR` status as well.
  • Added unit-tests around handling of ERROR status.
  • Updated windows executor for test_windows job. The old executor was running Go1.17, the new executor runs Go1.19.

Rationale

=========
This change enables the user to view the decisions with ERROR status and also their Reason of error.
This change is an extension to: CircleCI-Public/circle-policy-agent#66

Test Plan

=========

  • Unit-tests suite is updated, run and passed.
  • A CLI binary is built and tested locally, and is found to be working as expected.
  • After merging with main, CLI will be tested again.

@sagar-connect sagar-connect changed the title [SNC-10] Process ERROR decision state [SNC-10] Process ERROR policy decision state Nov 24, 2022
@sagar-connect sagar-connect force-pushed the SNC-10-error_decision_status branch from 275cddb to d1dcca8 Compare November 25, 2022 02:52
@sagar-connect sagar-connect marked this pull request as ready for review November 25, 2022 14:56
@sagar-connect sagar-connect requested a review from a team as a code owner November 25, 2022 14:56
Copy link

@lloydChris lloydChris left a comment

Choose a reason for hiding this comment

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

Nit: I might pull the windows orb update out into a separate PR or a separate commit

The new logic looks good, Just some questions around tests

cmd/policy/policy_test.go Show resolved Hide resolved
@sagar-connect
Copy link
Contributor Author

@lloydChris Thanks for reviewing :)
The windows orb update are needed in this PR itself.

Reason: The circle-policy-agent is updated in this PR, which now requires go1.18+ to build.
The test_windows were failing because the older orb had go1.17 in in. The updated windows orb has go1.19

@sagar-connect sagar-connect merged commit 19bba9e into master Nov 28, 2022
@sagar-connect sagar-connect deleted the SNC-10-error_decision_status branch November 28, 2022 16:04
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.

4 participants