Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Add SpEL Function Helpers for Resolved Trigger Artifacts #3118

Merged
merged 1 commit into from
Sep 10, 2019

Conversation

evansb
Copy link
Contributor

@evansb evansb commented Aug 23, 2019

Fixes spinnaker/spinnaker#4783
This MR adds the following helper functions to Spinnaker Pipeline Expressions

#triggerResolvedArtifact(name) gets one resolved expected artifact that matches the provided name. I used name instead of type here to make it consistent with #stage(..).

#triggerResolvedArtifactByType(type) is similar to #triggerResolvedArtifact but uses type of the artifact.

@gnarea
Copy link

gnarea commented Sep 9, 2019

Thanks for implementing this functionality @evansb! 🙇 Since the changes to the doc have already been merged, I'm wondering what's blocking the merge of this PR?

@marchello2000
Copy link
Contributor

I will review today

Copy link
Contributor

@marchello2000 marchello2000 left a comment

Choose a reason for hiding this comment

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

other than the nit, LGTM happy to merge it - you can "fix" the comment before or after with a separate PR

@marchello2000 marchello2000 merged commit 8e53833 into spinnaker:master Sep 10, 2019
@marchello2000
Copy link
Contributor

Thanks, @evansb : FYI, there is currently an issue with expressions that doesn't inject the execution in to the expressions - someone on our team is working on the fix

@evansb
Copy link
Contributor Author

evansb commented Sep 10, 2019

Hi @marchello2000 , just to make sure understand that correctly, does it mean that these expressions I introduced only work if the evaluation context is the stage (because they have execution field?).

So we can interpolate inside stages but not in pipeline notifications, for instance?

@marchello2000
Copy link
Contributor

marchello2000 commented Sep 10, 2019

Right now there is an issue where calling the expression from the stage (or anywhere) will fail, if execution isn't passed in, e.g. normally you would:
${#triggerResolvedArtifact('myArtifact')} and under the covers, orca will interpolate it to:
${#triggerResolvedArtifact(execution, 'myArtifact')}

today, this interpolation is broken for new functions so if you want it to work in, you would have to write the expression as ${#triggerResolvedArtifact(execution, 'myArtifact')} - @srekapalli is fixing this

(this is a regression from #3071)

@evansb
Copy link
Contributor Author

evansb commented Sep 10, 2019

Got it, thanks a lot for the explanation

@gnarea
Copy link

gnarea commented Nov 6, 2019

FYI: This doesn't work for me: spinnaker/spinnaker#5105

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

Successfully merging this pull request may close these issues.

Support resolved expected artifacts lookup by display name in pipeline expressions
4 participants