Issue with migrating master -> main
See original GitHub issueWe have recently moved the master
branch to main
on all the Bokeh repos except our bokeh-notebooks
repo. This is because our docs headers link to tutorials at a URL that explicitly includes “master”:
If the master
branch is deleted, this binder fails to launch. I had heard GH is now redirecting deleted branches to the new default branch, but even if this is true apparently it is not enough to get binder to launch from that URL if only main
exists.
Lots of projects are currently considering or implementing such changes. Is there any possible solution to help support this kind of change transparently the binder side? We could obviously try to update things on our end but the that would mean changing tens of thousand of files on s3 to change, which would incur both operational and financial risk.
cc @betatim
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (9 by maintainers)
Given that the scope of the workaround is fairly small and well defined (only for rename away from master for default branch on GitHub—other repo providers perhaps in the future if they provide similar resolution for the default branch), I think we can implement this now/soon with little cost, and it may become obsolete if github implements its own redirect.
Update: I created https://github.com/minrk/test-default-branch with:
As far as I can tell, the links for deleted branches redirecting to default is only applied to blob pages, not even tree. I tested with the following links:
tested 2020-08-28, may change as GitHub rolls things out
So if github doesn’t provide a redirect in the api, we could implement this redirect ourselves for renamed master only with:
I also think we should probably change our code in various places away from hardcoded master to a special value, e.g.
$default
(must not be a valid ref) that resolves to the repo default branch instead of assuming that to be master (or main, etc.)