Contributing: every change reaches main through a pull request, with main protected #940
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#940
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Until now, a fix or feature was committed straight onto
mainand pushed: one issue per commit, often several commits per push. From now on, every change reachesmainthrough a pull request. The change is pushed to a branch, a pull request is opened, CI runs on it, and it is merged only when CI passes.What exists today
mainwas pushed there directly. The only pull requests are Weblate's (from itsweblatebranch, #706) and the monthly dependency upgrade (dependencies.yml, pushed by a bot withDEPENDENCIES_TOKEN)..forgejo/workflows/ci.ymlruns onpushtomainand the release branches, and on everypull_request, so no workflow change is needed for checks to run.main. Every push tomainthat passes CI builds and publishes the:devimage (dev-image.yml), and releases are tagged onmain(CONTRIBUTING.md, Releasing).CLAUDE.md(see #939) describe committing and pushing, and their rules were written for it. One issue per commit and the wiki commit pushed when the code is (CONTRIBUTING.md around line 477) both assume a direct push.main.What would change
On the instance (Forgejo settings)
Protect
main.Make the CI jobs required checks. A pull request can be merged only when Checks, Unit tests and coverage, Database tests on PostgreSQL, Security audit and Browser tests have passed.
Require the branch to be current, or not. One option is to require a pull request's branch to be up to date with
mainbefore merging. Decide whether to turn it on: it is safer, but costs a CI rerun after every merge tomain.Keep the bots working.
weblateand already opens a pull request, so it is unaffected.mainitself must be found and changed to open a pull request instead.Choose a merge style. Weblate's pull requests stay merge commits, because the guard (
messages.py guard) checks that translation commits are authored by Weblate. For code, choose one, for example:Write the choice down.
In the repository (docs)
909-map, as the worktrees already do).Closes #N, and the wiki change it needs is linked.mainafter the release pull request is merged, then wait for CI and Every Python on the merge commit.:devimage, which is built when a pull request is merged.AGENTS.md/CLAUDE.md(#939). Tell AI assistants that the way to deliver a change is a branch and a pull request, and nevergit push origin <branch>:main.Done when
mainis refused by the server, for every account.AGENTS.mdand the release steps describe the pull-request flow, and the next few changes land that way.Related
#706 (Weblate pull requests), #727 (Forgejo 16 workflow permissions and Authorized Integrations, which matter for bots that push), #939 (AGENTS.md).