Repository navigation
fix(workflow): list a failed live attempt once in Runs - #1585
Merged
Merged
Conversation
A failed attempt stays live and also has its own history row; runHistoryRows keyed a live row by its run id and a history row by task id plus time, so the two never matched and the Runs tab painted the same attempt twice. Key live rows by both, so the failed attempt shows once while a real retry still shows the earlier attempt and the current one. Fixes #1583 Docs-not-needed: the Runs tab still lists one row per attempt; no documented architecture changes.
Collaborator
Author
|
Verdict: PASS at 6a5fefb Ran at this tip: Red first: the same two commands with only Review points:
Not run: the full |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written-by: Claim 5819
Fixes #1583
Owner: Chief
Reviewer: Reviewer
Tip SHA: 6a5fefb
Base: 2998941
Docs-not-needed: the Runs tab still lists one row per attempt; no documented architecture changes.
What changed
With no run active and the last attempt failed, the Runs tab painted that attempt twice: a live row for the failed run plus its own history row.
runHistoryRowskeyed a live row by its run id and a history row by task id plus time, so the two never matched. A live row now carries both keys, so the failed attempt is listed once and still labelledFailed(its status already comes fromrun.status). A real retry — historyfailedat an earlier time, live runrunning— still shows two rows with the current one marked current.Red first
Added two cases in
plugins/workflow/test/client.test.js: the failed-live case (rows.length === 1, statusfailed, zerorunning) and a genuine-retry guard (two rows,['running','failed'],[true,false]). Against the base blob ofclient.jsthe failed-live case fails with2 !== 1; with the change all 56 cases in the file pass. The existingrunHistoryRowscases andthe runs tab shows one running row per concurrent live runstay green.Ran / not run
Ran: in
plugins/workflow:node --import ./test/resolve.mjs --test test/client.test.js— 56 pass, 0 fail (55 pass, 1 fail on the base blob).Not run:
npm run verifyandoxlint— no reponode_modulesin this checkout; CI runs them.Scope and risk
Client display only in
plugins/workflow/client.js; no service, state, key or permission change. Adds the changelog fragmentchangelog.d/1583-workflow-runs-dedup.fixed.md.Checkpoint
{
"pr": 1585, "claim": "Chief", "issue": 1583,
"summary": "Runs no longer lists a failed last attempt twice. A live row is keyed by its run id and by task id plus time, so the history row that is the same attempt is skipped and the attempt shows once, labelled Failed. A genuine retry still shows the earlier failed attempt and the current running one. Client display only; two tests added, the failed-live case red on the base blob.",
"files": ["plugins/workflow/client.js", "plugins/workflow/test/client.test.js", "changelog.d/1583-workflow-runs-dedup.fixed.md"],
"checks": { "ran": "node --import ./test/resolve.mjs --test test/client.test.js (plugins/workflow)", "result": "green", "at": "6a5fefb2c5558397d37c473eed79ee4455261018" },
"next": "none — ready for review"
}