Skip to content

Conversation

@ItielOlenick
Copy link
Contributor

Fixes #11610

Motivation

Workflows with parameterized global artifact names (e.g., globalName: output-result-{{inputs.parameters.variable}}) fail validation in exit handlers after v3.4.6 with
errors like "failed to resolve {{workflow.outputs.artifacts.output-result-car}}". This worked correctly in v3.4.5 and earlier.

Modifications

  • Added pre-scan in exit handler validation to detect parameterized global artifacts
  • Enable anyWorkflowOutputArtifactMagicValue when parameterized global artifacts exist
  • Added comprehensive unit tests covering the regression scenario

Verification

  • Unit tests reproduce the exact failure and verify the fix
  • Existing validation tests continue to pass
  • Runtime artifact resolution remains unchanged

Documentation

No documentation changes needed - this restores existing functionality that was inadvertently broken.

@ItielOlenick ItielOlenick force-pushed the fix-parameterized-global-artifacts-resolution-in-exit-handler branch from afd1f36 to 6e27ca6 Compare October 26, 2025 21:32
@ItielOlenick ItielOlenick changed the title fix parameterized global artifacts resolution in exit handler fix: Fixes parameterized global artifacts resolution in exit handlers. Fixes #11610 Oct 26, 2025
@elliotgunton
Copy link
Member

elliotgunton commented Nov 13, 2025

Hey @ItielOlenick, I was looking to review this as I recently fixed a similar issue in #15033. As part of that I refactored the anyVarNotInEnv function so it would be worth a careful rebase/merge first so we can be sure that the code is up to date before reviewing.

It looks like you'd just need to ensure your code commented with Special handling is carried over, i.e. to add the

		if strings.HasPrefix(variable, "workflow.outputs.") {
				continue
			}

part and from envForCompilation := env. The anyVarNotInEnv is now only called once and checks through all special case variables at once (returning the name of the referenced variable), so the workflowVariables will be removed entirely when you rebase/merge. Thanks! 🚀

@ItielOlenick
Copy link
Contributor Author

ItielOlenick commented Nov 14, 2025

@elliotgunton After taking a look at your changes and doing some more testing, I removed all of the expression related changes as they seemed unnecessary and left only the validation ones.
Ready for a review

Copy link
Member

@elliotgunton elliotgunton left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@Joibel Joibel self-assigned this Nov 18, 2025
@Joibel
Copy link
Member

Joibel commented Nov 18, 2025

Whilst testing this I've noticed a couple of things - I'll also take the test from #11610 and turn it into an e2e test

@Joibel Joibel added cherry-pick/3.6 Cherry-pick this to release-3.6 cherry-pick/3.7 Cherry-pick this to release-3.7 labels Nov 18, 2025
@Joibel Joibel merged commit 199a137 into argoproj:main Nov 18, 2025
71 of 72 checks passed
@argo-cd-cherry-pick-bot
Copy link

❌ Cherry-pick failed for 3.7. Please check the workflow logs for details.

@argo-cd-cherry-pick-bot
Copy link

❌ Cherry-pick failed for 3.6. Please check the workflow logs for details.

Joibel added a commit that referenced this pull request Nov 18, 2025
Joibel pushed a commit that referenced this pull request Nov 18, 2025
…Fixes #11610 (#14991)

(cherry picked from commit 199a137)

Signed-off-by: ItielOlenick <[email protected]>
Signed-off-by: ItielOlenick <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Joibel pushed a commit that referenced this pull request Nov 18, 2025
…Fixes #11610 (#14991)

(cherry picked from commit 199a137)

Signed-off-by: ItielOlenick <[email protected]>
Signed-off-by: ItielOlenick <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Joibel added a commit that referenced this pull request Nov 21, 2025
AnonyScorpio pushed a commit to AnonyScorpio/argo-workflows that referenced this pull request Nov 25, 2025
…Fixes argoproj#11610 (cherry-pick argoproj#14991 for 3.7) (argoproj#15056)

Signed-off-by: ItielOlenick <[email protected]>
Signed-off-by: ItielOlenick <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Co-authored-by: ItielOlenick <[email protected]>
AnonyScorpio pushed a commit to AnonyScorpio/argo-workflows that referenced this pull request Nov 25, 2025
…Fixes argoproj#11610 (cherry-pick argoproj#14991 for 3.6) (argoproj#15057)

Signed-off-by: ItielOlenick <[email protected]>
Signed-off-by: ItielOlenick <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Co-authored-by: ItielOlenick <[email protected]>
guanguxiansheng pushed a commit to guanguxiansheng/argo-workflows that referenced this pull request Dec 15, 2025
guanguxiansheng pushed a commit to guanguxiansheng/argo-workflows that referenced this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick/3.6 Cherry-pick this to release-3.6 cherry-pick/3.7 Cherry-pick this to release-3.7

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v3.4.6+ Cannot access output global artifacts in exit handler after upgrade

3 participants