chore: migrate CI and metadata from GitHub to Forgejo #385

Open
jwilger wants to merge 9 commits from chore/forgejo-migration into main
Owner

Switches the project's CI from GitHub Actions to Forgejo Actions and
removes all GitHub-only metadata after the migration to a self-hosted
Forgejo instance at git.johnwilger.com:2222/jwilger/eventcore.

Why Forgejo Actions needs more than a path rename: GitHub-specific
features (actions/github-script against the GitHub REST API, the
release-plz github backend, Dependabot, the ubuntu-latest runner label)
either don't exist on Forgejo or behave differently. The mutation auto-
issue step is reimplemented as a curl call to Forgejo's REST API, and
release-plz now targets the gitea backend (Forgejo is API-compatible).

CodeRabbit's hosted product does not support Forgejo, so the GitHub App
is replaced by a new workflow that runs the CodeRabbit CLI inside CI and
posts the review as a PR comment via the Forgejo API. This requires a
CODERABBIT_API_KEY repo secret.

The .github/ tree is removed entirely. Issue templates move to
.forgejo/issue_template/. Doc and rules files (CLAUDE.md, AGENTS.md,
.claude/rules/forgejo-issues.md formerly github-issues.md,
pr-review-feedback-protocol.md, release-plz.toml prose) are updated so
no stale GitHub references remain.

The default Postgres host port shifts from 5432 to 5433 (docker-compose,
test connection-string defaults, Forgejo CI service mapping). This lets
the test docker container coexist with a system PostgreSQL service that
many local environments already run on 5432. POSTGRES_PORT can still
override the default.

Operator action items (configure in the Forgejo admin UI, not part of
this commit): register a runner with the docker label; create repo
secrets CARGO_REGISTRY_TOKEN, RELEASE_PLZ_TOKEN, CODERABBIT_API_KEY;
reconfigure branch protection on main to require the gate job; recreate
the issue label set.

Switches the project's CI from GitHub Actions to Forgejo Actions and removes all GitHub-only metadata after the migration to a self-hosted Forgejo instance at git.johnwilger.com:2222/jwilger/eventcore. Why Forgejo Actions needs more than a path rename: GitHub-specific features (actions/github-script against the GitHub REST API, the release-plz github backend, Dependabot, the ubuntu-latest runner label) either don't exist on Forgejo or behave differently. The mutation auto- issue step is reimplemented as a curl call to Forgejo's REST API, and release-plz now targets the gitea backend (Forgejo is API-compatible). CodeRabbit's hosted product does not support Forgejo, so the GitHub App is replaced by a new workflow that runs the CodeRabbit CLI inside CI and posts the review as a PR comment via the Forgejo API. This requires a CODERABBIT_API_KEY repo secret. The .github/ tree is removed entirely. Issue templates move to .forgejo/issue_template/. Doc and rules files (CLAUDE.md, AGENTS.md, .claude/rules/forgejo-issues.md formerly github-issues.md, pr-review-feedback-protocol.md, release-plz.toml prose) are updated so no stale GitHub references remain. The default Postgres host port shifts from 5432 to 5433 (docker-compose, test connection-string defaults, Forgejo CI service mapping). This lets the test docker container coexist with a system PostgreSQL service that many local environments already run on 5432. POSTGRES_PORT can still override the default. Operator action items (configure in the Forgejo admin UI, not part of this commit): register a runner with the docker label; create repo secrets CARGO_REGISTRY_TOKEN, RELEASE_PLZ_TOKEN, CODERABBIT_API_KEY; reconfigure branch protection on main to require the gate job; recreate the issue label set.
chore: migrate CI and metadata from GitHub to Forgejo
Some checks failed
CI / Detect Changes (pull_request) Failing after 59s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Failing after 26s
CI / Test (pull_request) Has been skipped
CI / Test-1 (pull_request) Has been skipped
CI / Test-2 (pull_request) Has been skipped
CI / Test-3 (pull_request) Has been skipped
CI / Test-4 (pull_request) Has been skipped
CI / Test-5 (pull_request) Has been skipped
CI / Test-6 (pull_request) Has been skipped
CI / Test-7 (pull_request) Has been skipped
CI / Test-8 (pull_request) Has been skipped
CI / Test-9 (pull_request) Has been skipped
CI / Test-10 (pull_request) Has been skipped
CI / Format (pull_request) Failing after 30s
CI / Test-11 (pull_request) Has been skipped
CI / Security Audit (pull_request) Has been skipped
CI / Mutation (pull_request) Has been skipped
CI / CI Gate (pull_request) Failing after 1s
CI / Clippy (pull_request) Has been skipped
10d8540b0a
Switches the project's CI from GitHub Actions to Forgejo Actions and
removes all GitHub-only metadata after the migration to a self-hosted
Forgejo instance at git.johnwilger.com:2222/jwilger/eventcore.

