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

Serialize and deserialize Finally in PipelineRuns too #3816

Merged
merged 1 commit into from Mar 9, 2021
Merged

Serialize and deserialize Finally in PipelineRuns too #3816

merged 1 commit into from Mar 9, 2021

Conversation

ghost
Copy link

@ghost ghost commented Mar 8, 2021

Changes

In commit 3ea5981 we added a way for Pipeline.Spec.Finally to be serialized into
alpha Pipelines when downgrading from v1beta1. This was done to fix an
error occurring during conversion and to avoid potential data loss.

This commit adds a similar feature to PipelineRuns. Specifically, if a
PipelineRun nests a PipelineSpec with Finally then that too needs to be
serialized and stored on the alpha version to be deserialized later.

/kind bug

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

Release Notes

Fix issue where PipelineRun with finally in nested pipeline spec would lose those finally tasks when converted down to v1alpha1 and back up to v1beta1 again.

@ghost ghost requested review from vdemeester, pritidesai and afrittoli March 8, 2021 20:24
@tekton-robot tekton-robot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 8, 2021
@tekton-robot tekton-robot requested a review from dibyom March 8, 2021 20:25
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 8, 2021
@ghost ghost added this to the Pipelines 0.22 milestone Mar 8, 2021
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/pipeline_conversion.go 93.5% 92.7% -0.8
pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go 90.5% 86.8% -3.7

In commit 3ea5981 we added a way for Pipeline.Spec.Finally to be serialized into
alpha Pipelines when downgrading from v1beta1. This was done to fix an
error occurring during conversion and to avoid potential data loss.

This commit adds a similar feature to PipelineRuns. Specifically, if a
PipelineRun nests a PipelineSpec with Finally then that too needs to be
serialized and stored on the alpha version to be deserialized later.
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/pipeline_conversion.go 93.5% 91.6% -1.9
pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go 90.5% 86.8% -3.7

Copy link
Member

@pritidesai pritidesai left a comment

Choose a reason for hiding this comment

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

The changes looks fine but I am trying to understand the usage here. Since the specifications are inlined, it can not be used by any other run. These changes discloses the finally section when listed the run in v1alpha1.

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 8, 2021
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 9, 2021
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pritidesai, vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot merged commit 88fbd6a into tektoncd:master Mar 9, 2021
@ghost
Copy link
Author

ghost commented Mar 9, 2021

The changes looks fine but I am trying to understand the usage here. Since the specifications are inlined, it can not be used by any other run. These changes discloses the finally section when listed the run in v1alpha1.

This PR was just about matching the behaviour of PipelineRun.PipelineSpec.spec with Pipeline.spec because I felt like that would be an odd sharp edge users could hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants