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

fix(core): handle null when invoking pipelines with stages that are missing a "type" #4655

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

dbyron-sf
Copy link
Contributor

@dbyron-sf dbyron-sf commented Feb 23, 2024

so callers see 400 with a helpful mesage instead of 500.

There's also code here in PipelineBuilder.withStages to throw an IllegalArgumentException for null stages. Due to this change in #4102, PipelineBuilder.withStages isn't called with null even if stages is null in the incoming pipeline. #4182 (Nov 30, 2021, version 1.28.0) was a behavior change from a NullPointerException/500 to succeed (but do nothing) for a pipeline with null stages. #4102 (Jan 3, 2022) was also part of version 1.28.0. Changing the behavior to explictly reject null stages / respond with 400 instead of accepting them and doing nothing feels better, but I'll leave that for a separate PR as it's potentially more controversial.

…issing a "type"

so callers see 400 with a helpful mesage instead of 500.

There's also code here in PipelineBuilder.withStages to throw an IllegalArgumentException
for null stages.  Due to [this change](https://github.com/spinnaker/orca/pull/4102/files#diff-88a2bb8f8eddf44a88866f3d27f096d67577c6c5f651acd88fdb3da32ed88d0aR211),
PipelineBuilder.withStages isn't called with null even if stages is null in the incoming
pipeline.  spinnaker#4182 (Nov 30, 2021, version 1.28.0) was
a behavior change from a NullPointerException/500 to succeed (but do nothing) for a
pipeline with null stages.  spinnaker#4102 (Jan 3, 2022) was
also part of version 1.28.0.  Changing the behavior to explictly reject null stages /
respond with 400 instead of accepting them and doing nothing feels better, but I'll leave
that for a separate PR as it's potentially more controversial.
Copy link
Contributor

@xibz xibz left a comment

Choose a reason for hiding this comment

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

:shipit:

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Feb 23, 2024
@mergify mergify bot added the auto merged Merged automatically by a bot label Feb 23, 2024
@mergify mergify bot merged commit d3ede81 into spinnaker:master Feb 23, 2024
4 checks passed
@dbyron-sf dbyron-sf deleted the null-checks-in-pipelinebuilder branch February 23, 2024 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for merge target-release/1.34
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants