repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

feat(pi): add Luci CI skill

1dc5978a0dffc89fa6e0a5da3e69584aa8f92157

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (1)

+184 / −0 text lines

Diff layout

pi/agent/skills/luci-ci/SKILL.md

Added
new file mode 100644

+184 / −0 text lines

1---
2name: luci-ci
3description: "Create, edit, review, or diagnose Luci CI configuration for ci.bugabinga.net. Use for .ci/*.kdl files, Luci jobs/triggers/matrices/secrets, failed or missing runs, run status, and CI logs."
4---
5
6# Luci CI
7
8Work only on repository config and run diagnostics.
9Do not modify Luci infrastructure or implementation unless explicitly asked.
11## Configure a repository
131. Read repository instructions and every direct `.ci/*.kdl` file.
142. Find the repository's canonical CI command or task.
153. Keep Luci orchestration thin: select an image, prepare required tooling,
16 then call that canonical command.
174. Edit the minimum config.
185. Run the exact delegated command locally when possible.
196. Re-read the final KDL against the grammar below.
21Luci reads only direct `.ci/*.kdl` files at the selected commit.
22Files are lexical; jobs retain file then declaration order.
23Only `job` is valid at top level; duplicate job names across files fail the run.
25## Complete current grammar
27```kdl
28job "ci" {
29 image "docker.io/library/node:24-alpine"
31 trigger {
32 push true
33 branch "trunk"
34 tag "v*"
35 }
37 matrix {
38 node "22" "24"
39 mode "debug" "release"
40 }
42 secret "TOKEN" env="SERVICE_TOKEN"
43 secret "SIGNING_KEY" file=".secrets/signing-key"
45 run "install-project-tools"
46 run "CI=true run-project-ci"
47}
48```
50A job requires exactly one useful `image` and at least one `run`.
51Supported job children are only:
53- `image "..."`
54- `run "..."`, repeatable
55- `trigger { ... }`
56- `matrix { ... }`
57- `secret "name" env="NAME"`
58- `secret "name" file="workspace/relative/path"`
60Unknown nodes fail parsing.
61**Do not add `cache`, `publish`, `artifact`, generic `env`, service containers,
62host mounts, or per-job resource fields. They are not implemented.**
64All `run` strings are joined with `&&` and executed once through `/bin/sh -c`.
65Order matters; shell state such as `export` survives into later `run` strings.
66The image must contain `/bin/sh` or provide it through setup.
68### Triggers
70`push true` is the default.
71With no branch/tag filters, the job matches all pushed branches and tags.
72Branch-only filters exclude tags; tag-only filters exclude branches.
73If both exist, each applies to its own ref kind.
74Patterns are path globs; `*` does not cross `/`.
75`push false` disables automatic runs but keeps manual runs available.
76Manual runs require the named job at the selected ref/revision and ignore push filters.
78### Matrix
80Axes and values expand as a deterministic cartesian product in declaration order.
81`${axis}` interpolation works only in `image` and `run` strings.
82Each child also receives `CI_MATRIX_<UPPERCASE_AXIS>`.
83Do not assume revision, ref, repository, or other CI environment variables exist.
85### Secrets
87Secret values are operator-managed outside Git under:
89```text
90/data/ci/secrets/<repo>/<job>/<secret-name>
91```
93Use exactly one of `env=` or `file=` per secret.
94Keep file targets workspace-relative.
95Missing secrets fail before container execution.
96Never print secrets: repositories, run logs, and artifacts are public,
97child containers have network access, and log masking is not implemented.
99## Execution facts that affect config
101Jobs and matrix children run sequentially.
102The first failed child fails the parent and marks remaining children skipped.
103Each child gets a clean checkout and a default 20-minute timeout,
1042 GiB memory, and 2 CPUs.
105Images pull when missing; containers have network access,
106no added capabilities, and no Podman socket.
108A push selecting zero jobs records a zero-duration successful parent.
109Therefore success without children does not prove checks ran.
111## Diagnose runs
113Start at `https://ci.bugabinga.net/`.
114Filter by repository/job or use `?all=1`.
115Match the seven-character revision before diagnosing a run.
117Routes:
119```text
120/ dashboard
121/repos/<repo> all runs for one repository
122/runs/<run-id> parent, children, details, last 256 KiB logs
123/runs/<run-id>/logs/<child-id> complete plain-text child log
124/docs compact live usage reference
125```
127Read failures in this order:
1291. Parent `detail`: repo/ref resolution and KDL/config errors may create
130 no child and no log.
1312. Child `detail`: execution-level cause and status.
1323. Embedded log tail: usually enough for the final failing command.
1334. Raw child log: search backward for the first meaningful error;
134 final `exit status 1` is only the summary.
136Status meanings:
138- `queued`: inbox event waiting.
139- `preparing`: claimed; revision/config/plan being resolved.
140- `running`: one child executing.
141- `success`: parent completed without a failed child, including a zero-child plan.
142- `failed`: preflight, child, persistence, or interrupted-run failure.
143- `skipped`: child not started after an earlier child failed.
145Repository health uses the latest completed parent.
146Queued/running work does not clear an existing failure;
147a later successful parent does.
149Common diagnoses:
151- No run after push: check public repo visibility, pushed ref, polling delay,
152 and trigger match.
153- Success in `0s`, no children: config is absent at that revision,
154 or no job matched the pushed ref.
155- Failed parent, no children: read parent detail for invalid KDL,
156 duplicate/missing job, unsafe repo/ref, or missing image/run.
157- Manual job not found: check job name and config at the exact ref/revision.
158- Failed child: read child detail, embedded tail, then raw log.
159- Remaining children skipped: the earlier failed child is the root failure.
161## Manual runs
163Oliver's Nushell wrapper is:
165```nu
166def ci [...args] { ssh -p 2223 root@ci.bugabinga.net ...$args }
167```
169Use exactly one selector:
171```nu
172ci run <repo> <job> --ref <ref>
173ci run <repo> <job> --rev <commit>
174```
176The command prints the accepted run ID.
177Use `/runs/<run-id>` to follow it.
178Manual runs mutate CI state; do not submit or rerun without explicit approval.
179Config changes take effect only after the selected commit reaches the public repository.
181If observed behavior contradicts this skill,
182inspect current `bugabinga.net/services/luci/internal/ciconfig` source
183and live run detail.
184Do not guess or use designed-but-unimplemented fields.