Skip to content

Conversation

xun-guo-anzx
Copy link
Contributor

Fix #2035 - Allow empty selected_repository_ids for SetSelectedReposForOrgSecret

@google-cla google-cla bot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Aug 11, 2021
@codecov
Copy link

codecov bot commented Aug 11, 2021

Codecov Report

Merging #2036 (565a992) into master (7b61934) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2036   +/-   ##
=======================================
  Coverage   97.87%   97.87%           
=======================================
  Files         107      107           
  Lines        6907     6907           
=======================================
  Hits         6760     6760           
  Misses         81       81           
  Partials       66       66           
Impacted Files Coverage Δ
github/actions_secrets.go 100.00% <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 7b61934...565a992. Read the comment docs.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 11, 2021

The GitHub v3 API docs for this endpoint state:

You can only provide a list of repository ids when the visibility is set to selected.

Am I reading this correctly that this endpoint should simply not be called when visibility is set to some other value?

I ask because I'm trying to figure out if there is any case when you would want to call this endpoint but NOT send a value for selected_repository_ids ?

@xun-guo-anzx
Copy link
Contributor Author

Yes - this endpoint should simply not be called when visibility is not selected, otherwise the following error will be returned:

"errors": "You cannot update selected repositories for a secret when the visibility is not set to 'selected'",

My use case for calling this endpoint without sending a value for selected_repository_ids is to set selected repository list to empty. However like I mentioned above I'll send over an empty array instead of nil or something else.

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, @xun-guo-anzx !
LGTM.
Merging.

@gmlewis gmlewis merged commit 95b92df into google:master Aug 11, 2021
@xun-guo-anzx
Copy link
Contributor Author

Thanks @gmlewis , may I request a release for this change?

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 12, 2021

Sure, I'll get you a release.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 12, 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.

API error when passing empty array as selected_repository_ids in SetSelectedReposForOrgSecret
2 participants