Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Update base branch to 'main' #148

Closed
geerlingguy opened this issue Jul 1, 2020 · 8 comments
Closed

Update base branch to 'main' #148

geerlingguy opened this issue Jul 1, 2020 · 8 comments

Comments

@geerlingguy
Copy link
Collaborator

SUMMARY

In ansible-collections/overview#83, it was decided that all Ansible-maintained collections would default to a 'main' branch instead of the current default, 'master'.

This issue is to track progress on that work for the community.kubernetes collection, against ansible-collections/overview#87.

It seems like this should be a fairly easy find-and-replace change in the code (e.g. for the CI workflow), and then the next step is to create a main branch, push it up, switch the default branch, and then (and this is where I might need more feedback—is this okay to do or will it cause problems (e.g. with people's forks)) delete the master branch.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

Git repository

ADDITIONAL INFORMATION

N/A

@geerlingguy
Copy link
Collaborator Author

It looks like the rest of the collections will be doing this on Monday, July 6th: ansible-collections/community.general#605

@felixfontein
Copy link

@geerlingguy it's only community.general doing it then. (community.network will be on July 3rd, community.crypto on July 2nd, and I don't know when the others will change.)

Deleting master should be pretty safe; the only thing to keep in mind that there might exist links from README.md on galaxy to the master branch (like for changelog etc.) that will 404 once master has been deleted.

@geerlingguy
Copy link
Collaborator Author

To anyone following this issue: I'm going to plan on making the switch on July 17, sometime in the morning, US Eastern.

@geerlingguy
Copy link
Collaborator Author

Working on it now.

@geerlingguy
Copy link
Collaborator Author

I just switched the branch for all the PRs from master to main, and also documented the process for switching my fork:

First, in my local checkout, I made sure I had main available, then pushed that branch to my fork on GitHub:

git fetch --all
git checkout main
git push -u origin main

Then I went to my fork on GitHub and switched the default branch:

switch-branch-master-main

And after you're satisfied and have reworked any PRs you might have open, go ahead and delete the master branch from your repository:

git branch -d master
git push origin --delete master

@felixfontein
Copy link

@geerlingguy don't forget to change the default branch in codecov (you need to log in, go to settings, and there you can change it).

@geerlingguy
Copy link
Collaborator Author

@felixfontein - Thanks for the reminder. I would've completely forgotten; it's done now.

@geerlingguy
Copy link
Collaborator Author

Looks like CI is successful on the new branch, and all the other relevant links have been updated.

There may be some broken links here and there as many files are linked to directly for docs (since Galaxy currently doesn't display module documentation), but all that I've found I've fixed so far.

That might be one of the more annoying aspects of the move—I'm realizing that for many repos, I have a number of links that go to the master branch for a file. While those links are likely to rot over long periods of time as files move around in a repository (and it's likely best to link to a specific SHA version of the file), they are the easiest to grab while navigating a repo after Google drops you off on the default branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants