-
Notifications
You must be signed in to change notification settings - Fork 120
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
Expose created revision name as an output #556
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
A question I have for you @sethvargo, to make sure of the intended behavior of this PR, is if the |
Good point. Does the JSON output include both (deployed revision name and latest revision name)? If so, we may want to include both and use those names explicitly (deployedRevisionName, latestRevisionName). |
@sethvargo Unfortunately it doesn't seem like this attribute exists... Here's a slightly-obfuscated real JSON response from the {
"@type": "type.googleapis.com/google.cloud.run.v1.Service",
"apiVersion": "serving.knative.dev/v1",
"kind": "Service",
"metadata": {
"annotations": {
"run.googleapis.com/client-name": "gcloud",
"run.googleapis.com/client-version": "504.0.1",
"run.googleapis.com/ingress": "all",
"run.googleapis.com/ingress-status": "all",
"run.googleapis.com/operation-id": "eb748c25-744e-481e-bce8-0ed4c530d02f",
"run.googleapis.com/urls": "[\"https://servicename-api-qa-463128594741.us-central1.run.app\",\"https://servicename-api-qa-rri5nwu7ya-uc.a.run.app\"]",
"serving.knative.dev/creator": "[email protected]",
"serving.knative.dev/lastModifier": "[email protected]"
},
"creationTimestamp": "2024-11-23T07:41:36.186310Z",
"generation": 233,
"labels": {
"cloud.googleapis.com/location": "us-central1",
"commit-sha": "1c3a3aa06e4b5538684316c38d552da33e6525fc",
"managed-by": "github-actions"
},
"name": "servicename-api-qa",
"namespace": "463128594741",
"resourceVersion": "AAYrsUpyFa4",
"selfLink": "/apis/serving.knative.dev/v1/namespaces/463128594741/services/servicename-api-qa",
"uid": "e8acfec6-27fe-4868-9482-a9fe445d70db"
},
"spec": {
"template": {
"metadata": {
"annotations": {
"autoscaling.knative.dev/maxScale": "100",
"autoscaling.knative.dev/minScale": "4",
"run.googleapis.com/client-name": "gcloud",
"run.googleapis.com/client-version": "504.0.1",
"run.googleapis.com/startup-cpu-boost": "true"
},
"labels": {
"client.knative.dev/nonce": "mzmyjcniof",
"commit-sha": "1c3a3aa06e4b5538684316c38d552da33e6525fc",
"managed-by": "github-actions",
"run.googleapis.com/startupProbeType": "Default"
}
},
"spec": {
"containerConcurrency": 80,
"containers": [
{
"image": "gcr.io/real-intent/servicename-api-qa",
"ports": [
{
"containerPort": 8080,
"name": "http1"
}
],
"resources": {
"limits": {
"cpu": "4",
"memory": "16Gi"
}
},
"startupProbe": {
"failureThreshold": 1,
"periodSeconds": 240,
"tcpSocket": {
"port": 8080
},
"timeoutSeconds": 240
}
}
],
"serviceAccountName": "[email protected]",
"timeoutSeconds": 300
}
},
"traffic": [
{
"latestRevision": true,
"percent": 100
},
{
"revisionName": "servicename-api-qa-00001-ned",
"tag": "pr-preview-12"
},
{
"revisionName": "servicename-api-qa-00225-pam",
"tag": "pr-preview-123"
},
{
"revisionName": "servicename-api-qa-00231-buf",
"tag": "pr-preview-124"
}
]
},
"status": {
"address": {
"url": "https://servicename-api-qa-rri5nwu7ya-uc.a.run.app"
},
"conditions": [
{
"lastTransitionTime": "2025-01-14T21:31:58.460334Z",
"status": "True",
"type": "Ready"
},
{
"lastTransitionTime": "2025-01-14T21:31:57.358992Z",
"status": "True",
"type": "ConfigurationsReady"
},
{
"lastTransitionTime": "2025-01-14T21:31:58.423853Z",
"status": "True",
"type": "RoutesReady"
}
],
"latestCreatedRevisionName": "servicename-api-qa-00233-rrh",
"latestReadyRevisionName": "servicename-api-qa-00233-rrh",
"observedGeneration": 233,
"traffic": [
{
"revisionName": "servicename-api-qa-00001-ned",
"tag": "pr-preview-12",
"url": "https://pr-preview-12---servicename-api-qa-rri5nwu7ya-uc.a.run.app"
},
{
"revisionName": "servicename-api-qa-00002-bug",
"tag": "pr-preview-13",
"url": "https://pr-preview-13---servicename-api-qa-rri5nwu7ya-uc.a.run.app"
},
{
"revisionName": "servicename-api-qa-00003-koj",
"tag": "pr-preview-14",
"url": "https://pr-preview-14---servicename-api-qa-rri5nwu7ya-uc.a.run.app"
},
{
"revisionName": "servicename-api-qa-00006-tov",
"tag": "pr-preview-15",
"url": "https://pr-preview-15---servicename-api-qa-rri5nwu7ya-uc.a.run.app"
},
{
"latestRevision": true,
"percent": 100,
"revisionName": "servicename-api-qa-00233-rrh"
}
],
"url": "https://servicename-api-qa-rri5nwu7ya-uc.a.run.app"
}
} I'm wondering now if the intended purpose of this PR is even achievable... |
We could definitely expose |
@sethvargo I guess the question is less of whether they're serving traffic and more of whether it's deterministically equivalent to the revision that was created due to that specific triggered |
Hey @preritdas - I'm genuinely not sure. Can you describe more about what you're trying to do. I can try and ask someone on the cloud run team |
@sethvargo That would be great. Right now, I have a GitHub action that deploys to Cloud Run on pushes to a branch and to a pull request (with a tag and using The simple solution to my specific scenario is creating a new service specifically for deployment previews. So I don't bring this up to say that anything is broken. That said, such a setup outlines the need for the Cloud Run deployment action, more specifically, the |
Closes #555.
Adds an output attribute to the action,
revision
, which is thelatestCreatedRevisionName
.This will allow subsequent action steps to allocate traffic/run any checks on the new revision specifically.