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

refactor pipelineRunState and pipelinerunresolution.go #2852

Closed
pritidesai opened this issue Jun 24, 2020 · 14 comments
Closed

refactor pipelineRunState and pipelinerunresolution.go #2852

pritidesai opened this issue Jun 24, 2020 · 14 comments
Assignees
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@pritidesai
Copy link
Member

pritidesai commented Jun 24, 2020

With the finally implementation PR #2661, we have been identifying various areas where the code can be simplified (based on changes being proposed in PR #2821). This involves mainly two areas:

  1. Get the execution queue in the Reconciler so that tasks can be scheduled for execution and taskRuns can be created.
  2. Simplify GetPipelineConditionStatus so that the tasks execution status is not calculated from scratch on every call.

In this issue, I am maintaining a list of changes requested in PR #2661. Its very hard for authors (and reviewers) to implement new feature along with refactor/simplify existing code in single PR:

  • Combine isFinalTasksDone, isDAGTasksStopped and isDAGTasksDone into one function, checkTasksDone.
  • Add a function to check if a task is DAG or final task i.e. state.isPipelineTaskinDag as attribute to pipelineRunState and/or task.InDag() as attribute to ResolvedPipelineRunTask.
  • Drop the named return value from pipelineState.IsDone, see comment.
@pritidesai
Copy link
Member Author

/kind cleanup
/assign

@tekton-robot tekton-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jun 24, 2020
@pritidesai pritidesai changed the title refactor pipelineRunState and pipelinerunresolution.go refactor pipelineRunState and pipelinerunresolution.go Jun 24, 2020
@afrittoli
Copy link
Member

With the finally implementation PR #2661, we have been identifying various areas where the code can be simplified (based on changes being proposed in PR #2821). This involves mainly two areas:

1. Get the execution queue in the Reconciler so that tasks can be scheduled for execution and `taskRuns` can be created.

2. Simplify `GetPipelineConditionStatus` so that the tasks execution status is not calculated from scratch on every call.

GetPipelineConditionStatus is only executed once per reconcile cycle, and the pipelineState cannot be persisted across reconcile cycles, however we could build and store the state for each task in pipelineState when the state is initially build, and that would simplify the implementation of GetPipelineConditionStatus, or at least reduce it's execution time.

In this issue, I am maintaining a list of changes requested in PR #2661. Its very hard for authors (and reviewers) to implement new feature along with refactor/simplify existing code in single PR:

* Combine `isFinalTasksDone`, `isDAGTasksStopped` and `isDAGTasksDone` into one function, [checkTasksDone](https://github.com/tektoncd/pipeline/pull/2661#discussion_r444537356).

* Add a function to check if a task is DAG or final task i.e. `state.isPipelineTaskinDag` as attribute to `pipelineRunState`  and/or `task.InDag()` as attribute to `ResolvedPipelineRunTask`.

@afrittoli
Copy link
Member

With the finally implementation PR #2661, we have been identifying various areas where the code can be simplified (based on changes being proposed in PR #2821). This involves mainly two areas:

1. Get the execution queue in the Reconciler so that tasks can be scheduled for execution and `taskRuns` can be created.

2. Simplify `GetPipelineConditionStatus` so that the tasks execution status is not calculated from scratch on every call.

In this issue, I am maintaining a list of changes requested in PR #2661. Its very hard for authors (and reviewers) to implement new feature along with refactor/simplify existing code in single PR:

* Combine `isFinalTasksDone`, `isDAGTasksStopped` and `isDAGTasksDone` into one function, [checkTasksDone](https://github.com/tektoncd/pipeline/pull/2661#discussion_r444537356).

In #2821 isFinalTasksDone and isDAGTasksDonewill lose the dag parameter andisDAGTasksStopped` will go away, so this will already be solved there.

* Add a function to check if a task is DAG or final task i.e. `state.isPipelineTaskinDag` as attribute to `pipelineRunState`  and/or `task.InDag()` as attribute to `ResolvedPipelineRunTask`.

@pritidesai
Copy link
Member Author

Added dropping named return value in the list 🆙 from discussion:

#2661 (comment)

@pritidesai
Copy link
Member Author

Deleted named return value in PR #2870
Refactored and deleted isDAGTasksStopped in PR #2869

@tekton-robot
Copy link
Collaborator

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
Collaborator

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 the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 15, 2020
@tekton-robot
Copy link
Collaborator

@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.

@vdemeester
Copy link
Member

/remove-lifecycle rotten
/remove-lifecycle stale
/reopen

@tekton-robot
Copy link
Collaborator

@vdemeester: Reopened this issue.

In response to this:

/remove-lifecycle rotten
/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 reopened this Aug 17, 2020
@tekton-robot tekton-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 17, 2020
@tekton-robot
Copy link
Collaborator

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 tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 15, 2020
@tekton-robot
Copy link
Collaborator

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

/lifecycle rotten

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. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 15, 2020
@tekton-robot
Copy link
Collaborator

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Collaborator

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/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.

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. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants