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

feat: add rule for downloading private github assets #134

Merged
merged 2 commits into from
May 23, 2024

Conversation

jungleraptor
Copy link
Contributor

@jungleraptor jungleraptor commented May 16, 2024

Github release assets from private repositories are not available at the download link url like public assets.

They require a relatively complicated sequence of http requests to get the actual content - which is not possible with any of the OTB bazel donwloader rules (http_file, http_archive, etc..).

Luckily someone else has already solved this problem for us:
https://www.stevenengelhardt.com/2023/05/23/practical-bazel-downloading-private-release-assets-from-github/

I've taken this code so that we can download private github assets

Related: https://github.com/swift-nav/starling/pull/9180

@jungleraptor jungleraptor requested a review from pcrumley May 16, 2024 20:11
Copy link
Contributor

@pcrumley pcrumley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the best way to take in upstream functions like this copying and pasting them?

Kind of feels like a step backwards when it comes to dependency management but I assume this is just commonplace in bazel

@jungleraptor
Copy link
Contributor Author

Is the best way to take in upstream functions like this copying and pasting them?

Kind of feels like a step backwards when it comes to dependency management but I assume this is just commonplace in bazel

It's just some guys blog post - there's a chance that this made it into one of the more popular upstream utility rules sets (like bazel-lib, or skylib) but admittedly I did not check.

But yes in general there's a lot of copy pasting rules in the bazel ecosystem. The new modules system and the Bazel Central Registry aims to improve this situation but it's still pretty early.

@jungleraptor jungleraptor merged commit 27e7d4e into main May 23, 2024
1 check passed
@jungleraptor jungleraptor deleted the isaac/github-asset branch May 23, 2024 16:46
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.

2 participants