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

[SECENG-601] Added policy logs command to fetch decision audit logs #734

Merged
merged 4 commits into from
Jun 13, 2022

Conversation

sagar-connect
Copy link
Contributor

@sagar-connect sagar-connect commented Jun 8, 2022

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.

Changes

=======

  • Added policy logs command to fetch policy decision logs
  • Added tests to verify the new subcommand

Rationale

=========

Jira: https://circleci.atlassian.net/browse/SECENG-601

@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #734 (9baff52) into master (479631b) will increase coverage by 0.69%.
The diff coverage is 73.25%.

@@            Coverage Diff             @@
##           master     #734      +/-   ##
==========================================
+ Coverage   30.59%   31.29%   +0.69%     
==========================================
  Files          44       44              
  Lines        5171     5257      +86     
==========================================
+ Hits         1582     1645      +63     
- Misses       3357     3371      +14     
- Partials      232      241       +9     
Impacted Files Coverage Δ
api/policy/policy.go 62.58% <71.87%> (+2.58%) ⬆️
cmd/policy/policy.go 80.43% <74.07%> (-2.65%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 479631b...9baff52. Read the comment docs.

@sagar-connect sagar-connect marked this pull request as ready for review June 8, 2022 17:45
@sagar-connect sagar-connect requested a review from a team as a code owner June 8, 2022 17:45
@sagar-connect sagar-connect changed the title [SECENG-601] Added 'get-policy-decision-logs' command [SECENG-601] Added policy logs command to fetch decision audit logs Jun 8, 2022
@davidmdm
Copy link
Contributor

davidmdm commented Jun 8, 2022

BIG QUESTION @sagar-connect .

So this is making a single API call to our service to fetch some decision logs, and allowing the user to offset the decisions manually...

Since this is meant to download between a time-range... should we not automatically paginate through the results until there are 0 items left?

My gut feeling is that we should. Although, a valid case could be made otherwise.

Let's discuss this issue before merging!

Otherwise the code looks good!

Copy link
Contributor

@am-bui am-bui left a comment

Choose a reason for hiding this comment

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

LGTM!

@sagar-connect sagar-connect merged commit a65cbb5 into master Jun 13, 2022
@sagar-connect sagar-connect deleted the seceng-601-policy-decision-audit-log branch June 13, 2022 15:57
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.

3 participants