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

Improve debuggability of PullRequest PipelineResource #1818

Closed
bobcatfish opened this issue Jan 7, 2020 · 13 comments
Closed

Improve debuggability of PullRequest PipelineResource #1818

bobcatfish opened this issue Jan 7, 2020 · 13 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@bobcatfish
Copy link
Collaborator

bobcatfish commented Jan 7, 2020

Expected Behavior

If I make simple mistakes in my usage of the PullRequest PipelineResource, I should get an informative error. For example errors like:

Actual Behavior

In some cases, things just succeed silently but do nothing. In other cases you get #1777 where things fail cryptically.

Steps to Reproduce the Problem

See #1777 to repro the fieldName issue (basically use something besides authToken for the secret https://github.com/tektoncd/pipeline/blob/master/docs/resources.md#pull-request-resource).

To reproduce an issue where the wrong format is used, you can use the old format (e.g. https://github.com/bobcatfish/catservice/blob/master/tekton/set-status.yaml) for a status update (pre #1550). The old format was:

        cat <<EOF > /workspace/output/pr/status/tekton.json
        {
          "ID": "tekton",
          "Code": "$(inputs.params.status)",
          "Description": "Tekton is running"
        }
        EOF

The new format is:

        cat <<EOF > /workspace/output/pr/status/poop.json
        {
          "Label": "poop",
          "State": "$(inputs.params.status)",
          "Desc": "Tekton is running"
        }
        EOF

When I try to use the wrong format, the Task silently passes and in the logs I can see:

{"level":"info","ts":1578434462.1463728,"logger":"fallback-logger","caller":"pullrequest/api.go:284","msg":"Skipping setting  because it already matches","resource_type":"pullrequest","mode":"upload","provider":"github","owner":"bobcatfish","repo":"tekton-lab","pr":"4"}

And then I sadly gaze at my open pull request where nothing has happened (true story).

Additional Info

Since as @wlynch has pointed out that some of the trouble is the way the github api responds (e.g. if you dont specify the token properly, you end up with a 404 from github), one idea for how we can handle this is to add more validation:

  • If we see an unexpected fieldname in secrets, fail early
  • Have pullrequest-init do as much validation as possible on the format of the files on disk
@vdemeester
Copy link
Member

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 8, 2020
adshmh added a commit to adshmh/pipeline that referenced this issue Apr 13, 2020
A PullRequest type pipeline resource is now validated: an unrecognised
'fieldName' in secrets will trigger an error. Part of work on tektoncd#1818

As stated in tektoncd#1818, this will help improve the debuggability of the
PullRequst pipeline resource, as the validatiob will cause a failure in
response to invalid input as early as possible.

Signed-off-by: Arash Deshmeh <[email protected]>
adshmh added a commit to adshmh/pipeline that referenced this issue Apr 13, 2020
A PullRequest type pipeline resource is now validated: an unrecognised
'fieldName' in secrets will trigger an error. Part of work on tektoncd#1818

As stated in tektoncd#1818, this will help improve the debuggability of the
PullRequst pipeline resource, as the validatiob will cause a failure in
response to invalid input as early as possible.

Signed-off-by: Arash Deshmeh <[email protected]>
tekton-robot pushed a commit that referenced this issue Apr 14, 2020
A PullRequest type pipeline resource is now validated: an unrecognised
'fieldName' in secrets will trigger an error. Part of work on #1818

As stated in #1818, this will help improve the debuggability of the
PullRequst pipeline resource, as the validatiob will cause a failure in
response to invalid input as early as possible.

Signed-off-by: Arash Deshmeh <[email protected]>
adshmh added a commit to adshmh/pipeline that referenced this issue Apr 14, 2020
The pullrequest pipeline resource now verifies the statuses before
uploading them. As specified in tektoncd#1818, this is to improve the
debuggability of pullrequest resources, by preventing a silent failure
e.g. if there has been a change in the fields' names of a status object.

Signed-off-by: Arash Deshmeh <[email protected]>
tekton-robot pushed a commit that referenced this issue Apr 15, 2020
The pullrequest pipeline resource now verifies the statuses before
uploading them. As specified in #1818, this is to improve the
debuggability of pullrequest resources, by preventing a silent failure
e.g. if there has been a change in the fields' names of a status object.

Signed-off-by: Arash Deshmeh <[email protected]>
@adshmh
Copy link
Contributor

adshmh commented Apr 20, 2020

@bobcatfish if there are other validations that would be helpful, I can submit a PR. So far, the secrets field and the uploaded status are covered.

@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
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
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 tekton-robot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. 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
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 tekton-robot reopened this Aug 17, 2020
@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 removed 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. labels 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
@bobcatfish
Copy link
Collaborator Author

I think it's reasonable to close this for now, esp. since the future of this pipeline resource is uncertain. I think we'll be supporting this logic somewhere regardless of whether it's part of a pipelineresource or not but i think it's fine to close this for now.

@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/feature Categorizes issue or PR as related to a new feature. 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