Use main for prod #19

Closed
opened 2026-03-08 23:58:54 +00:00 by jflory7 · 18 comments
Owner

The git branch workflow is confusing and hides the most useful content in this repository in a non-default branch. Therefore, I proposing the following:

  1. Delete the current main branch.
  2. Rename prod to be the new main branch.
  3. Delete the stg branch.
  4. (later) Use Forgejo Actions to build live previews of the entire docs site inside of PRs, therefore eliminating the need for a staging branch.

This should make it easier for people to navigate this repository, find the things they need to find, and propose changes more easily.

The git branch workflow is confusing and hides the most useful content in this repository in a non-default branch. Therefore, I proposing the following: 1. Delete the current `main` branch. 2. Rename `prod` to be the new `main` branch. 3. Delete the `stg` branch. 4. (later) Use Forgejo Actions to build live previews of the entire docs site inside of PRs, therefore eliminating the need for a staging branch. This should make it easier for people to navigate this repository, find the things they need to find, and propose changes more easily.
Owner

I would support that. We should check if the README.md is the same or what is the newer one. And according to our rules, I guess we need a Licence file? Or does it only apply for GitLab repos?

And before we delete stg, we have to check which projects use it.

I would support that. We should check if the README.md is the same or what is the newer one. And according to our rules, I guess we need a Licence file? Or does it only apply for GitLab repos? And before we delete stg, we have to check which projects use it.
Member

Yes, it's actively confusing and tedious to manage. If we ever need staging we can handle that through actions, or simply use local builds if it's something we develop

Yes, it's actively confusing and tedious to manage. If we ever need staging we can handle that through actions, or simply use local builds if it's something we develop
Owner

+1.

I also opened a separate ticket for doing the same thing in all the other repos - docs/tickets#22.

+1. I also opened a separate ticket for doing the same thing in all the other repos - https://forge.fedoraproject.org/docs/tickets/issues/22.
Member

same comment as docs/docs-fp-o#20
For the record, this will break https://forge.fedoraproject.org/docs/translations-scripts
This is not blocking
Please ping me and @darknao once you proceed with the update

same comment as https://forge.fedoraproject.org/docs/docs-fp-o/issues/20 For the record, this will break https://forge.fedoraproject.org/docs/translations-scripts This is not blocking Please ping me and @darknao once you proceed with the update
Owner

Also see #12.

Also see #12.
Owner

@pboy wrote in docs/docs-fp-o#19 (comment):

We should check if the README.md is the same or what is the newer one. And according to our rules, I guess we need a Licence file?

I compared the old main branch with prod.

The README.md on prod is newer. It contains all changes from main, plus a working link to the contributing guide and no reference to the stg branch. So we can keep the prod version.

The LICENSE file exists only on main. It is CC BY-SA 4.0 and was added for #4. prod has no LICENSE file, so the new main needs one added. #4 says that the license can be CC BY-SA 4.0 or MIT, according to the FPCA. This repository contains mostly scripts and configuration, and two files on prod already have an MIT SPDX header.

Which license should the new main use, CC BY-SA 4.0 or MIT?

@pboy wrote in https://forge.fedoraproject.org/docs/docs-fp-o/issues/19#issuecomment-575419: > We should check if the README.md is the same or what is the newer one. And according to our rules, I guess we need a Licence file? I compared the old `main` branch with `prod`. The `README.md` on `prod` is newer. It contains all changes from `main`, plus a working link to the contributing guide and no reference to the `stg` branch. So we can keep the `prod` version. The `LICENSE` file exists only on `main`. It is CC BY-SA 4.0 and was added for #4. `prod` has no `LICENSE` file, so the new `main` needs one added. #4 says that the license can be CC BY-SA 4.0 or MIT, according to the FPCA. This repository contains mostly scripts and configuration, and two files on `prod` already have an MIT SPDX header. Which license should the new `main` use, CC BY-SA 4.0 or MIT?
Author
Owner

@hricky MIT is best suited as a source code license, while Creative Commons licenses are better suited for content. I suggest we go with CC BY-SA-4.0.

@hricky MIT is best suited as a source code license, while Creative Commons licenses are better suited for content. I suggest we go with `CC BY-SA-4.0`.
Owner

@jflory7 wrote in docs/docs-fp-o#19 (comment):

@hricky MIT is best suited as a source code license, while Creative Commons licenses are better suited for content. I suggest we go with CC BY-SA-4.0.

Well, @hricky was asking about scripts. And as you said, MIT fits better for those. But since we mostly have content repos and license them under CC BY-SA 4.0, it's probably best if we continue that trend here too.

Now that I looked, docsbuilder.sh is actually MIT-licensed even in repos that are CC BY-SA. I guess (hope) that's not a big deal?

