Repository navigation
fix: gate multi-parent jobs on all predecessors and tolerate generated depends_on in batch config - #2767
Open
kornelwencek-esky wants to merge 1 commit into
Conversation
…d depends_on in batch config Two backend problems made depends_on between a static project and projects generated by generate_projects unusable: 1. Multi-parent job gating (fixes diggerhq#2765): CollapsedGraph returned early when the child vertex already existed, keeping only one incoming edge for a multi-parent child; ConvertJobsToDiggerJobs created one child job row per parent edge. A dependent job could start and complete while its predecessors were still running. Now the edge is added even when the vertex exists, and the child job is created once and linked to every parent job. 2. Batch config reload (fixes diggerhq#2764): backend batch paths that only read top-level settings (aggregate check run update, automerge check, terraform outputs summary, prior-comment deletion) re-converted the stored digger.yml without running generate_projects and failed strict depends_on validation. A new ConvertDiggerYamlToConfigWithoutDependencyValidation skips that validation for those callers; the strict conversion is unchanged.
kornelwencek-esky
marked this pull request as ready for review
November 4, 2026 11:43
This branch has not been deployed
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.
Description
Fixes #2765
Fixes #2764
Two backend problems made
depends_onbetween a static project and projects generated bygenerate_projectsunusable (observed live on a self-hosted backend):Multi-parent job gating (Multi-parent depends_on: dependent job is gated on one predecessor only (CollapsedGraph drops parent edges) #2765):
CollapsedGraphreturned early when the child vertex already existed, keeping only one (traversal-order dependent) incoming edge for a multi-parent child;ConvertJobsToDiggerJobscreated one child job row per parent edge. A dependent job could start and complete while its predecessors were still running.Batch config reload (Backend batch paths fail to convert digger.yml when a static project uses depends_on on a generated project #2764): backend batch paths that only read top-level settings (aggregate check run update, automerge check, terraform outputs summary, prior-comment deletion) re-converted the stored digger.yml without running
generate_projectsand failed the strict depends_on validation, leaving the aggregatedigger/plancheck stuck and posting a warning comment after every job status update.Changes
CollapsedGraph: add the parent -> child edge even when the child vertex already exists (tolerateErrEdgeAlreadyExists); children are still processed only onceConvertJobsToDiggerJobs: create the child job once and link every parent job to it, so gating waits for all predecessorslibs/digger_config: newConvertDiggerYamlToConfigWithoutDependencyValidationfor callers that parse a raw digger.yml without generation;ConvertDiggerYamlToConfigbehavior is unchangedTests
develop: "Expected child to have 3 predecessors, got 1")develop: one job row per parent edge)go test ./backend/utils/ ./backend/models/ ./backend/controllers/and thelibs/digger_configtests pass locally.Note:
gofmt/go vetflag pre-existing issues inbackend/controllers/projects.go(double blank line at ~line 1124, unkeyed struct literals) that exist ondevelopas well and are left untouched here.🧠 Ai UsageDetails (if applicable):
Used an AI coding assistant to draft the fixes and tests; reviewed and verified manually, all tests run locally.