Baptiste Daroussin
Email: <bapt AT SPAMFREE FreeBSD DOT org>
...
Forgejo
I’m opening a for testing of https://ron-dev.freebsd.org.
This is a Forgejo instance to modernize our development workflow (note the “-dev”: this is not a production instance!)
Before you start
- Your login is your Kerberos username.
- You cannot change your password from the web UI (but via the usual means)
- Add your SSH key in the web UI
- We strongly recommend enabling MFA after your first login (we might make it mandatory when ron.f.o will be live).
Scope and access
For now the instance contains only the three main repositories:
- src
- ports
- docs
You are not allowed to create or migrate repositories. If repository creation is enabled, it will be handled via a request to gitadm.
We may open more repos later.
Workflow (AGit)
We will use the AGit workflow
Why AGit?
- It avoids duplicating our large repositories (compared to a fork/PR workflow).
- It avoids complex ACLs on refs (compared to using a dedicated review branch).
AGit lets users with read-only access open a pull request and simplifies the process to a single command.
Recommended tool
The git-pr script can be found on Codeberg.
git-pr must be installed in $PATH in order for it to be usable as a git subcommand.
Usage: git pr
This creates a pull request, and running the same command later updates that PR.
Suggested Configuration
This page assumes that a review remote has been setup, similar to the following:
git remote add review git@ron-dev.freebsd.org:FreeBSD/src.git
For reviewers/testers who want to fetch PRs, the following can be done:
git config --add remote.review.fetch "+refs/pull/*/head:refs/remotes/review/pr/*"
git pr requires the default branch to be added:
git config pr.remote review
Example workflows
Standard dev/review process
git fetch review git checkout -b mydevbranch ... work ... git commit ... work ... git commit git pr review main
Check out PR # 3
git checkout review/pr/3
List PRs
git pr --list
Graft PR # 4 on :main and push the result
git checkout main git pr --merge 4 git push
git pr --merge preserves the original commit hashes as it uses --ff-only.
Merge policy
- Do not merge via the web UI.
- Forgejo is a mirror of the official repo; we must avoid breaking the current contribution workflow.
- Forgejo treats a PR as merged if the same appears in the official repo.
- If you rewrite commit messages (e.g., to add “Reviewed by”), update the PR first, then push to the official main branch.
Limitations
External contributors will be allowed only after https://codeberg.org/forgejo/forgejo/pulls/11965 is merged and included in a Forgejo release in the ports tree.
- For now, issues are handled in our Bugzilla (Forgejo issues are redirected).
Other Notes
On the forgejo setup, I have fixed an issue with how repositories are mirrored which could result in "cutting" the head of the open pull requests