@jflory7 wrote in https://forge.fedoraproject.org/docs/docs-fp-o/issues/19#issuecomment-1367919: > @hricky MIT is best suited as a source code license, while Creative Commons licenses are better suited for content. I suggest we go with `CC BY-SA-4.0`. Well, @hricky was asking about scripts. And as you said, MIT fits better for those. But since we mostly have content repos and license them under CC BY-SA 4.0, it's probably best if we continue that trend here too. Now that I looked, `docsbuilder.sh` is actually MIT-licensed even in repos that are CC BY-SA. I guess (hope) that's not a big deal?
Author
Owner

Since the bulk of files in docs repos are content, the LICENSE.txt file should likely be CC BY-SA 4.0, and the script source code comment headers with licensing info should be enough for the builder script.

Since the bulk of files in docs repos are content, the `LICENSE.txt` file should likely be CC BY-SA 4.0, and the script source code comment headers with licensing info should be enough for the builder script.
Owner

PR docs/docs-fp-o!68 is merged, so prod now has the license. The README.md on prod already contains everything from the old main branch, and nothing uses that branch.

If there are no objections, I will delete the old main branch and create a new main from prod. prod stays for now, so the production build and translations-scripts keep working. Switching the production build to main needs an infra/ansible change, and I will ping jibecfed and darknao before prod is removed.

PR docs/docs-fp-o!68 is merged, so `prod` now has the license. The `README.md` on prod already contains everything from the old main branch, and nothing uses that branch. If there are no objections, I will delete the old `main` branch and create a new `main` from `prod`. `prod` stays for now, so the production build and translations-scripts keep working. Switching the production build to `main` needs an infra/ansible change, and I will ping `jibecfed` and `darknao` before prod is removed.
Author
Owner

Thanks for working on this, @hricky! Sounds like a good plan. Maybe this is already what you have planned, but I guess main could be set as the default branch on Forgejo, and then the prod branch can be more or less a mirror to main until all infra and l10n changes are made.

Thanks for working on this, @hricky! Sounds like a good plan. Maybe this is already what you have planned, but I guess `main` could be set as the default branch on Forgejo, and then the `prod` branch can be more or less a mirror to `main` until all infra and l10n changes are made.
Owner

@jflory7 wrote in docs/docs-fp-o#19 (comment):

Maybe this is already what you have planned, but I guess main could be set as the default branch on Forgejo, and then the prod branch can be more or less a mirror to main until all infra and l10n changes are made.

Yes, that is the plan. The steps are:

  1. Delete the old main branch and create a new main from prod.
  2. Set main as the default branch.
  3. Open an infra/ansible PR that builds production from main, and an Infra ticket for the playbook run.
  4. Check that production is built from main.
  5. Update translations-scripts together with @jibecfed and @darknao.
  6. Delete prod.

Steps 3 and 4 are the same as for staging. Since infra/ansible!3713, docs.stg is built from the main branch of https://forge.stg.fedoraproject.org/docs/site-builder.

As agreed in docs/docs-fp-o#20 by jflory7 and pbokoc, I would also rename this repository to site-builder. That should happen before step 3, because steps 3 and 5 change the same places. Please say if there are any objections.

Until step 6, new PRs go to main, and prod is fast-forwarded to main after each merge.

@jflory7 wrote in https://forge.fedoraproject.org/docs/docs-fp-o/issues/19#issuecomment-1369072: > Maybe this is already what you have planned, but I guess `main` could be set as the default branch on Forgejo, and then the `prod` branch can be more or less a mirror to `main` until all infra and l10n changes are made. Yes, that is the plan. The steps are: 1. Delete the old `main` branch and create a new `main` from `prod`. 2. Set `main` as the default branch. 3. Open an infra/ansible PR that builds production from `main`, and an Infra ticket for the playbook run. 4. Check that production is built from `main`. 5. Update translations-scripts together with @jibecfed and @darknao. 6. Delete `prod`. Steps 3 and 4 are the same as for staging. Since infra/ansible!3713, docs.stg is built from the `main` branch of https://forge.stg.fedoraproject.org/docs/site-builder. As agreed in docs/docs-fp-o#20 by jflory7 and pbokoc, I would also rename this repository to `site-builder`. That should happen before step 3, because steps 3 and 5 change the same places. Please say if there are any objections. Until step 6, new PRs go to `main`, and `prod` is fast-forwarded to `main` after each merge.
Author
Owner

All makes sense to me! 👍

All makes sense to me! 👍
hricky self-assigned this 2026-10-29 08:38:08 +00:00
Owner

Steps 1 and 2 are done. The new main branch was created from prod and is now the default branch. New PRs should target main. Until step 6, I will fast-forward prod to main after each merge.

I also deleted the stg branch. Staging is built from https://forge.stg.fedoraproject.org/docs/site-builder since infra/ansible!3713, and nothing else uses stg.

Updating an existing clone and fork

If you have a local clone or a fork, their main still points to the old branch. The commands below assume that upstream is docs/docs-fp-o and origin is your fork. If you cloned docs/docs-fp-o directly and have no fork, use only the first part and replace upstream with origin.

Run these commands while you are on a branch other than main:

git fetch --prune upstream
git remote set-head upstream --auto
git branch --force main upstream/main
git branch --set-upstream-to=upstream/main main

