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

Update status code handling #1077

Closed

Conversation

jmcshane
Copy link
Contributor

@jmcshane jmcshane commented May 7, 2021

Changes

Closes #931

Removes status code handling in HTTP requests for triggers. Replacing with waitgroup that counts current number of triggers that are being processed by the Sink.

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.

Release Notes

Remove status code processing for EventListener HTTP request

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 7, 2021
@tekton-robot tekton-robot requested a review from ncskier May 7, 2021 03:27
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign dlorenc
You can assign the PR to them by writing /assign @dlorenc in a comment when ready.

The full list of commands accepted by this bot can be found 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 requested a review from vtereso May 7, 2021 03:27
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 7, 2021
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/sink/sink.go 79.2% 74.3% -4.8

@jmcshane
Copy link
Contributor Author

jmcshane commented May 7, 2021

considering the amount of deleted code...that's not terrible for a delta of coverage.

i'll see what is missing now.

@jmcshane jmcshane force-pushed the feature/update-status-code-handling branch from 424db8b to 0d9d86e Compare May 7, 2021 03:36
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/sink/sink.go 79.2% 74.2% -5.0

@jmcshane jmcshane force-pushed the feature/update-status-code-handling branch from 0d9d86e to e062e07 Compare May 7, 2021 19:18
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/sink/sink.go 79.2% 74.2% -5.0

In the current version of the product, the HTTP request to the EventListener
endpoint waits for all triggers to process to determine if a resource was
created. This is not in line with the suggestion by the source control
systems for webhook endpoints. This change updates the endpoint to respond
as soon as the triggers have been selected for processing.
@jmcshane jmcshane force-pushed the feature/update-status-code-handling branch from e062e07 to 490b897 Compare May 7, 2021 19:33
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/sink/sink.go 79.2% 74.2% -5.0

@jmcshane
Copy link
Contributor Author

jmcshane commented May 7, 2021

/test pull-tekton-triggers-integration-tests

@dibyom
Copy link
Member

dibyom commented May 7, 2021

Since this is a breaking change, should we announce it and give users more of a heads up before releasing it?

@jmcshane
Copy link
Contributor Author

jmcshane commented May 8, 2021

Since this is a breaking change, should we announce it and give users more of a heads up before releasing it?

Yeah, im not sure how those announcements are normally done. We can discuss in WG next week, or potentially API working group to talk about how these types of behavior updates should be managed between the maintainers and the end user community.

We saw a similar thing happen with the install for interceptors for v0.13 and there were a few people that popped in the Slack to discuss the change. I think the best course of action will be to have a note about the change in behavior in the release notes and potentially have some more thorough documentation in the eventlistener doc about status code behavior.

@dibyom
Copy link
Member

dibyom commented May 11, 2021

Yeah, im not sure how those announcements are normally done. We can discuss in WG next week, or potentially API working group to talk about how these types of behavior updates should be managed between the maintainers and the end user community.

So, the channels we have are

  1. Slack (we can put this in #triggers, and #general)
  2. The WGs (I'll add this to the Triggers section for the Wednesday WG in addition to the API WG)
  3. The tekton-dev mailing list -- we've used this the least but probably worth sending an email here?

We saw a similar thing happen with the install for interceptors for v0.13 and there were a few people that popped in the Slack to discuss the change.

Yeah I expect some questions on Slack despite announcements. In hindsight, I should have announced the interceptors release yaml changes more widely.

@tekton-robot
Copy link

@jmcshane: PR needs rebase.

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 added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 12, 2021
Copy link
Contributor

@gabemontero gabemontero left a comment

Choose a reason for hiding this comment

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

Sorry for the delay was out of the office for a few days

pkg/sink/sink_test.go Show resolved Hide resolved
localRequest := request.Clone(request.Context())
if err := r.processTrigger(t, localRequest, event, eventID, eventLog); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

So yeah it still fails. The user presumably learns of it from some other means. Full disclosure, I did not research how that might now be or not be achieved.

If there is an easy enough reader's digest explanation @jmcshane @dibyom please elaborate. Or if a pointer to what I have to read to understand makes more sense, that works too.

thanks

Copy link
Member

Choose a reason for hiding this comment

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

I think the diff for the docs/eventlisteners.md page shows the change: https://github.com/tektoncd/triggers/pull/1077/files#diff-7da54b4f5484ec784351290e106d6aebea551a17046b6116cc8e65964ebb693f

i.e instead of waiting for a resource to be created and then responding with a 201 status code, Triggers will now return a 202 response earlier (i.e. when it has selected the triggers to process -- it will no longer wait for the trigger processing to complete)

Copy link
Contributor

Choose a reason for hiding this comment

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

OK so yeah that markdown, assuming basic HTTP rc knowledge, makes it clear that the processing here is now asynchronous vs. synchronous.

With all the scalability advantages, etc. obtained with that shift.

In theory then the poster of the event then needs to know what was triggered by the event and then query those artifacts directly for status.

Quick code scan / memory refresh and I see the /triggers-eventid label set on the objects created (which we have had for a while) facilitates that query.

Would a cross reference to https://github.com/tektoncd/triggers/blob/4b9aa3157f3989255f350c8c60c2b6aecab38783/docs/triggertemplates.md#structure-of-a-triggertemplate somewhere and its explanation of the label near https://github.com/tektoncd/triggers/pull/1077/files#diff-7da54b4f5484ec784351290e106d6aebea551a17046b6116cc8e65964ebb693f be a useful change in your opinion @dibyom ?

Other than that potential tweak, I'm good. Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

Ok yeah, I think adding a couple of lines or (maybe link to a different section) with the information on querying makes sense.

@dibyom
Copy link
Member

dibyom commented Jun 24, 2021

Closing -- This commit has been migrated to #1132

@dibyom
Copy link
Member

dibyom commented Jun 24, 2021

/close

@tekton-robot
Copy link

@dibyom: Closed this PR.

In response to this:

/close

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
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP Response StatusCodes from EventListener
4 participants