Why Forgejo Actions needs more than a path rename: GitHub-specific
features (actions/github-script against the GitHub REST API, the
release-plz github backend, Dependabot, the ubuntu-latest runner label)
either don't exist on Forgejo or behave differently. The mutation auto-
issue step is reimplemented as a curl call to Forgejo's REST API, and
release-plz now targets the gitea backend (Forgejo is API-compatible).

CodeRabbit's hosted product does not support Forgejo, so the GitHub App
is replaced by a new workflow that runs the CodeRabbit CLI inside CI and
posts the review as a PR comment via the Forgejo API. This requires a
CODERABBIT_API_KEY repo secret.

The .github/ tree is removed entirely. Issue templates move to
.forgejo/issue_template/. Doc and rules files (CLAUDE.md, AGENTS.md,
.claude/rules/forgejo-issues.md formerly github-issues.md,
pr-review-feedback-protocol.md, release-plz.toml prose) are updated so
no stale GitHub references remain.

The default Postgres host port shifts from 5432 to 5433 (docker-compose,
test connection-string defaults, Forgejo CI service mapping). This lets
the test docker container coexist with a system PostgreSQL service that
many local environments already run on 5432. POSTGRES_PORT can still
override the default.

Operator action items (configure in the Forgejo admin UI, not part of
this commit): register a runner with the docker label; create repo
secrets CARGO_REGISTRY_TOKEN, RELEASE_PLZ_TOKEN, CODERABBIT_API_KEY;
reconfigure branch protection on main to require the gate job; recreate
the issue label set.
Author
Owner

CI failure diagnosis — runner config, not workflow

Both workflow runs (ci.yml and coderabbit.yml) failed at the actions/checkout@v6 step with:

fatal: unable to access 'http://localhost:3300/jwilger/eventcore/':
Failed to connect to localhost port 3300 after 0 ms: Couldn't connect to server

The runner (gregor v0.4.0) is registered with gitea_instance_url: http://localhost:3300. That URL works for the runner host → Forgejo, but inside the action container the runner spawns, localhost resolves to the container itself, not the Forgejo host — so checkout can't clone the repo.

The same error cascaded to every job in ci.yml (since changes failed, the rest were marked failed/skipped) and to coderabbit.yml (same checkout failure on its only job).

Fix (on the runner host, not in this PR)

Edit the act_runner config (typically /etc/act_runner/config.yaml) and change gitea_instance_url to a URL reachable from inside the action container. Options:

  1. Public Forgejo URL — simplest, always works:
    gitea_instance_url: https://git.johnwilger.com
    
  2. Docker host gateway:
    gitea_instance_url: http://host.docker.internal:3300
    container:
      options: "--add-host=host.docker.internal:host-gateway"
    
  3. Runner host's LAN IP: http://<host-ip>:3300

Then restart the runner (systemctl restart act_runner, or however gregor is supervised) and rerun the workflows from the Forgejo UI.

Other operator items still pending (from PR description)

  • Repo secrets CARGO_REGISTRY_TOKEN, RELEASE_PLZ_TOKEN, CODERABBIT_API_KEY
  • Issue label set recreated (P0–P4, bug, enhancement, task, epic, chore, research, documentation, dependencies, rust, release)
  • Branch protection on main requiring the gate job

No workflow code changes are needed for the checkout failure — it will resolve once the runner config is corrected.

## CI failure diagnosis — runner config, not workflow Both workflow runs (`ci.yml` and `coderabbit.yml`) failed at the `actions/checkout@v6` step with: ``` fatal: unable to access 'http://localhost:3300/jwilger/eventcore/': Failed to connect to localhost port 3300 after 0 ms: Couldn't connect to server ``` The runner (`gregor` v0.4.0) is registered with `gitea_instance_url: http://localhost:3300`. That URL works for the **runner host → Forgejo**, but inside the **action container** the runner spawns, `localhost` resolves to the container itself, not the Forgejo host — so checkout can't clone the repo. The same error cascaded to every job in `ci.yml` (since `changes` failed, the rest were marked failed/skipped) and to `coderabbit.yml` (same checkout failure on its only job). ### Fix (on the runner host, not in this PR) Edit the `act_runner` config (typically `/etc/act_runner/config.yaml`) and change `gitea_instance_url` to a URL reachable from inside the action container. Options: 1. Public Forgejo URL — simplest, always works: ```yaml gitea_instance_url: https://git.johnwilger.com ``` 2. Docker host gateway: ```yaml gitea_instance_url: http://host.docker.internal:3300 container: options: "--add-host=host.docker.internal:host-gateway" ``` 3. Runner host's LAN IP: `http://<host-ip>:3300` Then restart the runner (`systemctl restart act_runner`, or however `gregor` is supervised) and rerun the workflows from the Forgejo UI. ### Other operator items still pending (from PR description) - [ ] Repo secrets `CARGO_REGISTRY_TOKEN`, `RELEASE_PLZ_TOKEN`, `CODERABBIT_API_KEY` - [ ] Issue label set recreated (P0–P4, bug, enhancement, task, epic, chore, research, documentation, dependencies, rust, release) - [ ] Branch protection on `main` requiring the `gate` job No workflow code changes are needed for the checkout failure — it will resolve once the runner config is corrected.
chore: gitignore .mcp.json for per-developer Forgejo MCP config
Some checks failed
CI / Detect Changes (pull_request) Failing after 30s
CI / Format (pull_request) Failing after 28s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Failing after 31s
CI / Test (pull_request) Has been skipped
CI / Test-1 (pull_request) Has been skipped
CI / Test-2 (pull_request) Has been skipped
CI / Test-3 (pull_request) Has been skipped
CI / Test-4 (pull_request) Has been skipped
CI / Test-5 (pull_request) Has been skipped
CI / Test-6 (pull_request) Has been skipped
CI / Test-7 (pull_request) Has been skipped
CI / Test-8 (pull_request) Has been skipped
CI / Test-9 (pull_request) Has been skipped
CI / Test-10 (pull_request) Has been skipped
CI / Test-11 (pull_request) Has been skipped
CI / Clippy (pull_request) Has been skipped
CI / Mutation (pull_request) Has been skipped
CI / Security Audit (pull_request) Has been skipped
CI / CI Gate (pull_request) Failing after 1s
a1b5d08412
The Forgejo MCP server config carries a personal access token in its env
block, so each developer creates their own .mcp.json locally rather than
sharing one in the repo.
ci: trigger rerun after runner URL fix
Some checks failed
CI / CI Gate (pull_request) Blocked by required conditions
CI / Detect Changes (pull_request) Successful in 4s
CI / Security Audit (pull_request) Waiting to run
CI / Format (pull_request) Successful in 19s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Failing after 7s
CI / Test (pull_request) Failing after 9s
CI / Test-1 (pull_request) Failing after 1s
CI / Test-2 (pull_request) Failing after 0s
CI / Test-3 (pull_request) Failing after 9s
CI / Test-4 (pull_request) Failing after 1s
CI / Test-5 (pull_request) Failing after 0s
CI / Test-6 (pull_request) Failing after 1s
CI / Test-7 (pull_request) Failing after 0s
CI / Test-8 (pull_request) Failing after 0s
CI / Test-9 (pull_request) Failing after 9s
CI / Test-10 (pull_request) Failing after 0s
CI / Test-11 (pull_request) Failing after 1s
CI / Mutation (pull_request) Waiting to run
CI / Clippy (pull_request) Has been cancelled
7ed4f8ea4e
ci: connect to postgres service via host env, drop host port mapping
Some checks failed
CI / Mutation (pull_request) Blocked by required conditions
CI / CI Gate (pull_request) Blocked by required conditions
CI / Detect Changes (pull_request) Successful in 3s
CI / Security Audit (pull_request) Waiting to run
CI / Test-10 (pull_request) Waiting to run
CI / Test-11 (pull_request) Waiting to run
CI / Clippy (pull_request) Waiting to run
CI / Format (pull_request) Successful in 16s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Waiting to run
CI / Test (pull_request) Successful in 13m59s
CI / Test-1 (pull_request) Successful in 12m50s
CI / Test-2 (pull_request) Successful in 12m30s
CI / Test-3 (pull_request) Successful in 12m46s
CI / Test-4 (pull_request) Successful in 12m50s
CI / Test-5 (pull_request) Successful in 14m44s
CI / Test-6 (pull_request) Successful in 14m12s
CI / Test-7 (pull_request) Successful in 14m40s
CI / Test-8 (pull_request) Successful in 12m33s
CI / Test-9 (pull_request) Has been cancelled
a729a20f86
Forgejo Actions runs jobs in containers on a shared docker network with
service containers. Reaching the service via localhost:<host_port>
requires the runner to publish the port on the host — and that conflicts
when the runner shares its host with a developer's docker-compose
postgres on the same port.

Tests and the bench now honor POSTGRES_HOST (default localhost), and the
CI workflow sets POSTGRES_HOST=postgres + POSTGRES_PORT=5432 so jobs
reach the service container directly via the network. Local dev still
works unchanged: with no env vars, defaults stay localhost:5433 (the
docker-compose mapping).
ci: drop rust/postgres matrix from PR test job
Some checks failed
CI / Mutation (pull_request) Blocked by required conditions
CI / CI Gate (pull_request) Blocked by required conditions
CI / Detect Changes (pull_request) Successful in 4s
CI / Clippy (pull_request) Waiting to run
CI / Security Audit (pull_request) Waiting to run
CI / Format (pull_request) Successful in 22s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Failing after 9s
CI / Test (pull_request) Has been cancelled
2761937c87
The 3x4 matrix (stable/beta/nightly × postgres 15-18) was making PR CI
take 12-14 minutes on the self-hosted runner. PRs now run a single test
job against stable Rust and Postgres 17, matching what the
release-only mutation job already uses.
ci: fetch base branch as local ref for CodeRabbit CLI
Some checks failed
CI / CI Gate (pull_request) Blocked by required conditions
CI / Detect Changes (pull_request) Successful in 3s
CI / Security Audit (pull_request) Waiting to run
CI / Format (pull_request) Successful in 21s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Failing after 9s
CI / Test (pull_request) Successful in 14m1s
CI / Mutation (pull_request) Waiting to run
CI / Clippy (pull_request) Has been cancelled
348c8bb0cf
The CodeRabbit CLI runs `git diff main...HEAD` to compute file changes,
which needs `main` resolvable as a local branch. actions/checkout@v6
only materializes the PR HEAD ref, so we explicitly fetch the base
branch into a local ref of the same name before invoking the CLI.