If you have no local main branch, use git switch --create main --track upstream/main instead of the last two commands.

To replace the old main in your fork:

git push --force origin upstream/main:refs/heads/main
git remote set-head origin --auto
Steps 1 and 2 are done. The new `main` branch was created from `prod` and is now the default branch. New PRs should target `main`. Until step 6, I will fast-forward `prod` to `main` after each merge. I also deleted the `stg` branch. Staging is built from https://forge.stg.fedoraproject.org/docs/site-builder since infra/ansible!3713, and nothing else uses `stg`. <details> <summary>Updating an existing clone and fork</summary> If you have a local clone or a fork, their `main` still points to the old branch. The commands below assume that `upstream` is docs/docs-fp-o and `origin` is your fork. If you cloned docs/docs-fp-o directly and have no fork, use only the first part and replace `upstream` with `origin`. Run these commands while you are on a branch other than `main`: ``` git fetch --prune upstream git remote set-head upstream --auto git branch --force main upstream/main git branch --set-upstream-to=upstream/main main ``` If you have no local `main` branch, use `git switch --create main --track upstream/main` instead of the last two commands. To replace the old `main` in your fork: ``` git push --force origin upstream/main:refs/heads/main git remote set-head origin --auto ``` </details>
Owner

Steps 3 and 5 are done, and step 4 is mostly done.

Step 3: infra/ansible!3744 was merged, and infra/tickets#13654 was deployed. On 2026-11-11 darknao rebuilt the builder image from main. The 14:50 UTC production build was the first one from the new image, and it published fine.

Step 5: translations-scripts now downloads site.yml from the main branch of this repository. docs/translations-scripts!58 is merged into main and staging. darknao also rebuilt the docstranslation image.

From now on, PRs go only into main, and prod is no longer synced. Step 4 is complete when the next change merged into main appears on docs.fedoraproject.org and the nightly translated build has run.

Steps 3 and 5 are done, and step 4 is mostly done. Step 3: infra/ansible!3744 was merged, and infra/tickets#13654 was deployed. On 2026-11-11 darknao rebuilt the builder image from `main`. The 14:50 UTC production build was the first one from the new image, and it published fine. Step 5: translations-scripts now downloads `site.yml` from the main branch of this repository. docs/translations-scripts!58 is merged into `main` and `staging`. darknao also rebuilt the docstranslation image. From now on, PRs go only into `main`, and `prod` is no longer synced. Step 4 is complete when the next change merged into `main` appears on docs.fedoraproject.org and the nightly translated build has run.
Author
Owner

@hricky Thanks both for working on this, and keeping us informed on your progress. This is great news, and it sounds like we are nearly there!

So, tomorrow (Thursday), if everything builds correctly, does this mean it is safe to default the prod branch on this repo? Already, it is a few commits behind main, so it is not including the latest changes in the default branch. I am wondering when is the "safe" moment to delete prod from here.

@hricky Thanks both for working on this, and keeping us informed on your progress. This is great news, and it sounds like we are nearly there! So, tomorrow (Thursday), if everything builds correctly, does this mean it is safe to default the `prod` branch on this repo? Already, it is a few commits behind `main`, so it is not including the latest changes in the default branch. I am wondering when is the "safe" moment to delete `prod` from here.
Owner

@jflory7 prod has fewer commits than main, but the files are the same. Until yesterday, prod was updated with squash commits, so git diff prod main shows no difference. Nothing from main is missing on the site.

The nightly translated build ran at 23:00 UTC (see the cs and fr footers), and the hourly builds use the new image. The infra configuration takes both the build scripts and site.yml from main.

So I will delete prod today and watch the next hourly build. If that build fails, I can recreate prod from commit e82d4db. After a successful build, I will close this issue.

@jflory7 `prod` has fewer commits than `main`, but the files are the same. Until yesterday, `prod` was updated with squash commits, so `git diff prod main` shows no difference. Nothing from `main` is missing on the site. The nightly translated build ran at 23:00 UTC (see the `cs` and `fr` footers), and the hourly builds use the new image. The infra configuration takes both the build scripts and `site.yml` from `main`. So I will delete `prod` today and watch the next hourly build. If that build fails, I can recreate `prod` from commit `e82d4db`. After a successful build, I will close this issue.
Owner

I deleted prod at about 11:45 UTC. The 11:50 UTC production build published fine, so the site no longer needs the branch. All steps are done, so I am closing this issue.

One small follow-up: without prod, a local run of rebuild-site.py without DOCS_REPO_BRANCH fails, because the default branch was still prod. A PR that changes the default to main follows.

I deleted `prod` at about 11:45 UTC. The 11:50 UTC production build published fine, so the site no longer needs the branch. All steps are done, so I am closing this issue. One small follow-up: without `prod`, a local run of `rebuild-site.py` without `DOCS_REPO_BRANCH` fails, because the default branch was still `prod`. A PR that changes the default to `main` follows.
Sign in to join this conversation.
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
docs/site-builder#19
No description provided.