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

Move core interceptors to their own server #878

Merged
merged 3 commits into from
Jan 7, 2021

Conversation

dibyom
Copy link
Member

@dibyom dibyom commented Dec 23, 2020

Changes

The EventListener will forward events over HTTP to the interceptor. Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes #867

Depends on #877

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

Core interceptors now run in their own server that is deployed in the tekton-pipelines namespace.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Dec 23, 2020
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 23, 2020
@dibyom dibyom added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 23, 2020
@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/interceptors/interceptors.go 90.0% 58.4% -31.6
pkg/sink/sink.go 78.1% 78.5% 0.5

@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/interceptors/interceptors.go 90.0% 58.4% -31.6
pkg/sink/sink.go 78.1% 78.5% 0.5

@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/interceptors/interceptors.go 90.0% 58.4% -31.6
pkg/sink/sink.go 78.1% 78.5% 0.5

@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/interceptors/interceptors.go 90.0% 92.2% 2.2
pkg/sink/sink.go 78.1% 78.5% 0.5

@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/interceptors/interceptors.go 90.0% 92.2% 2.2
pkg/sink/sink.go 78.1% 78.5% 0.5

@dibyom dibyom marked this pull request as ready for review December 30, 2020 17:37
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 30, 2020
@dibyom dibyom mentioned this pull request Dec 30, 2020
4 tasks
The EventListener will forward events over HTTP to the interceptor.  Each core
interceptor is available at a different path e.g. /cel for CEL.

Fixes tektoncd#867

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
@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/interceptors/interceptors.go 90.0% 92.2% 2.2
pkg/sink/sink.go 78.1% 78.5% 0.5

@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/interceptors/interceptors.go 90.0% 92.2% 2.2
pkg/sink/sink.go 78.1% 78.5% 0.5

@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/interceptors/interceptors.go 90.0% 92.2% 2.2
pkg/sink/sink.go 78.1% 78.5% 0.5

// Interceptor is the interface that all interceptors implement.
type Interceptor interface {
ExecuteTrigger(req *http.Request) (*http.Response, error)
}

type key string

const requestCacheKey key = "interceptors.RequestCache"
const RequestCacheKey key = "interceptors.RequestCache"
Copy link
Member Author

@dibyom dibyom Dec 30, 2020

Choose a reason for hiding this comment

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

this cache isn't really being used. I'll replace it with a lister/informer for secrets in a followup. (only need to export it for one test that is using it).

Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

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

looks good! few minor comments.

cmd/interceptors/main.go Outdated Show resolved Hide resolved
pkg/interceptors/interceptors_test.go Show resolved Hide resolved
pkg/interceptors/interceptors.go Outdated Show resolved Hide resolved
pkg/sink/sink_test.go Outdated Show resolved Hide resolved
pkg/sink/sink_test.go Outdated Show resolved Hide resolved
test/init_test.go Show resolved Hide resolved
@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/interceptors/interceptors.go 90.0% 92.2% 2.2
pkg/sink/sink.go 78.1% 78.5% 0.5

1. Log CRDs as JSON so that we can print out the resource templates
   instead of a raw byte array
2. Capture and dump logs for core interceptor pod
3. Fix EL logs - they were using the wrong label to query
@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/interceptors/interceptors.go 90.0% 92.2% 2.2
pkg/sink/sink.go 78.1% 78.1% 0.1

@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/interceptors/interceptors.go 90.0% 92.1% 2.1
pkg/sink/sink.go 78.1% 78.4% 0.3

@dibyom dibyom requested a review from wlynch January 7, 2021 15:59
Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 7, 2021
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wlynch

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 Jan 7, 2021
@tekton-robot tekton-robot merged commit 4973464 into tektoncd:master Jan 7, 2021
@dibyom dibyom deleted the http_main branch January 7, 2021 19:43
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interceptors: Migrate CEL and source control interceptors to a separate server
3 participants