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

Support private github repository #1690

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open

Conversation

NobodyXu
Copy link
Member

@NobodyXu NobodyXu commented May 5, 2024

Fixed #1681

@scullionw
Copy link

is there anything we can do to help move this forward? maybe testing a build?

@NobodyXu
Copy link
Member Author

is there anything we can do to help move this forward? maybe testing a build?

I just need to spend more time on this, I'm a bit busy recently, but rest asure, I didn't forget it.

@NobodyXu
Copy link
Member Author

Update: I'm a bit busy this week.

cc @scullionw we actually need more contributors for cargo-binstall.

If you are willing to submit a PR, then I can do a code review very quickly.

If you have time, you could pick up where I have left and I'm willing to answer any questions you have related to the codebase.

To make it easier to create generic function

Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
`cargo test` run all tests in one process.

As such, `set_global_default` would fail on the second call.

Signed-off-by: Jiahao XU <[email protected]>
which is always set to `None`

Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
@NobodyXu
Copy link
Member Author

NobodyXu commented Jun 9, 2024

When debugging CI failure, I've found:

DEBUG has_release_artifact{release=GhRelease { repo: GhRepo { owner: "cargo-bins", repo: "private-repo-for-testing" }, tag: "0.12.0" } artifact_name="cargo-binstall-x86_64-unknown-linux-musl-v0.12.0.tar"}: response = GraphQLResponse { data: GraphQLData { repository: Some(GraphQLRepo { release: None }) }, errors: None }

seems that somehow release artifact GraphQL cannot found the release in the repository, despite it being present in the repo.

@NobodyXu
Copy link
Member Author

NobodyXu commented Jun 9, 2024

Ok turns out that I forgot to give the token enough permission.

I've recreated github token, using another machine account which only has read-only access to the repository, and give the new token full access to the private repostories of that machine account, since it has read-only access anyway.

e2e-tests/private-github-repo.sh Outdated Show resolved Hide resolved
crates/binstalk-git-repo-api/src/gh_api_client.rs Outdated Show resolved Hide resolved
crates/binstalk-git-repo-api/src/gh_api_client.rs Outdated Show resolved Hide resolved
@NobodyXu NobodyXu marked this pull request as ready for review June 9, 2024 14:48
@NobodyXu NobodyXu requested a review from passcod June 9, 2024 14:59
@NobodyXu
Copy link
Member Author

cc @scullionw This PR is now ready for review, you should be able to download from private repositories using this PR, could you have a try please?

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 this pull request may close these issues.

BUG: cannot access private repositor with GITHUB_TOKEN provided
2 participants