Repository navigation
refactor(task): remove unreachable disabled task check in tryResolveActiveFeatureSubgraph - #1016
Merged
Merged
Conversation
…ctiveFeatureSubgraph The loop-head check on disabledRefIDSet can never fire. Both callers skip disabled candidates before calling this function, and the pre-enqueue check on each dependency returns early with the same result, so the queue never holds a disabled task.
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
September 16, 2026 10:08
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors pkg/core/task/graphresolver.go by removing a redundant check for disabled tasks within the queue traversal loop, as disabled tasks are already prevented from being enqueued. A detailed comment has been added to clarify this logic. There are no review comments, and the changes look clean and correct.
kyasbal
enabled auto-merge
September 16, 2026 10:10
Merged
via the queue into
GoogleCloudPlatform:main
with commit Sep 16, 2026
2fd3a2f
17 checks passed
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
Removes an unreachable guard at the top of the
tryResolveActiveFeatureSubgraphBFS loop. This is a pure cleanup with no behavior change.Why it can never fire
Only two kinds of tasks ever enter
queue, and both pass a disabled check before they get there.candidate. Both callers,expandActiveFeaturePointToPointDependenciesandfindAndConditionallyExpandActiveFeatureTasks, skip a disabled task before they call this function. These are the only two call sites, and no test calls the function directly.nextTaskappended inside the loop. The check ondisabledRefIDSet[depRefID]runs before the append and returnsnil, falseright away when the dependency is disabled, so a disabled task is never enqueued.So the invariant "queue never holds a disabled task" holds, and the removed guard always evaluated to false. It also returned exactly the same
nil, falseas the pre-enqueue check, so removing it cannot change any result.The remaining check now carries a comment that records this invariant, so the loop-head guard does not get added back.
Note on scope
This redundancy predates #1014. Adding the upstream propagation there does not make the guard reachable, because the newly disabled tasks are still caught by the pre-enqueue check. It was left untouched in #1014 to keep that diff focused on the bug fix.
Verification
make build-go,make lint-go(0 issues) andmake test-goall pass. No test changes are included, since dead code removal is not observable from the outside.