Versions list: fix V/✔ shown for terminated combined-push jobs#246
Merged
Conversation
GetRunsStatusesPerVersionId only queried the legacy IMPORT_MODEL + CODE_PARSE subtypes; the new combined JOBSUBTYPE_PUSH (used by every push after the code-parse + import-model merger) wasn't fetched. CalcVersionStatus then saw zero jobs, never hit its IsJobFailed branch, and — if the version's modelId had already been written before termination — returned FINISHED, rendering a green ✔ next to a terminated push. Add JOBSUBTYPE_PUSH to the subtype filter so the loop can see and classify the terminated Push job as failed (✖). Versions that were terminated *before* a model record was created continue to flag as failed via the existing !hasModel guard. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
The version selector in the CLI was rendering a green ✔ next to versions whose push job had been terminated (e.g. user hits Ctrl-C at step 3 of the Push pipeline after the model record has already been written).
Root cause:
GetRunsStatusesPerVersionIdonly queries the legacy split push subtypes:Pushes after the code-parse + import-model merger run as a single
JOBSUBTYPE_PUSHjob. The call returns an empty list for those versions,CalcVersionStatus'sfor _, job := range lastJobByTypeloop runs zero iterations, and the function falls through toVersionStatus_FINISHEDwheneverhasModelis true — exactly the "terminated at step 3" case the user reported.Fix: add
JOBSUBTYPE_PUSHto the subtype filter. The classifier now sees the terminated combined-push job,IsJobFailedmatches (Terminated/Stopped/Failed), and the version renders ✖.Cases covered
hasModelPush!hasModel)PushCode Parse+Import ModelTest plan