fix(controller): skip empty optional step artifacts - #16839
Conversation
Signed-off-by: rwong2888 <rwong@forbes.com>
✅ PR readiness: all clearAll contributor-fixable checks are passing. A maintainer will take it from here — thanks! 🤖 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16839 +/- ##
==========================================
- Coverage 39.95% 39.92% -0.04%
==========================================
Files 569 569
Lines 44724 44726 +2
==========================================
- Hits 17869 17855 -14
- Misses 25074 25086 +12
- Partials 1781 1785 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesOptional artifact resolution
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The controller now omits empty optional artifact placeholders and includes regression coverage for skipped-step outputs. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
make pre-commit -Bmake feature-new)Fixes #16477
Motivation
A running step that consumes an
optional: trueartifact from a skipped step can retain an empty artifact placeholder. Later PodSpecPatch substitution then attempts to resolve that placeholder and fails.Modifications
Drop optional step artifact arguments that resolve without an artifact location or key. Add a controller regression test covering an optional artifact resolved from a skipped step output.
Verification
Ran:
KUBECONFIG=/dev/null go test -run 'Test(OptionalArgumentAndParameter|ResolveReferencesSkipsOptionalArtifactFromSkippedStep)' ./workflow/controller/I also built the controller and argoexec and updated the controller's image and the configmap'as argoexec image.
I reran the workflow in the issue and it passed.
Documentation
No documentation change is needed. This restores the documented behavior of optional artifact inputs.
AI
GitHub Copilot assisted with investigation, implementation, test creation, and this PR description.
Summary by CodeRabbit