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

Add support for visibility parameter when creating / editing repository #1470

Closed
patrickmarabeas opened this issue Mar 24, 2020 · 1 comment · Fixed by #1471
Closed

Add support for visibility parameter when creating / editing repository #1470

patrickmarabeas opened this issue Mar 24, 2020 · 1 comment · Fixed by #1471
Assignees

Comments

@patrickmarabeas
Copy link
Contributor

Add support for the visibility parameter when creating or editing a repository.

Currently this has only been implemented at:
a) an organisational permission level
b) filtering when listing repositories

API: https://developer.github.com/v3/repos/#parameters-4

UI: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-new-repository

NOTE: This parameter should overwrite the private parameter when both are used.

Happy to pick this issue up if I haven't missed anything obvious.

@gmlewis
Copy link
Collaborator

gmlewis commented Mar 24, 2020

Thank you for the report, @patrickmarabeas.

For your highlighted note, the GitHub docs say:

The visibility parameter overrides the private parameter when you use both parameters with the nebula-preview preview header.

so it won't be necessary to take any extra action when visibility is populated.

I'm thinking that the cleanest solution at this point is to add a new

Visibility *string `json:"visibility,omitempty"`

field to the Repository struct in repos.go at the very end near line 124, and add a comment that this field is only used for the Create and Edit endpoints, and that its use overrides the value of the private field.

Then additionally, this same field would need to be added to the createRepoRequest struct probably right after the Private field on line 298 and it also needs to be copied over after line 336.

Sure, it would be great to have you pick up this issue. Thanks again!

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 a pull request may close this issue.

2 participants