Repository navigation
fix: approve the stored CircleCI workflow when its pipeline listing omits it - #154
Merged
Merged
Conversation
…mits it Fixes #153. ApproveJob found the workflow to approve through the pipeline's workflow listing (to follow reruns). CircleCI's listing sometimes leaves a pipeline's workflows out for a while (returning only setup-workflow), so the lookup failed and the hold job stayed on hold even though the deploy was approved. Now the stored workflow's hold job is approved while it's on hold, without the listing. The listing is only checked when it isn't, to find a rerun: the newest workflow in the pipeline with the same name, created after the original. Without one, the stored workflow's hold job is approved anyway and CircleCI's response says why it can't be. The pipeline is still verified (revision, repository, not a fork) before anything is approved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Oct 13, 2026 11:20p.m. | Review ↗ | |
| Go | Oct 13, 2026 11:20p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
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.
Fixes #153.
Problem
ApproveJobalways found the workflow to approve throughGET /pipeline/{id}/workflow, so it could follow reruns. For a while after some pipelines start, CircleCI's listing returns onlysetup-workflow. The lookup then failed withno workflow found with name …, and the hold job stayed on hold even though the deploy was approved.Fix
on_hold, it is approved directly, without the listing. That's the workflow named by the request'sworkflow_id.verifyPipeline(revision, repository, not a fork) still runs before anything is approved. A rerun is in the same pipeline, so it's covered.I also replaced the duplicated anonymous job structs in
getWorkflowwith oneworkflowJobtype.Tests
The fake CircleCI server can now be configured with workflows, hold-job statuses and listing contents. New cases:
setup-workflow): the stored workflow's hold job is approved, and the listing is never requested.🤖 Generated with Claude Code
Summary by CodeRabbit