Skip to content

feat: Completion Dependencies (Always RunCondition)#257

Open
thalesraymond wants to merge 1 commit intomainfrom
feat-completion-dependencies-14820992859916586404
Open

feat: Completion Dependencies (Always RunCondition)#257
thalesraymond wants to merge 1 commit intomainfrom
feat-completion-dependencies-14820992859916586404

Conversation

@thalesraymond
Copy link
Copy Markdown
Owner

Implement the feature to support completion dependencies by adding granular execution controls (runConditions). Dependencies can now be assigned an 'always' condition allowing teardowns and cleanup tasks to execute successfully even if their parent steps result in failure.


PR created automatically by Jules for task 14820992859916586404 started by @thalesraymond

- Updates `TaskStep.ts` with `TaskRunCondition` and mixed dependencies type
- Updates `TaskStateManager.ts` to support 'always' execution condition and execute cleanup tasks regardless of preceding task status
- Updates `TaskRunner.ts` to parse mixed dependencies for graph execution and validation
- Adds full suite of tests covering the 'always' dependency flow
- Maintains 100% test coverage and passes all linting
- Archives the specification according to OpenSpec workflow

Co-authored-by: thalesraymond <32554150+thalesraymond@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new 'always' run condition for task dependencies, allowing cleanup tasks to execute even if their preceding tasks fail. The implementation updates the task runner and state manager to handle these dependencies and includes comprehensive tests to verify the behavior. I have provided a suggestion to improve the condition logic in TaskStateManager.ts to ensure that 'always' tasks also trigger when a parent task is cancelled, rather than just when it fails.

Comment on lines +229 to +233
// If the dependent runs 'always' and the parent task *actually failed* (not skipped), we can unblock it
if (dependent.condition === "always" && currentResult?.status === "failure") {
this.decrementDependencyCount(dependent.step);
continue;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current logic for always dependencies only considers the failure status to unblock the dependent task. This means if a parent task is cancelled, any always dependent task will be incorrectly skipped instead of being executed for cleanup.

According to the feature's goal of ensuring cleanup tasks run, always should trigger on any non-successful completion of the parent task, except when the parent was skipped.

I suggest modifying the condition to unblock always dependents for any terminal status that isn't skipped, which would correctly include both failure and cancelled.

Suggested change
// If the dependent runs 'always' and the parent task *actually failed* (not skipped), we can unblock it
if (dependent.condition === "always" && currentResult?.status === "failure") {
this.decrementDependencyCount(dependent.step);
continue;
}
// If the dependent runs 'always' and the parent task *actually ran* (i.e., was not skipped), we can unblock it
if (dependent.condition === "always" && currentResult && currentResult.status !== "skipped") {
this.decrementDependencyCount(dependent.step);
continue;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant