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

Allow "main" as a deployable branch #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

me-and
Copy link

@me-and me-and commented Dec 23, 2023

Git repositories, including newlib-cygwin, are increasingly using "main" rather than "master" as the default branch name. As such, Scallywag should treat the two equivalently, rather than only allowing deployment from a branch called "master".

Git repositories, including newlib-cygwin, are increasingly using "main"
rather than "master" as the default branch name.  As such, Scallywag
should treat the two equivalently, rather than only allowing deployment
from a branch called "master".
@jon-turney
Copy link
Member

Oh wow! A PR. Thanks! Sorry about the delay in replying, but for some reason I didn't get a notification about this.

So, something needs to be done about switching over to "main", but I'm not quite sure this is the right thing. I think that at the moment, the gitolite configuration (generated by https://cygwin.com/cgit/cygwin-apps/calm/tree/calm/mkgitoliteconf.py) doesn't allow pushes to main, only master and playground and tags.

I guess what needs to happen is something like:

  • Switch the default branch for exisiting package repos to main, make master a symref to that to avoid breaking existing users
  • Make the default branch for newly created gitolite repos main as well (not sure how we do that); maybe also make master a symref in gitolite's post-create trigger)
  • Update the gitolite configuration generation to allow pushes to main and master
  • I don't think post_receive needs to filter out changes to master (to avoid triggering twice), since it doesn't get invoked when underlying reference changes?
  • Change the check in deployable_job to reference main

There's also a few places where the master branch of the scallywag repo itself is referenced by the code but that can be dealt with separately.

(There's also some cosmetic issue with cgit that is tangled up with this: it's something like it uses defbranch=master by default, and can't work out the idle time to display correctly through a symref, so if master is one, we need to add repo.defbranch=main to the repo configureation)

Needless to say, I could use some help making all these things happen 😕

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