-
Notifications
You must be signed in to change notification settings - Fork 811
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(pipelines): Pass 'staleCheck' through from savePipeline context to front50 #3841
feat(pipelines): Pass 'staleCheck' through from savePipeline context to front50 #3841
Conversation
…to front50 Related to spinnaker/front50#915
|
@@ -77,6 +77,8 @@ public TaskResult execute(StageExecution stage) { | |||
final Boolean isSavingMultiplePipelines = | |||
(Boolean) | |||
Optional.ofNullable(stage.getContext().get("isSavingMultiplePipelines")).orElse(false); | |||
final Boolean staleCheck = | |||
(Boolean) Optional.ofNullable(stage.getContext().get("staleCheck")).orElse(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is sprinkled here across the whole task (and orca...) but really this should be
(Boolean) Optional.ofNullable(stage.getContext().get("staleCheck")).orElse(false); | |
(Boolean) Optional.ofNullable(stage.getContext().getCurrentOnly("staleCheck")).orElse(false); |
otherwise if there is an evalVars upstream that has a variable stageCheck
we might end up using that if none is present on this stage context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, in StageExecutionImpl:
/** The context driving this stage. Provides inputs necessary to component steps */
private Map<String, Object> context = new StageContext(this);
... feels pretty nasty to cast this to a StageContext
Since StageContext implements Map, would it be reasonable to change StageExecution
to return a StageContext?
/** TODO(rz): Try to use StageContext instead? */
@Nonnull
Map<String, Object> getContext();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
welp, StageContext
isn't available in orca-api
so we'd have to extract an interface for it to do ☝️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we are casting in one spot already, the pipeline stage
orca/orca-front50/src/main/groovy/com/netflix/spinnaker/orca/front50/pipeline/PipelineStage.java
Line 72 in ae2b804
StageContext context = (StageContext) stage.getContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after discussing with mark offline, we're leaving it as-is
Related to spinnaker/orca#3841 Co-authored-by: spinnaker <spinnaker@netflix.net> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…to front50 (spinnaker#3841) * feat(pipelines): Pass 'staleCheck' through from savePipeline context to front50 Related to spinnaker/front50#915 * test: update SavePipelineTaskSpec Co-authored-by: spinnaker <spinnaker@netflix.net> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
No description provided.