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

Adds a server for serving core interceptors. #858

Merged
merged 3 commits into from
Dec 10, 2020

Conversation

dibyom
Copy link
Member

@dibyom dibyom commented Dec 7, 2020

Changes

There are two commits:

  • interceptors: small changes to types
  1. Change body from []byte to json.RawMessage
  2. Remove omitempty tag for boolean type so that it marshals when false
  3. Change context.url to context.event_url to match struct type
  • Add a HTTP handler for serving core interceptors

This commit packages the 4 core interceptors into a single HTTP server.
Each interceptor is available at a different path e.g. /cel for CEL etc.

This does not wire up the implementation of the server into the
EventListener which will be done in a future commit.

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

NONE

/kind feature

@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 7, 2020
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 7, 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/apis/triggers/v1alpha1/interceptor_types.go 100.0% 66.7% -33.3
pkg/interceptors/cel/cel.go 89.3% 88.1% -1.2
pkg/interceptors/interceptors.go 91.8% 90.0% -1.8
pkg/interceptors/server/server.go Do not exist 80.6%

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 7, 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/cel/cel.go 89.3% 88.1% -1.2

@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/cel/cel.go 89.3% 88.1% -1.2
pkg/interceptors/server/server.go Do not exist 80.6%

@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/cel/cel.go 89.3% 88.1% -1.2
pkg/interceptors/server/server.go Do not exist 80.6%

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 8, 2020
@dibyom dibyom changed the title WIP: Adds a server for serving core interceptors. Adds a server for serving core interceptors. Dec 8, 2020
@dibyom dibyom marked this pull request as ready for review December 8, 2020 03:19
@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 8, 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/cel/cel.go 89.3% 88.1% -1.2
pkg/interceptors/server/server.go Do not exist 82.9%

pkg/interceptors/server/server.go Outdated Show resolved Hide resolved
pkg/interceptors/server/server.go Show resolved Hide resolved
pkg/interceptors/server/server.go Show resolved Hide resolved
pkg/interceptors/server/server.go Outdated Show resolved Hide resolved
pkg/apis/triggers/v1alpha1/interceptor_types.go Outdated Show resolved Hide resolved
pkg/interceptors/cel/cel.go Outdated Show resolved Hide resolved
pkg/interceptors/server/server.go Outdated 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/cel/cel.go 89.3% 88.1% -1.2
pkg/interceptors/server/server.go Do not exist 82.9%
pkg/sink/sink.go 78.7% 71.5% -7.2

@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/cel/cel.go 89.3% 88.1% -1.2
pkg/interceptors/server/server.go Do not exist 82.9%
pkg/sink/sink.go 78.7% 78.5% -0.3

@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/bitbucket/bitbucket.go 88.9% 92.3% 3.4
pkg/interceptors/cel/cel.go 89.3% 89.2% -0.1
pkg/interceptors/github/github.go 89.7% 92.9% 3.2
pkg/interceptors/gitlab/gitlab.go 88.9% 92.3% 3.4
pkg/interceptors/server/server.go Do not exist 82.9%
pkg/sink/sink.go 78.7% 78.5% -0.3

@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/bitbucket/bitbucket.go 88.9% 92.3% 3.4
pkg/interceptors/cel/cel.go 89.3% 89.2% -0.1
pkg/interceptors/github/github.go 89.7% 92.9% 3.2
pkg/interceptors/gitlab/gitlab.go 88.9% 92.3% 3.4
pkg/interceptors/server/server.go Do not exist 82.9%
pkg/sink/sink.go 78.7% 78.5% -0.3

@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/bitbucket/bitbucket.go 88.9% 92.3% 3.4
pkg/interceptors/cel/cel.go 89.3% 89.2% -0.1
pkg/interceptors/github/github.go 89.7% 92.9% 3.2
pkg/interceptors/gitlab/gitlab.go 88.9% 92.3% 3.4
pkg/sink/sink.go 78.7% 78.5% -0.3

@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/bitbucket/bitbucket.go 88.9% 92.3% 3.4
pkg/interceptors/cel/cel.go 89.3% 89.2% -0.1
pkg/interceptors/github/github.go 89.7% 92.9% 3.2
pkg/interceptors/gitlab/gitlab.go 88.9% 92.3% 3.4
pkg/interceptors/server/server.go Do not exist 81.6%
pkg/sink/sink.go 78.7% 78.5% -0.3

@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/bitbucket/bitbucket.go 88.9% 92.3% 3.4
pkg/interceptors/cel/cel.go 89.3% 89.2% -0.1
pkg/interceptors/github/github.go 89.7% 92.9% 3.2
pkg/interceptors/gitlab/gitlab.go 88.9% 92.3% 3.4
pkg/interceptors/server/server.go Do not exist 81.6%
pkg/sink/sink.go 78.7% 78.5% -0.3

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 10, 2020
1. Change body from []byte to json.RawMessage
2. Remove omitempty tag for boolean type so that it marshals when false
3. Change context.url to context.event_url to match struct type

Part of tektoncd#271

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
This commit packages the 4 core interceptors into a single HTTP server.
Each interceptor is available at a different path e.g. /cel for CEL etc.

This does not wire up the implementation of the server into the
EventListener which will be done in a future commit.

Part of tektoncd#271

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 10, 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/bitbucket/bitbucket.go 88.9% 92.3% 3.4
pkg/interceptors/cel/cel.go 89.3% 89.2% -0.1
pkg/interceptors/github/github.go 89.7% 92.9% 3.2
pkg/interceptors/gitlab/gitlab.go 88.9% 92.3% 3.4
pkg/interceptors/server/server.go Do not exist 81.6%
pkg/sink/sink.go 78.3% 78.1% -0.2

Since webhook is still using the old interface, check for it before processing
others.

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
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 Dec 10, 2020
@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 Dec 10, 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/bitbucket/bitbucket.go 88.9% 92.3% 3.4
pkg/interceptors/cel/cel.go 89.3% 89.2% -0.1
pkg/interceptors/github/github.go 89.7% 92.9% 3.2
pkg/interceptors/gitlab/gitlab.go 88.9% 92.3% 3.4
pkg/interceptors/server/server.go Do not exist 81.6%
pkg/sink/sink.go 78.3% 78.1% -0.2

@tekton-robot tekton-robot merged commit 4f44260 into tektoncd:master Dec 10, 2020
@dibyom dibyom deleted the http branch December 28, 2020 18:02
@dibyom dibyom restored the http branch December 28, 2020 18:02
@dibyom dibyom deleted the http branch December 28, 2020 18:02
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/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.

3 participants