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

Backing up GitHub private repos does not work #29

Closed
christianspecht opened this issue Feb 24, 2019 · 3 comments

Comments

Projects
None yet
1 participant
@christianspecht
Copy link
Owner

commented Feb 24, 2019

GitHub Free now includes unlimited private repositories, but the Github API call that SCM Backup makes doesn't return the private test repo I created.

Apparently it's because of this:
GET /users/:username/repos (which SCM Backup is using at the moment) only shows public repos, even when authenticated.
To see private repos, we need to use GET /user/repos
--> this means that we must authenticate with the user whose repos we want to backup.
Authenticating with User A to backup User B (which works on Bitbucket) is not possible on GitHub!

@christianspecht christianspecht added the bug label Feb 24, 2019

@christianspecht christianspecht self-assigned this Feb 24, 2019

@christianspecht christianspecht changed the title Backing up GitHub private issues does not work Backing up GitHub private repos does not work Feb 24, 2019

@christianspecht

This comment has been minimized.

Copy link
Owner Author

commented Feb 24, 2019

GET /user/repos isn't enough, the scope is also important: our docs say repo:status, but this is not enough, the private repo is shown when setting the scope to repo .

  • TODO: check if setting only some of the subitems is enough or if we absolutely need repo
  • TODO: GET /user/repos + scope repo also shows repos from orgs where the user is a member
    --> only use the repos which actually belong to the user, so SCM Backup behaves consistently across all hosters? (give it a user and it backs up the repos of that user). Or make this configurable for GitHub?
@christianspecht

This comment has been minimized.

Copy link
Owner Author

commented Feb 26, 2019

--> this means that we must authenticate with the user whose repos we want to backup.
Authenticating with User A to backup User B (which works on Bitbucket) is not possible on GitHub!

Correction: this doesn't work on Bitbucket either, so we should check this at runtime!

christianspecht added a commit that referenced this issue Feb 26, 2019

@christianspecht

This comment has been minimized.

Copy link
Owner Author

commented Feb 27, 2019

Does the API return the scope? If yes, display a warning if the scope is "too low" (so only public repos are shown)

christianspecht added a commit to christianspecht/scm-backup-docs that referenced this issue Mar 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.