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

TEP-0097 breakpoint before steps for taskrun #7391

Merged

Conversation

chengjoey
Copy link
Member

@chengjoey chengjoey commented Nov 18, 2023

Changes

breakpoint before steps for taskrun
TEP-0097
#5691

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

breakpoint before a step

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 18, 2023
@chengjoey
Copy link
Member Author

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 18, 2023
@chengjoey
Copy link
Member Author

/assign @chitrangpatel @lbernick

@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
cmd/entrypoint/main.go 11.6% 12.7% 1.1
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 96.9% 97.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.3% 93.5% 0.2
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/entrypoint/entrypointer.go 87.6% 87.7% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.6% 12.7% 1.1
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 96.9% 97.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.3% 93.5% 0.2
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/entrypoint/entrypointer.go 87.6% 87.7% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chengjoey chengjoey force-pushed the feat/TEP-009-breakpoint-before-step branch from 5ffee60 to e15525f Compare November 18, 2023 13:49
@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
cmd/entrypoint/main.go 11.6% 12.7% 1.1
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 96.9% 97.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.3% 93.5% 0.2
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/entrypoint/entrypointer.go 87.6% 87.7% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.6% 12.7% 1.1
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 96.9% 97.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.3% 93.5% 0.2
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/entrypoint/entrypointer.go 87.6% 87.7% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chengjoey
Copy link
Member Author

/test pull-tekton-pipeline-build-tests

@chengjoey chengjoey force-pushed the feat/TEP-009-breakpoint-before-step branch from e15525f to 49f4641 Compare November 20, 2023 01:49
@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
cmd/entrypoint/main.go 11.6% 12.7% 1.1
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 96.9% 97.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.3% 93.5% 0.2
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/entrypoint/entrypointer.go 87.6% 87.7% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.6% 12.7% 1.1
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 96.9% 97.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.3% 93.5% 0.2
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/entrypoint/entrypointer.go 87.6% 87.7% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chengjoey chengjoey force-pushed the feat/TEP-009-breakpoint-before-step branch from 49f4641 to c5befb0 Compare November 20, 2023 02:40
@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
cmd/entrypoint/main.go 11.6% 12.7% 1.1
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 96.9% 97.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.3% 93.5% 0.2
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/entrypoint/entrypointer.go 87.6% 87.7% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.6% 12.7% 1.1
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 96.9% 97.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.3% 93.5% 0.2
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/entrypoint/entrypointer.go 87.6% 87.7% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chitrangpatel
Copy link
Contributor

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chitrangpatel

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 Dec 19, 2023
@chitrangpatel chitrangpatel added this to the Pipelines v0.56 milestone Jan 9, 2024
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2024
@chengjoey chengjoey force-pushed the feat/TEP-009-breakpoint-before-step branch from c5befb0 to 9e2e2f3 Compare January 25, 2024 03:47
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 25, 2024
@chengjoey
Copy link
Member Author

@chengjoey please rebase. This will pull in the image tagging changes introduced to hopefully get us past the CI Docker rate limit errors

i have reased, but it doesn't seem to work, I'll try test again later

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 92.8% 92.9% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.0% 97.1% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.0% 0.0
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chitrangpatel
Copy link
Contributor

@chengjoey please rebase. This will pull in the image tagging changes introduced to hopefully get us past the CI Docker rate limit errors

i have reased, but it doesn't seem to work, I'll try test again later

yeah I think we are still being affected by the ongoing rate pull effect which exists for 6 hours!!

@chengjoey
Copy link
Member Author

image

It looks a bit strange, is it because of golint upgrade?

@chengjoey
Copy link
Member Author

/test pull-tekton-pipeline-alpha-integration-tests

@chengjoey
Copy link
Member Author

/test pull-tekton-pipeline-build-tests

@chengjoey chengjoey force-pushed the feat/TEP-009-breakpoint-before-step branch from 00e2654 to 49779a3 Compare August 2, 2024 02:35
@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
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.0% 0.0
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.0% 0.0
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chengjoey chengjoey force-pushed the feat/TEP-009-breakpoint-before-step branch from 49779a3 to 02a269e Compare August 2, 2024 06:07
@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
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.0% 0.0
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.0% 0.0
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chengjoey chengjoey force-pushed the feat/TEP-009-breakpoint-before-step branch from 02a269e to 4052462 Compare August 2, 2024 06:57
@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
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.0% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.0% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chengjoey chengjoey force-pushed the feat/TEP-009-breakpoint-before-step branch from 4052462 to 88240b8 Compare August 2, 2024 07:41
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.1% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@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
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.1% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chengjoey chengjoey force-pushed the feat/TEP-009-breakpoint-before-step branch from 88240b8 to b7ee47e Compare August 2, 2024 08:00
@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
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.1% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
cmd/entrypoint/main.go 11.0% 11.9% 1.0
pkg/apis/pipeline/v1/taskrun_types.go 81.4% 82.8% 1.5
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 93.0% 93.1% 0.1
pkg/apis/pipeline/v1beta1/taskrun_types.go 82.3% 83.6% 1.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 97.4% 97.4% 0.1
pkg/entrypoint/entrypointer.go 88.0% 88.1% 0.1
pkg/pod/entrypoint.go 93.4% 93.5% 0.1
pkg/pod/script.go 99.0% 99.1% 0.1

@chengjoey
Copy link
Member Author

@chitrangpatel , now all the checks have passed~

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thank you for this! Just a few minor comments, otherwise it looks good!
Please let me know if you prefer to merge this and address the comments in a follow-up PR.

### Breakpoint before step


TaskRun will be stuck waiting for user debugging before the step execution.
Copy link
Member

Choose a reason for hiding this comment

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

NIT: The TaskRun will be wait for use input before starting the execution of the step



TaskRun will be stuck waiting for user debugging before the step execution.
When beforeStep-Breakpoint takes effect, the user can see the following information
Copy link
Member

Choose a reason for hiding this comment

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

NIT: what's "beforeStep-Breakpoint"? If it is the name of a configuration option or variable please use the inline code-block, else please use a description in plain english i.e. "When the breakpoint before step takes effect"

Comment on lines +80 to +81
1. Executing /tekton/debug/scripts/debug-beforestep-continue will continue to execute the step program
2. Executing /tekton/debug/scripts/debug-beforestep-fail-continue will not continue to execute the task, and will mark the step as failed
Copy link
Member

Choose a reason for hiding this comment

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

NIT: please wrap the file-paths with inline code blocks (e.g. `code block`)

@@ -80,7 +95,13 @@ to reflect step number. eg: Step 0 will have `/tekton/debug/info/0`, Step 1 will
### Debug Scripts

`/tekton/debug/scripts/debug-continue` : Mark the step as completed with success by writing to `/tekton/run`. eg: User wants to exit
breakpoint for failed step 0. Running this script would create `/tekton/run/0` and `/tekton/run/0.breakpointexit`.
onfailure breakpoint for failed step 0. Running this script would create `/tekton/run/0` and `/tekton/run/0/out.breakpointexit`.
Copy link
Member

Choose a reason for hiding this comment

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

NIT: breakpoint on failure


`/tekton/debug/scripts/debug-fail-continue` : Mark the step as completed with failure by writing to `/tekton/run`. eg: User wants to exit
breakpoint for failed step 0. Running this script would create `/tekton/run/0.err` and `/tekton/run/0.breakpointexit`.
onfailure breakpoint for failed step 0. Running this script would create `/tekton/run/0` and `/tekton/run/0/out.breakpointexit.err`.
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

}

// HaveBeforeSteps return true if have any before steps
func (trd *TaskRunDebug) HaveBeforeSteps() bool {
Copy link
Member

Choose a reason for hiding this comment

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

NIT: to be consistent with other method names, this should be HasBeforeSteps

Comment on lines +267 to +273
beforeSteps := sets.NewString()
for i, step := range db.Breakpoints.BeforeSteps {
if beforeSteps.Has(step) {
errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("before step must be unique, the same step: %s is defined multiple times at", step), fmt.Sprintf("breakpoints.beforeSteps[%d]", i)))
}
beforeSteps.Insert(step)
}
Copy link
Member

Choose a reason for hiding this comment

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

It's a pity that we cannot always validate here that the step names provided are actually valid (since resources are not resolved yet), but we could do so at least in the case of embedded specification.
We could validate the case of referenced spec at runtime too. Either case, silently ignoring non-existent step names would not be helpful for users, I think it would be better to fail the TaskRun and report that a step on the list does not exists. WDYT?
This could be an enhancement in a follow-up PR if you agree.

}

var (
errDebugBeforeStep = DebugBeforeStepError("before step breakpoint error file, user decided to skip the current step execution")
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I understand the meaning of this.
I'm guessing that "an error was encountered while waiting for the before-step breakpoint file because the user decided to skip the execution of the step"? Could you clarify?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it could be rephrased as: "before-step breakpoint: step execution skipped by the user"?

logger.Fatalf("Error while handling task artifacts: %s", err)
}
output = append(output, artifacts...)
e.appendArtifactOutputs(&output, logger)
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for moving this code to a function? It does not help with testing and it is not re-used anywhere else.

Comment on lines -213 to +199
checkForBreakpointOnFailure(e, breakpointExitPostFile)
e.CheckForBreakpointOnFailure()
Copy link
Member

Choose a reason for hiding this comment

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

Nice, but it seems unrelated to this PR.
Is the reason for making CheckForBreakpointOnFailure public is to provide unit test coverage?

@chengjoey
Copy link
Member Author

Thank you for this! Just a few minor comments, otherwise it looks good! Please let me know if you prefer to merge this and address the comments in a follow-up PR.

Thanks @afrittoli for your comments. Yes, I hope to merge this PR and fix the issues raised in your comments in a follow-up PR, and I will fix them before the next milestone.

@chitrangpatel
Copy link
Contributor

Merging now.
/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2024
@tekton-robot tekton-robot merged commit 4f04964 into tektoncd:main Aug 22, 2024
14 checks passed
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/feature Categorizes issue or PR as related to a new feature. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants