Skip to content

workspace status: the first stage shows no risk when the merge cuts the release after it applies #5443

Closed

Description

@lex00

chant workspace status <env> --json shows risk: null on the first stage of a pipeline when the merge cuts the release after that stage applies. The release does carry its risk.

Found on the plywood bench (pw-risk-record, chant 0.124.112, Forgejo). The merge's wave-1-dev job applies shop/dev and then runs chant release cut in the same job. Ledger order on chant/lifecycle:

  1. Change risk of f44e5a939b72
  2. Release record: appends to dev/releases.jsonl with digestKind: "plan", gitSha: f44e5a939b72... and no releaseDigest.
  3. Release jcs1-sha256:f849646a...: the manifest, commit: f44e5a939b72....
  4. Release cut: _releases/cuts.jsonl gets releaseDigest: jcs1-sha256:f849646a..., risk: { score: 0, level: "low" }.

readStageViews in src/workspace/status-stages.ts takes the stage's running release from the newest dev/releases.jsonl record, and that record has no releaseDigest. So riskRelease is null and the stage's risk stays null, even though a cut for the same commit carries a score.

The plain arm of pw-risk-record fails at its risk step, which runs chant workspace status 'dev' --json and reads members[].pipeline.stages[name=dev].risk, with

stage dev has no risk

One way to fix it: when the newest stage record has no releaseDigest, resolve it through the release whose manifest commit equals the record's gitSha. The cut could also write the first stage's release record with the digest once it exists. Either way, the first stage would report the risk its cut carries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions