CI/CD Integration π‘ BETA
CI runs on GitHub Actions and on a self-hosted Forgejo runner; the deployed binary comes from the pipeline, never from a local copy.
Architecture
.github/workflows/ci.yml runs on pushes, pull requests and a schedule. A second CI runs on the self-hosted Forgejo (ALM) instance; the runner lives in container alm-ci and builds at /opt/gbo/data/botserver/target/debug/botserver (root AGENTS.md, Deploy in Prod Workflow).
CI job map
Job in ci.yml |
What it checks |
|---|---|
security |
Security gates called by the workflow |
changes |
Detects migrations and BotBook changes |
i18n |
Locale catalogue gate |
windows |
Windows agent adapters |
guard |
Structural adequacy, unit-policy, security-header and design-system gates |
docs-publish |
Builds and publishes BotBook on a push to main |
The workflow also includes mobile feature-guard and compile-check jobs that are non-blocking in Phase A.
Status Codes
Forgejo runner status is read from the ALM API or the runner log. A stuck run on status 6 is reset through the ALM UI or API; the runner token is stored in the action_runner_token table of the PROD-ALM database.
Database Queries
The ALM database is the source of run, job and step state. Query it read-only from the ALM container; do not paste Tokens or internal addresses into an issue.
List Recent Runs
Read the most recent runs from the Forgejo API at the ALM port (4747), not from port 3000.
Get Jobs for a Run
Jobs belong to a run id. A missing job usually means the runner rejected the labels, not that the workflow is wrong.
Get Step-Level Status
Step status is per job. Use it to identify which guard or build step failed before changing code.
Check Runner Token
Inspect the runner registration on the ALM host. A registration file not found error means .runner is missing or malformed.
List Registered Runners
List runners from the ALM API and confirm labels match the runs-on field in the workflow.
Reset a Stuck Run (status 6)
- Identify the run id from the ALM API.
- Confirm the runner is connected and its labels match.
- Re-register the runner if
.runneris invalid. - Re-run the job once the runner is healthy.
Reading Build Logs
Logs are stored compressed in the ALM container. Fetch one step at a time, decompress, and read the failing guard name before editing anything.
Step-by-Step
- Get the log filename from the jobs table.
- Pull the compressed log from the
almcontainer. - Decompress into
/tmp/and read the failing step.
One-Liner: Read Latest Failed Run
Prefer the documented API query to an ad-hoc shell pipeline; the API gives the run id and status without touching the database.
Real-Time Monitoring
The Forgejo runner writes to /opt/gbo/logs/out.log and err.log inside container alm-ci. Watch those files for build activity; do not tail a second build while one is running.
Tail runner logs (live but ephemeral)
journalctl -u alm-ci-runner.service on the ALM host shows live runner output.
Watch for new runs
Poll the ALM API for the newest run id; do not hold a long-running script open.
Check runner logs for build activity
A runner that never picks up jobs has a label mismatch or an invalid registration.
Build Timing
CI is authoritative for type checking. Local builds are debug builds only; the release profile is reserved for the desktop packaging workflow.
Verify Deployment
- Check the installed binary timestamp on the bot container.
- Check the running process with
systemctlinside the container. - Call
/healththere. - Compare the deployed checksum with the built artifact.
Check binary timestamp
The CI deploy path is /opt/gbo/bin/botserver on the bot container.
Check running version
Read the version from the root Cargo.toml (7.1.2); do not infer it from a filename.
Check systemd status
Always run botserver through systemctl inside the container; a manual process is not a supported deployment.
Health endpoint
The container-local health check is on port 5858 in production and port 8080 in development.
Runner Configuration
The runner user is gbuser (uid 1000); /opt/gbo/ is owned by that user. sccache is the RUSTC_WRAPPER in the workflow.
Register New Runner
Register against ALM on port 4747 with a token and labels matching the workflow runs-on field; use --no-interactive for automation.
Restart Runner
Restart alm-ci-runner.service after a registration change; confirm it reconnects before closing the issue.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Runner not connecting | Wrong ALM port | Use 4747, not 3000 |
registration file not found |
Missing .runner |
Re-register |
unsupported protocol scheme |
Wrong JSON format | Delete and re-register |
| Connection refused | ALM down or blocked | Check the ALM listener |
Deploy Workflow
- Push submodules first (
botserver, then the root pointer commit). - Push to
mainon both remotes. - Wait for CI to complete.
- Verify the deployed binary and health endpoint.
1. Push submodules first
The root repository records the submodule commit; push the change inside botserver/ before the root commit.
2. Push main repo
Push to both alm and origin; ALM triggers CI/CD.
3. Wait for CI (~2-6 min)
Poll the ALM API instead of blocking the session.
4. Verify deployment
Restart botserver with systemctl after the binary swap, then check health and one chat turn.
Limits
- ALM listens on port 4747; port 3000 is the suite.
- Agents never commit, push, restart or deploy; the driver owns those steps.
- No local binary is copied to production β CI builds and transfers it.
- Pull requests and the mirrored Forgejo CI never publish BotBook.