GoogleCloudPlatform/emblem

Switch Cloud Run deployed revision prefix to build ID

grayside opened this issue · 0 comments

Proposal

Currently, the deploy.cloudbuild.yaml uses the Pub/Sub messageId as the revision prefix. However, this messageId is not generally useful to look up details about the process separate from acking the message in the event of a retry loop. We should definitely log it as part of the build if Cloud Build doesn't do that for us.

However, what we don't have right now is provenance from the Cloud Run revision to the build that ran the deployment. The build context for the container image is available to Cloud Run, but since we have a split build & deploy process, we don't have a direct connection to the deploy build and it's logs.

It would be great if the revision where either:

  • Based on the Build ID
  • Based on the Git Commit hash and that this hash is usable to look up all related builds in the Cloud Build history.

Part of why we aren't using Build ID is the potential for revision name character limits not being large enough to encompass a UUID. The allowed revision length has changed multiple times in the past, we should verify current state.

Problems this will solve

  • Improve completeness of build & deploy provenance from a Cloud Run perspective.
  • Facilitate easier collection of complete set of logs associated with shipping a single change