-
Notifications
You must be signed in to change notification settings - Fork 184
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(pipelineTemplateSave): Take tags from template files #355
fix(pipelineTemplateSave): Take tags from template files #355
Conversation
did you run |
@Chinikins |
Looks like we need to review & merge #358 first, rebase this and then the lint job should run properly. |
And great work on figuring out the logic and replicating here @kbatalin ! |
@Mergifyio update |
❌ Base branch update has failedrefusing to allow a GitHub App to create or update workflow |
Hi, Thanks for the CI fix! Could you have a look on the PR? |
Hi @Chinikins @karlskewes @dbyron-sf Could you have a look on the PR? |
@Mergifyio update |
❌ Base branch update has failedrefusing to allow a GitHub App to create or update workflow |
Can you rebase please @kbatalin ? |
Spin ignores tags from pipeline template files, and it causes errors during saving. Example of the problem: 1. Create a template with a tag "stable" inside 2. Save it via `spin pt save`. Don't pass the tag to the command, because it already exists in the code 3. Front50 parses the template and finds the tag inside: https://github.com/spinnaker/front50/blob/master/front50-web/src/main/java/com/netflix/spinnaker/front50/controllers/V2PipelineTemplateController.java#L94 4. Front50 saves the template with the tag 5. Edit the code of the template and save it again 6. Spin tries to find a template in Front50 without tags (because we don't pass the tag via arguments) 7. Spin can't find the template and invokes "create" method instead of "update" 8. Front50 throws an DuplicateEntityException because a template with the id already exists. Validation code: https://github.com/spinnaker/front50/blob/master/front50-web/src/main/java/com/netflix/spinnaker/front50/controllers/V2PipelineTemplateController.java#L115 Front50 takes a tag from query parameters as a priority. And only if the tag is not in the query parameters, it tries to take it from the template source code. https://github.com/spinnaker/front50/blob/master/front50-web/src/main/java/com/netflix/spinnaker/front50/controllers/V2PipelineTemplateController.java#L93 I reproduced a similar logic in Spin
@dbyron-sf |
Hi @dbyron-sf , |
Yup, hoping @Chinikins or @karlskewes can have a look. |
Hi @Chinikins , |
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.
LGTM, thanks very much.
@karlskewes |
Spin ignores tags from pipeline template files, and it causes errors during saving.
Example of the problem:
spin pt save
. Don't pass the tag to the command, because it already exists in the codeFront50 takes a tag from query parameters as a priority. And only if the tag is not in the query parameters, it tries to take it from the template source code. code
I reproduced a similar logic in Spin