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

Add event API v2 server handler #5622

Merged
merged 7 commits into from
Apr 2, 2021

Conversation

MarlonGamez
Copy link
Contributor

@MarlonGamez MarlonGamez commented Apr 1, 2021

Related: #5422 , #5368

Description
Adds pkg/skaffold/server/v2 package which contains a new struct that handles the endpoints for the v2 API. Users will now be able to hit both the v1 and v2 endpoints through the running gRPC server.

Most of the server definition is copied from pkg/skaffold/server files, and the functions added to pkg/skaffold/event/v2/event.go are straight from pkg/skaffold/event/event.go

Follow-up Work (remove if N/A)
Emit protos on this server

@MarlonGamez MarlonGamez requested a review from a team as a code owner April 1, 2021 17:45
@google-cla google-cla bot added the cla: yes label Apr 1, 2021
@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #5622 (c5eadb3) into master (189a03b) will decrease coverage by 0.11%.
The diff coverage is 53.40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5622      +/-   ##
==========================================
- Coverage   70.79%   70.68%   -0.12%     
==========================================
  Files         406      407       +1     
  Lines       15461    15554      +93     
==========================================
+ Hits        10946    10994      +48     
- Misses       3711     3752      +41     
- Partials      804      808       +4     
Impacted Files Coverage Δ
pkg/skaffold/server/server.go 41.96% <27.27%> (-1.61%) ⬇️
pkg/skaffold/server/v2/endpoints.go 43.24% <43.24%> (ø)
pkg/skaffold/event/v2/event.go 59.34% <70.00%> (+3.00%) ⬆️
cmd/skaffold/app/cmd/run.go 71.42% <0.00%> (-16.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 189a03b...c5eadb3. Read the comment docs.

@MarlonGamez
Copy link
Contributor Author

Still need to add tests, but putting this up here in case anyone wants to take a look :)

@@ -190,6 +241,19 @@ func emptyStatusCheckState() *proto.StatusCheckState {
}
}

func AutoTriggerDiff(name string, val bool) (bool, error) {
switch name {
case "build":
Copy link
Contributor

Choose a reason for hiding this comment

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

we could reuse pkg/errors.Phase type and add sync to it?

Copy link
Contributor Author

@MarlonGamez MarlonGamez Apr 2, 2021

Choose a reason for hiding this comment

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

Good point! I'll update this in a follow up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MarlonGamez MarlonGamez merged commit 25ec081 into GoogleContainerTools:master Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants