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

Basic Usage Docs #68

Closed
Tracked by #105
dylan-smith opened this issue Oct 22, 2021 · 2 comments · Fixed by #175
Closed
Tracked by #105

Basic Usage Docs #68

dylan-smith opened this issue Oct 22, 2021 · 2 comments · Fixed by #175
Labels
documentation Improvements or additions to documentation task

Comments

@dylan-smith
Copy link
Collaborator

dylan-smith commented Oct 22, 2021

Create some basic docs on how to use the CLI tooling. Especially what PAT scopes are needed in order to run the various commands.

I've been testing with All Orgs + Full Access for the ADO PAT, and similarly broad scopes for the GH PAT.

The scopes needed will be diff for diff commands (e.g. generate-script only does ADO reads, but obviously some other commands are writing stuff).

There's another issue #20 to code in some explicit tests for the right permissions, this issue represents just figuring out what's needed and documenting it.

@dylan-smith dylan-smith added this to To do in OctoshiftCLI Oct 22, 2021
@bryantson
Copy link

@dylan-smith

Can you update the last README.md with the following instruction?


To actually generate a script, you'll need to set an ADO_PAT as an environment variable with the following permissions:

ADO PAT Permission Scopes
Build Read
Code Full & Status
Graph Read & Manage
Identity Read
Service Connections Read
User Profile Read

To test, you can run disable-ado-repo command with the following format:

octoshift disable-ado-repo --ado-org <YOUR ADO organization name> --ado-team-project <Your ADO Project name> --ado-repo <Your repo name>

Make sure to enable your Azure DevOps Repo again before you start the migration.

image

Performing any of the commands that actually touch GitHub will need the GH_PAT environment variable with the following permissions:

GitHub PAT Permission Scopes
Repo Full
Org admin

For example, the following command with generate a Bash script file called migrate.sh with the commands to migrate all enabled repos from ADO to your GitHub Organization.

octoshift generate-script --github-org <Your GitHub Organization> --ado-org <Your ADO organization> --output migrate.sh

WARNING - 11/06/21: As of now, the script will generate a command starting with ./octoshift, which currently points to the current directory. You need to change those lines to octoshift to point to the environment level.

Running that generated file, for example migrate.sh after chmod with chmod +x migrate.sh will start the migration process. However, before start doing so, you have to install the Azure Pipeline App in your GitHub Profile and connect with Azure DevOps project. Otherwise, you will get this error:

[WARNING] CANNOT FIND GITHUB APP SERVICE CONNECTION IN ADO ORGANIZATION: xxxx. You must install the Pipelines app in GitHub and connect it to any Team Project in this ADO Org first

@dylan-smith dylan-smith changed the title Figure out what PAT scopes are needed for each command Basic Usage Docs Nov 16, 2021
@dylan-smith dylan-smith added the documentation Improvements or additions to documentation label Nov 16, 2021
@dylan-smith
Copy link
Collaborator Author

We'll need to condense this down into something easier for customers to consume, but here's the detailed info on what scopes are needed for which commands:

generate-script
ADO: Build (Read)
ADO: Code (Read)
ADO: Service Connections (Read)

generate-script (--repos-only)
ADO: Build (Read) -- REMOVING THIS in v0.5
ADO: Code (Read)

migrate-repo
ADO: Code (Read)
GH: Repo (all)
GH: read:org
** ADO: Identity (Read)
** ADO: Work Item (Read)

add-team-to-repo
GH: Repo (All)

configure-autolink
GH: Repo (All)

create-team
GH: Repo (All)

lock-ado-repo
ADO: Code (Read)
ADO: Identity (Read)
ADO: Security (Manage)

disable-ado-repo
ADO: Code (Read, write & manage)

rewire-pipeline
ADO: Build (Read & execute)

share-service-connection
ADO: Full Access

integrate-boards
ADO: Full Access (for GetGithubHandle API)
GH: Repo (All)

grant-migrator-role
GH: read:org

revoke-migrator-role
GH: read:org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation task
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants