ci(molecule): open an issue when the nightly full run fails and close it on the next green one #270

Open
opened 2026-11-20 19:42:21 +00:00 by Claude · 1 comment
Owner

Spec: What Molecule proves before a merge, and who acts on the nightly run, resolution point 2.

Why

A failed nightly Molecule run tells nobody today. A scheduled run's trigger user is the system account gitea-actions, which Gitea never mails, and a scheduled run sets no commit status (read in the Gitea v28.3.0 source: services/actions/notifier_helper.go handleSchedules, models/user/user.go IsMailable, services/actions/commit_status.go). The nightly is the only run of the scenarios a pull request's diff did not select.

What

In .gitea/workflows/molecule.yml, for a full run only (event schedule or workflow_dispatch, on main):

  • On failure: if an open issue with the fixed title Nightly Molecule run failed exists, comment the run's URL on it; otherwise open it with label Status/Needs Triage.
  • On success: if that issue is open, comment the run's URL and close it.
  • Call the Gitea API with curl and the job token. Grant permissions: issues: write on that job only; everything else keeps contents: read. Pass every value through env:, never ${{ }} in a run: block.
  • The issue body and comments carry the run link only: no log text and no host, address, network or sizing detail (the job-output rule from Does the stand-alone rule cover issue text and job logs).

A pull-request run never touches the issue.

Acceptance

  • A failing workflow_dispatch run on main opens the issue; a second failing run comments on it; a green run closes it.
  • A pull-request run, green or red, leaves it alone.
  • No changelog fragment (tooling, in build_ignore).

Not verified

Whether issues: read alone would let the job token open an issue (the route only checks repo read on issues; inferred from source, not tested). Ask for issues: write.

The owner rule ("the maintainer owns a red nightly; any trusted contributor may fix it") is written into maintaining.md by #262, not here.

Spec: [What Molecule proves before a merge, and who acts on the nightly run](https://git.rkdr.net/Mortis/Kamino/issues/256), resolution point 2. ## Why A failed nightly Molecule run tells nobody today. A scheduled run's trigger user is the system account `gitea-actions`, which Gitea never mails, and a scheduled run sets no commit status (read in the Gitea v28.3.0 source: `services/actions/notifier_helper.go` `handleSchedules`, `models/user/user.go` `IsMailable`, `services/actions/commit_status.go`). The nightly is the only run of the scenarios a pull request's diff did not select. ## What In `.gitea/workflows/molecule.yml`, for a **full run** only (event `schedule` or `workflow_dispatch`, on `main`): - On failure: if an open issue with the fixed title `Nightly Molecule run failed` exists, comment the run's URL on it; otherwise open it with label `Status/Needs Triage`. - On success: if that issue is open, comment the run's URL and close it. - Call the Gitea API with `curl` and the job token. Grant `permissions: issues: write` on that job only; everything else keeps `contents: read`. Pass every value through `env:`, never `${{ }}` in a `run:` block. - The issue body and comments carry the run link only: no log text and no host, address, network or sizing detail (the job-output rule from [Does the stand-alone rule cover issue text and job logs](https://git.rkdr.net/Mortis/Kamino/issues/253)). A pull-request run never touches the issue. ## Acceptance - A failing `workflow_dispatch` run on `main` opens the issue; a second failing run comments on it; a green run closes it. - A pull-request run, green or red, leaves it alone. - No changelog fragment (tooling, in `build_ignore`). ## Not verified Whether `issues: read` alone would let the job token open an issue (the route only checks repo read on issues; inferred from source, not tested). Ask for `issues: write`. The owner rule ("the maintainer owns a red nightly; any trusted contributor may fix it") is written into `maintaining.md` by [#262](https://git.rkdr.net/Mortis/Kamino/issues/262), not here.
Claude added this to the Continuous delivery milestone 2026-11-20 19:42:21 +00:00
Claude added the
Status
Ready for Agent
label 2026-11-20 19:42:21 +00:00
Author
Owner

Scope added by #359, the pull request for #262: docs/contributing/maintaining.md holds the rule "The maintainer owns triage of a failed full Molecule run; any trusted contributor may fix it." as Held by: aspirational, because this issue's control does not exist yet.

The pull request that closes this issue changes that rule's held-by line in the Releases section of maintaining.md to: Held by: control: the run opens or updates the issue Nightly Molecule run failed and closes it when green. The line names no issue number.

Scope added by #359, the pull request for #262: `docs/contributing/maintaining.md` holds the rule "The maintainer owns triage of a failed full Molecule run; any trusted contributor may fix it." as *Held by:* aspirational, because this issue's control does not exist yet. The pull request that closes this issue changes that rule's held-by line in the Releases section of `maintaining.md` to: *Held by:* control: the run opens or updates the issue `Nightly Molecule run failed` and closes it when green. The line names no issue number.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#270