-
Notifications
You must be signed in to change notification settings - Fork 327
feature: RunTrigger gRPC endpoint for Waypoint Server #2840
Conversation
log.Debug("variable overrides have been requested for trigger job") | ||
for i, v := range req.VariableOverrides { | ||
switch vType := v.Source.(type) { | ||
case *pb.Variable_Cli: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krantzinator suggested maybe we could introduce a RunTrigger
source type here too. Although the CLI type does exactly what we want here, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far! I had a few nit-picks and some questions about the copy. Probably no blockers but wanted to ask first
67b965b
to
2f0aa02
Compare
Quick comment -- can we make the error message for a missing op type a bit more informative?
|
These cases should all have
|
Bug: |
@krantzinator - thanks for the feedback!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a note on trigger-specific variables? I want to test it but it's not covered in the docs :)
Co-authored-by: Rae Krantz <8461333+krantzinator@users.noreply.github.com>
10e919c
to
8c8c6e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have more testing I want to do when HTTP hits, but this looks good!
Thank you all who took the time to review and test! Super helpful, appreciate you all ❤️ 🙏🏻 |
When this is available for HTTP I'd love to try to configure Docker webhooks to use this (to kick off my docker-pull builds)! |
Hey there @paladin-devops - soooon! I hope to have a draft PR up this week 😄 Once it's up, it'll likely go out in the next minor Waypoint release. I can give you a ping if you're interested in checking it out in the PR form. |
@briancain I spotted your PR, built it locally and it worked like a charm! Working on using something like Smee or Ultrahook to proxy the DockerHub webhook to Waypoint in a private network. |
Awesome @paladin-devops !! That's great to hear. Appreciate you trying that PR early. Very pleased to hear it worked like a charm 😄 |
This pull request introduces the service level function
RunTrigger
which will queue a job based on an existing stored trigger URL configuration using the ID requested. It also optionally allows for any configuration variable overrides on the request.I kept the targeted runner to Any until that work is finished. It will be easier once the targeted config is available based on the project and application.
The next step after this is to work on the HTTP handler. It should register a trigger URL id as a valid route, and if a request to that endpoint is called it will take a run trigger request with a registered trigger URL id and call this grpc func (similar to how the HTTP exec works) to queue the job request and optionally stream back the job outputs to the requester.
I tested this endpoint using the
waypoint-grpc
helper tool in contrib: https://github.com/hashicorp/waypoint/tree/main/contrib/waypoint-grpc