Skip to content

feat(train): mark merges, write a heartbeat and report the train health - #15

Merged
Nain9Dev merged 1 commit into
mainfrom
feat/train-observability
Oct 14, 2026
Merged

Nain9Dev merged 1 commit into
mainfrom
feat/train-observability

Conversation

@Nain9Dev

Copy link
Copy Markdown
Member

Summary

Tasks T19 and T20 of specs/next-ci-reliability (contrast3d-platform), requirements FR13 and FR14,
with the decisions taken with the owner (the train leaves a mark; alerts go to the log and the
weekly report only).

  • Mark (T19): after a successful merge the train comments <!-- merge-train:merged --> on the
    pull request. A failing comment is logged (mark failed) and never undoes or fails the merge. The
    report counts, for the repositories of --config, the pull requests merged without the mark since
    --train-since: "Merged outside the train: X of Y" in the snapshot.
  • Heartbeat (T20): a heartbeat: line with the number of repositories, labelled pull requests
    and the version (a fingerprint, equal for LF and CRLF copies) of the script, at most once an hour;
    its state lives in heartbeat.json beside the configuration; a dry run does not write it.
  • Train health in the report (T20): --train-dir adds a "Merge train" section: age of
    train.log (silent after 90 minutes) and whether the installed automerge.py differs from
    train/automerge.py of ci-shared main.

Verification

  • 21 new tests with a simulated gh, written first (136 in total); ruff clean.
  • Smoke test against the real contrast3d-bot: the report says 4 of 4 merges since 2026-10-14 were
    outside the train (true: the train is not installed yet) and that the train is not installed here.

The train comments a mark on every pull request it merges, so the report
can count the pull requests merged around it, and writes a heartbeat line
at most once an hour with its repositories, labelled pull requests and
script version. The report counts the merges without the mark for the
repositories of the shared train, and shows the age of the installed
train's log and whether its script differs from the one in ci-shared
main, which is how a train that cannot see its repository was missed for
five hours after a repository transfer.
@Nain9Dev
Nain9Dev merged commit 4dc651e into main Oct 14, 2026
5 checks passed
@Nain9Dev
Nain9Dev deleted the feat/train-observability branch October 14, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant