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

Set repo visibility #5

Closed
2 tasks
Tracked by #136
dylan-smith opened this issue Oct 14, 2021 · 2 comments · Fixed by #956
Closed
2 tasks
Tracked by #136

Set repo visibility #5

dylan-smith opened this issue Oct 14, 2021 · 2 comments · Fixed by #956
Assignees
Labels

Comments

@dylan-smith
Copy link
Collaborator

dylan-smith commented Oct 14, 2021

Customers have asked if it's possible to add an option to let them set a state other than private for a repo when it's done migrating. This capability is already implemented in Octoshift, so this issue tracks passing the appropriate data to Octoshift via the CLI to use this feature.

The customer can configure this in the CLI. When they run generate script we will add a --target-repo-visibility option to migrate repo that by default matches the state that the source repo was in.

Todo

  • Update the CLI generate script to add a --target-repo-visibility to the migrate-repo command that adds the state that the source repo was in (i.e. private/public/internal). If the field isn't included then the default should be private.
  • --target-repo-visibility should be included in for ado2gh customers. We can just default to private for that scenario.
@dylan-smith dylan-smith changed the title Ability to automate setting repo visibility to Internal Automate setting repo visibility to Internal Oct 16, 2021
@dylan-smith dylan-smith changed the title Automate setting repo visibility to Internal Set repo visibility Nov 17, 2021
@dylan-smith dylan-smith mentioned this issue Nov 17, 2021
5 tasks
@synthead
Copy link
Collaborator

synthead commented Sep 12, 2022

Should this be added to Octoshift instead?

Edit: after a conversation with the team, this has already been implemented in Octoshift, and this feature tracks consuming this feature with the CLI! I have updated the issue body to reflect this 👍

@tambling tambling self-assigned this Sep 14, 2022
@dylan-smith dylan-smith self-assigned this Sep 22, 2022
@tambling tambling linked a pull request Feb 7, 2023 that will close this issue
5 tasks
@tambling tambling removed a link to a pull request Feb 7, 2023
5 tasks
@timrogers
Copy link
Contributor

I do definitely think we should do this. It would be easy to add in the migrate-repo command at least. I guess it's likely to be harder in generate-script, as you probably want the ability to "inherit" visibility from the source.

@dylan-smith dylan-smith self-assigned this Apr 10, 2023
dylan-smith added a commit that referenced this issue Apr 13, 2023
<!--
For the checkboxes below you must check each one to indicate that you
either did the relevant task, or considered it and decided there was
nothing that needed doing
-->

Implements part of #5 (FINALLY!)

- [x] Did you write/update appropriate tests
- [x] Release notes updated (if appropriate)
- [x] Appropriate logging output
- [x] Issue linked
- [x] Docs updated (or issue created)
- [x] New package licenses are added to `ThirdPartyNotices.txt` (if
applicable)

This was originally implemented by @tambling in #647 . However there was
some back and forth on some design questions and it never got merged,
and now that PR/branch is so far behind main I figured it would be
easier to just redo the changes in a new branch rather than trying to
resolve the merge/rebase conflicts with the previous PR/branch.

This adds a `--target-repo-visibility` argument to all 3 `migrate-repo`
commands. Octoshift backend already supports this arg in the API's, we
just never used it (until now).

I will do a separate PR that updates `generate-script`.

<!--
For docs we should review the docs at:

https://docs.github.com/en/early-access/github/migrating-with-github-enterprise-importer
and the README.md in this repo

If a doc update is required based on the changes in this PR, it is
sufficient to create an issue and link to it here. The doc update can be
made later/separately.

The process to update the docs can be found here:
https://github.com/github/docs-early-access#opening-prs

The markdown files are here: 

https://github.com/github/docs-early-access/tree/main/content/github/migrating-with-github-enterprise-importer
-->
dylan-smith added a commit that referenced this issue Apr 13, 2023
<!--
For the checkboxes below you must check each one to indicate that you
either did the relevant task, or considered it and decided there was
nothing that needed doing
-->

- [x] Did you write/update appropriate tests
- [x] Release notes updated (if appropriate)
- [x] Appropriate logging output
- [x] Issue linked
- [x] Docs updated (or issue created)
- [x] New package licenses are added to `ThirdPartyNotices.txt` (if
applicable)

Closes #5 

Updated all 3 `generate-script` commands to always include the
`--target-repo-visibility` arg. For `gei` it will inspect the
source-repo and set the value appropriately in the script. For `ado2gh`
and `bbs2gh` it will always set the value to `private`.

Originally I added a separate function `GithubApi.GetRepoVisibility()`
but this resulted in an API call per repo when generating the script
which made it significantly slower for large orgs. The API we already
call to get the list of repos also returns the visibility, so I updated
`GithubApi.GetRepos()` to return a tuple with repo name and visibility.

<!--
For docs we should review the docs at:

https://docs.github.com/en/early-access/github/migrating-with-github-enterprise-importer
and the README.md in this repo

If a doc update is required based on the changes in this PR, it is
sufficient to create an issue and link to it here. The doc update can be
made later/separately.

The process to update the docs can be found here:
https://github.com/github/docs-early-access#opening-prs

The markdown files are here: 

https://github.com/github/docs-early-access/tree/main/content/github/migrating-with-github-enterprise-importer
-->

---------

Co-authored-by: Arin Ghazarian <aringhazarian@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants