-
Notifications
You must be signed in to change notification settings - Fork 391
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
Migrate ALL providers to expecting main branch, not just GitHub, and announce the change #1175
Comments
I think what might be even more appropriate, if more complex, is to use a special not-valid ref e.g. |
Yes, I agree that that is the ideal resolution to this! |
Would it need to be resolved before or after the repo is cloned? Edited to add: We could probably use the GET request in this code block if it needed to be resolved before #1145 (comment) |
That's what I was aiming at with "is there a good git and/or github call to resolve the default branch?" GitHub definitely has an API for it, but I wonder if we can use the git remote API to make it work for all the git providers without needing a new implementation for every provider. That's always been a mysterious API to me, though. |
Looks like it's possible, if we parse this output: $ git ls-remote --symref https://github.com/minrk/jupyter-activity-data HEAD
ref: refs/heads/main HEAD
97275c467fc137d7a3947c8f9b43635c69a4ea8f HEAD
$ git ls-remote --symref https://github.com/jupyterhub/jupyterhub HEAD
ref: refs/heads/master HEAD
f92560fed024288ed834e8e7f8a26363d6117a7c HEAD |
That's very cool! |
Yes, this is related to #895 which also uses ls-remote to resolve refs. The addition of But this is even easier than I thought! HEAD is already a valid ref, so it's working already and we should just make our default ref HEAD instead of a branch name, and our existing APIs already work: https://mybinder.org/v2/gh/binderhub-ci-repos/requirements/HEAD This is strictly better than resolving the default branch name and using that in the URL, because it allows creating a stable link that will work across default branch changes without changes to the link. Need to test with all providers, but I think it'll work. |
#1186 switches the default ref to HEAD. Works everywhere without modification, except for gist, where we were resolving master -> latest ref ourselves. |
The work done in #1172 means that binderhub now looks for the
main
branch if a ref isn't provided, rather thanmaster
. This is probably a change we should roll out across all providers but I, at least, am unfamiliar with where these other communities are in this process and this change will be breaking previously established behaviour, possibly disrupting a lot of users. Therefore, I think we should have some form of "announcement" (blog post, twitter thread...) ready to go when we do make this change, just so users aren't blind-sided and they can find information on how to fix their links.Note: This change does not affect gists over which the user has no control of the ref naming.
TODOs
placeholder
variable added in PR Update UI and launch main branch by default for GitHub repos #1172The text was updated successfully, but these errors were encountered: