-
Notifications
You must be signed in to change notification settings - Fork 807
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
fix(RRB): fix NPE introduced in https://github.com/spinnaker/orca/pull/3031 #3050
fix(RRB): fix NPE introduced in https://github.com/spinnaker/orca/pull/3031 #3050
Conversation
@@ -122,6 +114,14 @@ class RollingRedBlackStrategy implements Strategy, ApplicationContextAware { | |||
|
|||
Stage parentCreateServerGroupStage = stage.directAncestors().find() { it.type == CreateServerGroupStage.PIPELINE_CONFIG_TYPE } | |||
|
|||
if (parentCreateServerGroupStage.status == ExecutionStatus.NOT_STARTED) { | |||
// No point in composing the flow if we are called to plan "beforeStages" since we don't have any STAGE_BEFOREs. |
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.
I don't see an explicit connection between the condition being checked and being called to plan beforeStages, can you elaborate?
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.
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.
what happens is:
DeployStrategyStage
implemented aroundStages
which calls our composeFlow
the DeployStrategyStage::aroundStages
is called from StageDefinitionBuilder::beforeStages
(java) which is called from StageDefinitionBuilder::buildBeforeStages
(kotlin), which is called from RunStageHandler
When there is no source server group and a validation pipeline has been specified RRB flow composition will fail (erroneously) trying to construct parameters to be passed into the validation pipeline (even though the source isn't even necessary!). This fix does two things: 1. Correctly calculate parameters passed into the validation pipeline 2. Don't even bother composing the flow if we are being called during the `beforeStages` since all these stages will be discared anyway (none of the stages have `STAGE_BEFORE` synthetic) Medium term: all of this should just go away - we shouldn't be using `aroundStages` which is a source of lots of confusion. I will be refactoring this code to take advantage of newer `beforeStages` and `afterStages`
50b568d
to
6ecd0ff
Compare
@dreynaud i am going to merge this so we can potentially deploy it on monday. Let me know if you have any comments |
When there is no source server group and a validation pipeline has been specified
RRB flow composition will fail (erroneously) trying to construct parameters to be
passed into the validation pipeline (even though the source isn't even necessary!).
This fix does two things:
beforeStages
since all these stages will be discared anyway (none of the stages have
STAGE_BEFORE
synthetic)Medium term: all of this should just go away - we shouldn't be using
aroundStages
which is asource of lots of confusion. I will be refactoring this code to take advantage of newer
beforeStages
andafterStages