Open briancain opened 2 years ago
Totally support this, let's add references along side where there are the full values, with the reader code supporting both refs and full values. That gives us a smooth upgrade path, then we can drop the full values in a release or two.
Just a future note to self: There are a handful of other Job operations that have the same issue that can benefit from the same solution! Like the status report operations, pushed artifact ops, etc. Keep an eye on the other operations when implementing this fix so they all get the same resolution.
Is your feature request related to a problem? Please describe.
The
Job_DeployOp
operation requires the fullpb.PushedArtifact
message to be set to properly queue and execute a Deployment job. This is not ideal when you are trying to queue a job and already have all of the references you'd need (i.e. the workspace/project/app refs and artifact sequence ID or just wanting to deploy latest). Additionally, if you specify your ownpb.PushedArtifact
that only includes some of the attributes on that message, the Deployment operation fails in an odd way where the Deployment some how gets Upserted without an ID (this is probably a separate bug).Describe the solution you'd like
Ideally, this operation should take an Artifact reference like how our other operations take references to workspaces or projects, etc. So one could queue a Deployment operation with a
pb.Ref_Artifact
.We could also make it a
oneof
Target so you could easily specify you want the latest build artifact without needing to query for it from the database.Then in our execute deployment operation, we can take the artifact reference and look up which one we should use based on the ref supplied.
This now means the caller/requester queueing a Deployment operation no longer needs to supply the full Artifact message, and can just supply a Ref similar to other operations.
Describe alternatives you've considered
Nothing really 😅
Explain any additional use-cases
I could see this being important as we add more ways to queue jobs with Waypoint beyond the CLI and Triggers.