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

audit log query options should use url tag #2128

Merged
merged 1 commit into from Oct 19, 2021

Conversation

sfunkhouser
Copy link
Contributor

When using the query option params for the audit log I noticed the filters were not working, for example, when setting:

searchPhrase := "actor:sfunkhouser"
include := "all"

opts := &github.GetAuditLogOptions{
		Phrase:  &searchPhrase,
		Include: &include,
	}

The results returned contained other activites besides the listed actor. Upon further investigation, I noticed the query string being sent was:

Include=all&Phrase=actor%3Asfunkhouser

Although, I don't understand why these are case sensitive, when testing with

include=all&phrase=actor%3Asfunkhouser

The expected results are returned.

Looking at the other ...Options structs in this repo I saw that those all use the url tag instead of json. Switching to this allowed for the correct string to be used in the the query string and resulting data back was correct.

@google-cla google-cla bot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Oct 19, 2021
@sfunkhouser sfunkhouser marked this pull request as ready for review October 19, 2021 01:38
@codecov
Copy link

codecov bot commented Oct 19, 2021

Codecov Report

Merging #2128 (4120f43) into master (72ec8bb) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2128   +/-   ##
=======================================
  Coverage   97.78%   97.78%           
=======================================
  Files         112      112           
  Lines        9970     9970           
=======================================
  Hits         9749     9749           
  Misses        154      154           
  Partials       67       67           
Impacted Files Coverage Δ
github/orgs_audit_log.go 100.00% <ø> (ø)

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 72ec8bb...4120f43. Read the comment docs.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @sfunkhouser !
LGTM.
Merging.

@gmlewis gmlewis merged commit 7a3c3d4 into google:master Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants