Skip to content

Conversation

jerop
Copy link
Member

@jerop jerop commented Sep 16, 2020

Changes

Previously, we created a slice containing both tasks and finally tasks then applied replacements across all of them. However, the variable replacements we make in conditions and when expressions in tasks don't apply to finally tasks. Moreover, this joined slice caused strange memory allocation side effects when finally tasks were present vs when they were missing.

We explored reverting the mutation of when expressions when applying replacements, as discussed in #3217 (comment) but decided to remove that because it introduces inconsistencies as discussed in #3244 (comment) and #3244 (comment).

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)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

    NONE

/cc @pritidesai @bobcatfish
/kind cleanup

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 16, 2020
@bobcatfish
Copy link
Collaborator

I am still mostly convinced that a "functional" side effect free approach is the long term way to go, however trying to mix the approaches here has definitely caused some problems.

@bobcatfish
Copy link
Collaborator

In the long run I think we should decide whether to always mutate or always return brand new instances and be consistent about it; in the short term I think it's good to remove the append() from this function since the differences in behavior between when it makes a new slice and when it doesn't are pretty extreme so I think we should go ahead with this PR:

/lgtm

Want to hear @pritidesai 's thoughts too tho before we merge!

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 17, 2020
Previously, we created a slice containing both tasks and finally tasks
then applied replacements across all of them. However, the variable
replacements we make in conditions and when expressions in tasks
don't apply to finally tasks. Moreover, this joined slice caused strange
memory allocation side effects when finally tasks were present vs when
they were missing.
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 17, 2020
@pritidesai
Copy link
Member

this looks great, yes, consistency is must, let's evaluate this further in a separate PR while refactoring params.
/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pritidesai

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 17, 2020
Copy link
Collaborator

@bobcatfish bobcatfish 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 Sep 17, 2020
@bobcatfish
Copy link
Collaborator

TestTaskRunTimeout is flakey maybe? 🤔

/test pull-tekton-pipeline-integration-tests

@jerop
Copy link
Member Author

jerop commented Sep 17, 2020

/test pull-tekton-pipeline-integration-tests

@tekton-robot tekton-robot merged commit 143f812 into tektoncd:master Sep 17, 2020
@jerop jerop deleted the separate-finally branch September 30, 2020 15:57
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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants