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

Clean up PipelineRun component and TaskRun container code #885

Closed
ncskier opened this issue Jan 9, 2020 · 8 comments · Fixed by #1821
Closed

Clean up PipelineRun component and TaskRun container code #885

ncskier opened this issue Jan 9, 2020 · 8 comments · Fixed by #1821
Assignees
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@ncskier
Copy link
Member

ncskier commented Jan 9, 2020

While working on PR #878, I noticed a few things about the PipelineRun component and TaskRun container code that could be cleaned up/simplified.

  1. The TaskRun container and PipelineRun component seem like they're doing very similar things, and I think there's some overlapping functionality/implementation in both of them that can be extracted into a shared component.
  2. The stepsStatus() function has an unnecessary second parameter taskRunStepsStatus. The TaskRun's status.steps already has the status information for each step, so there shouldn't be a second list of statuses passed to the function. This second parameter is also mutated and returned as the stepStatus. The stepStatus should be removed, because it is redundant since step already has everything in stepStatus. This refactoring will have slight a snowball effect, because the stepStatus is used in other components.
  3. The pipelineTaskName should be renamed, because it is a property only found in PipelineRuns, but it is used in components that display TaskRuns. Since the TaskRuns do not have a pipelineTaskName, the property doesn’t make sense in those components.

Additional Info

These are just some things I noticed, but there might be more to clean up/simplify.

@AlanGreene AlanGreene added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Apr 21, 2020
@tekton-robot
Copy link
Contributor

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Contributor

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Aug 14, 2020
@tekton-robot
Copy link
Contributor

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Send feedback to tektoncd/plumbing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@AlanGreene
Copy link
Member

/remove-lifecycle stale
/reopen

@tekton-robot tekton-robot reopened this Aug 14, 2020
@tekton-robot
Copy link
Contributor

@AlanGreene: Reopened this issue.

In response to this:

/remove-lifecycle stale
/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 14, 2020
@AlanGreene
Copy link
Member

  1. Where possible we should remove code that sorts / filters tasks or steps and instead rely on Pipelines to provide accurate information. This should allow us to simplify quite a bit in these 2 components and make it easier to extract common code.

  2. There have been a number of changes made to the PipelineRun / TaskRun and their child components that may affect this.
    It may be possible to remove stepsStatus and some of the code that relies on it entirely, but this would need to be tested carefully to ensure we're still covering all cases.

  3. This would likely be addressed as part of the refactoring in 1, but something worth keeping an eye on to make sure similar naming doesn't leak out.

@AlanGreene
Copy link
Member

PR #1814 starts to address these issues, and subsequent changes should be a lot simpler as a result.

  1. now relies on Pipelines to provide correct step order in TaskRun.status (Pipelines 0.17+), but still maintains a small amount of code to sort TaskRuns. This can be revisited later.

  2. stepsStatus() has been removed, and clearer separation between definitions and runtime data maintained across all components. This accounts for the majority of the changes in Refactor TaskRun / PipelineRun component trees to separate definitions from runtime data #1814

  3. partly addressed, remainder can be resolved after Refactor TaskRun / PipelineRun component trees to separate definitions from runtime data #1814 is merged. That PR is already very large so I'd like to avoid adding more to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants