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

Proposal: Rename development branch from master to main #3280

Closed
neocturne opened this issue Jun 11, 2024 · 7 comments
Closed

Proposal: Rename development branch from master to main #3280

neocturne opened this issue Jun 11, 2024 · 7 comments

Comments

@neocturne
Copy link
Member

As proposed by me in our April meetup:

It would be nice to follow many other projects and rename our development branch to main. When renaming the branch via Github, retargetting all open PRs would be taken care of automatically, and the Github web UI will redirect URLs from the old to the new branch.

The change would not be without churn however: According to https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch, all accesses using Git are not redirected, so everyone pulling from the Gluon master would need to update their configuration. Github actions mentioning the master branch would also need to be adjusted.

Options we may want to consider:

  • Keep a master branch synced with the main branch for some time like OpenWrt does (automatically via Github actions?)
  • Perform the rename shortly after a major Gluon release?

Mentioning all owners of the Gluon org for feedback, as we didn't have enough maintainers present at the last meetup for a decision:

Please react with 👍 or 👎 or comment if you have concerns.

@mweinelt
Copy link
Contributor

Ideally the master branch would be gone, so that everyone would need to migrate instead of accidentally working on a stale branch.

@AiyionPrime
Copy link
Member

AiyionPrime commented Jun 11, 2024

Für mich klingt es als käme GitHub uns da schon gut entgegen:

Renaming a branch will:

  • Re-target any open pull requests
    Update any draft releases based on the branch
  • Move any branch protection rules that explicitly reference the old name
  • Show a notice to repository contributors, maintainers, and admins on the repository homepage with instructions to update local copies of the repository
  • Show a notice to contributors who git push to the old branch
  • Redirect web requests for the old branch name to the new branch name
  • Return a "Moved Permanently" response in API requests for the old branch name

https://github.com/github/renaming

@blocktrron
Copy link
Member

I don't care about this change, so take me as neutral.

Perform the rename shortly after a major Gluon release?

I don't think we need to align this, given releases are built from release branches anyways.

However, please check if the CI or other tooling matches on branch naming.

@rotanid
Copy link
Member

rotanid commented Jun 11, 2024

neutral, too. so it's decided.
I assume, that the person bringing it up also takes care of the changes? @neocturne

@neocturne
Copy link
Member Author

neocturne commented Jun 13, 2024

  • For freifunk-gluon/packages, master has been renamed to main. To keep old Gluon versions buildable if they reference master explicitly, the current state of the branch has also been pushed as master , and made read-only using a branch protection rule
  • For freifunk-gluon/gluon, master has been renamed to main. No master branch exists now; unfortunately, it's not possible to prevent pushing a new master branch by accident, as branch protection rules only apply to existing branches. Maybe the same solution as done in the packages repo would be nice, for sites that explicitly reference some commit of the Gluon master?
  • Remaining references to the branch in the main repo are updated in treewide: Update main branch name #3282
  • Once that is merged, I will also announce the change on the mailing list

@herbetom
Copy link
Contributor

herbetom commented Jun 13, 2024

At least with the newer Rulesets Feature it's possible to prevent creation:

  1. https://github.com/freifunk-gluon/gluon/settings/rules
  2. New Ruleset -> New branch ruleset
  3. give it a name
  4. Active enforcement
  5. empty bypass actors
  6. Add Target -> Include by pattern
  7. pattern: master
  8. enable "Restrict creations"
  9. Create

AFAIK Rulesets and branch protection rules can coexist, so no need to convert everything immediately

@blocktrron
Copy link
Member

@neocturne This can be marked as done, right?

@mweinelt mweinelt closed this as completed Jul 9, 2024
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

No branches or pull requests

6 participants