Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Conversation

@andrew-hashicorp
Copy link
Contributor

This PR adds a UI_GetDeployment endpoint for use on the front end as proposed in this RFC. These UI convenience methods return a DeploymentBundle, which contains a deployment with its associated artifact, build, deployUrl, jobDataSourceRef, and latestStatusReport.

This PR also moves the code responsible for creating a DeploymentBundle out of UI_ListDeployments into a utility method, getDeploymentBundle that is then shared by both UI_GetDeployment and UI_ListDeployments.

To run relevant tests:

go test -test.v ./pkg/server/singleprocess -count=1 -run TestHandlers/ui_deploy/TestServiceUI_Deployment_GetDeployment
go test -test.v ./pkg/server/singleprocess -count=1 -run TestHandlers/ui_deploy/TestServiceUI_Deployment_ListDeployments

To test on your local server:

grpcurl -insecure -H "client-api-protocol: 1,1" -H "authorization: YOUR_AUTH_TOKEN" -d '{"ref": { "id": "A_DEPLOYMENT_ID" } }' 127.0.0.1:9701 hashicorp.waypoint.Waypoint.GetDeployment

To get your auth token:

waypoint context inspect -json YOUR_LOCAL_WAYPOINT_CONTEXT_NAME

To get your deployments, so you can get a deployment ID:

grpcurl -insecure -H "client-api-protocol: 1,1" -H "authorization: YOUR_AUTH_TOKEN" -d '{"application": { "application": "YOUR_APPLICATION_NAME", "project": "YOUR_PROJECT_NAME" } }' 127.0.0.1:9701 hashicorp.waypoint.Waypoint.ListDeployments

Copy link
Contributor

@izaaklauer izaaklauer left a comment

Choose a reason for hiding this comment

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

Great work on this! One quibble with a log message, but the functionality looks spot-on.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants