Skip to content

fix(controller): skip lifecycle hooks for omitted nodes - #16977

Open
zzz-yu wants to merge 1 commit into
argoproj:mainfrom
zzz-yu:patch-3
Open

zzz-yu wants to merge 1 commit into
argoproj:mainfrom
zzz-yu:patch-3

Conversation

@zzz-yu

@zzz-yu zzz-yu commented Sep 15, 2026

Copy link
Copy Markdown

Fixes #15192

Omitted DAG nodes are not executed and should not run lifecycle hooks. The shared hook executor now returns without evaluating or creating hook nodes for an Omitted parent, preventing failure hooks from firing for tasks whose depends condition was not satisfied.

Tests not run (web editor submission).

Summary by CodeRabbit

  • Bug Fixes
    • Lifecycle hooks are now skipped when their parent node is omitted, preventing hooks from running for excluded workflow elements.

Do not execute template lifecycle hooks when a DAG or step node is Omitted. Omitted nodes did not run and must not trigger failure hooks.

Signed-off-by: Yu Zhou <66656208+zzz-yu@users.noreply.github.com>
@zzz-yu
zzz-yu requested a review from a team as a code owner September 15, 2026 14:29
@github-actions github-actions Bot added the problem/bot-not-ready Readiness bot declares this as not ready, see comment by bot for why label Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 PR readiness check

Thanks for your contribution! A few automated checks need attention before a maintainer reviews — these are all things you can fix yourself:

PR description / template

The PR description does not appear to follow the template:

  • Motivation: The "Motivation" section is missing — please keep it and fill it in.
  • Modifications: The "Modifications" section is missing — please keep it and fill it in.
  • Verification: The "Verification" section is missing — please keep it and fill it in.
  • Documentation: The "Documentation" section is missing — please keep it and fill it in.
  • AI: The "AI" section is missing — please keep it and fill it in.

(A maintainer may waive this.)

Note

This PR carries the problem/bot-not-ready label while the items above are addressed. It is removed automatically once everything passes.


🤖 Automated PR-readiness helper — it re-checks each time CI finishes. Unit/E2E test results are not covered here. Questions? See the contributing guide or ask a maintainer.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 529bdfff-f9c0-43ae-bdb8-6ccdc24204cd

📥 Commits

Reviewing files that changed from the base of the PR and between 0e44371 and 3fd8c48.

📒 Files selected for processing (1)
  • workflow/controller/hooks.go

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The lifecycle hook execution path now skips all hooks when the parent node is omitted. This prevents failure hooks from running for omitted nodes.

Changes

Omitted node hook handling

Layer / File(s) Summary
Skip hooks for omitted parents
workflow/controller/hooks.go
executeTmplLifeCycleHook returns without processing hooks when the parent node is omitted.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: isubasinghe

Merge Risk: ⚪ Minimal · up to 3fd8c

The omitted-node hook change has no concrete merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the issue and the code change, but it does not follow the required template. It omits the required checklist, Motivation, Modifications, Verification, Documentation, and AI se… Complete the required checklist and add the missing template sections. State the motivation, modifications, verification results, documentation impact, and whether generative AI was used. Run and report the relevant tests if possible.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: lifecycle hooks are skipped for omitted nodes.
Linked Issues check ✅ Passed Issue #15192 requires failure hooks to run only when the associated node fails. In workflow/controller/hooks.go, executeTmplLifeCycleHook now returns from hook processing for an omitted parent nod…
Out of Scope Changes check ✅ Passed The reviewed change adds only the omitted-node guard in workflow/controller/hooks.go. The guard directly addresses issue #15192 and does not introduce unrelated behavior or files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Description check

Explanation

The description explains the issue and the code change, but it does not follow the required template. It omits the required checklist, Motivation, Modifications, Verification, Documentation, and AI sections, and it states that tests were not run.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.16%. Comparing base (0e44371) to head (3fd8c48).

Files with missing lines Patch % Lines
workflow/controller/hooks.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16977      +/-   ##
==========================================
+ Coverage   40.11%   40.16%   +0.05%     
==========================================
  Files         572      572              
  Lines       44854    44856       +2     
==========================================
+ Hits        17991    18016      +25     
+ Misses      25068    25050      -18     
+ Partials     1795     1790       -5     
Flag Coverage Δ
unit-tests 40.11% <0.00%> (+0.04%) ⬆️
unit-tests-windows 28.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

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

Labels

problem/bot-not-ready Readiness bot declares this as not ready, see comment by bot for why

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Omitted node's failure hook runs

1 participant