Skip to content

Allow empty selected_repository_ids for SetSelectedReposForOrgSecret#2036

Merged
gmlewis merged 1 commit into
google:masterfrom
xun-guo-anzx:allow-empty-for-setting-selected-repository-ids
Aug 11, 2021
Merged

Allow empty selected_repository_ids for SetSelectedReposForOrgSecret#2036
gmlewis merged 1 commit into
google:masterfrom
xun-guo-anzx:allow-empty-for-setting-selected-repository-ids

Conversation

@xun-guo-anzx
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Aug 12, 2021

Sure, I'll get you a release.

@gmlewis
Copy link
Copy Markdown
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