Without this, the review step failed with:
  Failed to get file changes: Command failed with exit code 128:
    git diff --name-status main...HEAD
ci: use shell env for GITHUB_SERVER_URL in coderabbit comment step
Some checks failed
CI / Mutation (pull_request) Blocked by required conditions
CI / CI Gate (pull_request) Blocked by required conditions
CI / Detect Changes (pull_request) Successful in 3s
CI / Clippy (pull_request) Waiting to run
CI / Security Audit (pull_request) Waiting to run
CI / Format (pull_request) Successful in 15s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Failing after 6s
CI / Test (pull_request) Has been cancelled
bed018f92e
The env context (${{ env.X }}) only sees env vars set in workflow/job/step
env: blocks — not runner-injected vars like GITHUB_SERVER_URL. SERVER was
empty, producing a relative URL that curl rejected. Reference
GITHUB_SERVER_URL and GITHUB_REPOSITORY directly in the shell, matching
the pattern already used in ci.yml.
ci(coderabbit): use github expression context for server/repo and add debug echo
Some checks failed
CI / Mutation (pull_request) Blocked by required conditions
CI / CI Gate (pull_request) Blocked by required conditions
CI / Detect Changes (pull_request) Successful in 3s
CI / Clippy (pull_request) Waiting to run
CI / Security Audit (pull_request) Waiting to run
CI / Format (pull_request) Successful in 15s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Failing after 8s
CI / Test (pull_request) Has been cancelled
3152092e6a
The Forgejo runner does not inject GITHUB_SERVER_URL/GITHUB_REPOSITORY as
shell env vars, so referencing them under set -u tripped 'unbound variable'
immediately (0s failure). Use the github expression context, which the
workflow engine populates regardless of runner shell env. Also drop set -u
and add a debug echo to confirm values for the next failure.
ci(coderabbit): skip comment post when CLI fails and install jq when needed
All checks were successful
CI / Detect Changes (pull_request) Successful in 3s
CI / Format (pull_request) Successful in 16s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Successful in 6s
CI / Test (pull_request) Successful in 13m35s
CI / Clippy (pull_request) Successful in 10m54s
CI / Security Audit (pull_request) Successful in 23s
CI / Mutation (pull_request) Has been skipped
CI / CI Gate (pull_request) Successful in 1s
582d3c2dbb
The 'Post review comment to PR' step failed for two reasons:
1. The CodeRabbit CLI exited non-zero (no usage credits) but the workflow
   masked the failure with '|| true', leaving the error text in review.txt
   and tricking the size check into proceeding.
2. The runner image (node:20-bookworm) does not ship with jq, so payload
   construction failed with exitcode 127.

Capture the CLI exit code and gate the install/post steps on a 'review.ok'
output. Install jq from apt only when we actually need it.
All checks were successful
CI / Detect Changes (pull_request) Successful in 3s
CI / Format (pull_request) Successful in 16s
CodeRabbit Review / CodeRabbit AI Review (pull_request) Successful in 6s
CI / Test (pull_request) Successful in 13m35s
CI / Clippy (pull_request) Successful in 10m54s
CI / Security Audit (pull_request) Successful in 23s
CI / Mutation (pull_request) Has been skipped
CI / CI Gate (pull_request) Successful in 1s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin chore/forgejo-migration:chore/forgejo-migration
git switch chore/forgejo-migration

Merge

Merge the changes and update on Forgejo.
git switch main
git merge --no-ff chore/forgejo-migration
git switch chore/forgejo-migration
git rebase main
git switch main
git merge --ff-only chore/forgejo-migration
git switch chore/forgejo-migration
git rebase main
git switch main
git merge --no-ff chore/forgejo-migration
git switch main
git merge --squash chore/forgejo-migration
git switch main
git merge --ff-only chore/forgejo-migration
git switch main
git merge chore/forgejo-migration
git push origin main
Sign in to join this conversation.
No description provided.