GoogleCloudPlatform / cloud-run-release-manager

[EXPERIMENTAL] Automated canary rollout tool for Cloud Run services.
Apache License 2.0
128 stars 10 forks source link

Publish to Pub/Sub after a rollout/rollback have occurred #75

Open gvso opened 4 years ago

gvso commented 4 years ago

In order to allow other functionality around the Release Manager, we need to provide a way to subscribe to events. This will allow things like smoke tests and notification features. The following format could be useful:

{
    "event": "rollout", // or "rollback"
    "candidateRevisionName": "hello-002-abc",
    "candidateRevisionPercent": 50,
    "candidateRevisionURL": "https://candidate---hello-wh32u62c4l-ue.a.run.app",
    "candidateWasPromotedToStable": false,
    "service": {json}
}
ahmetb commented 4 years ago

@steren wdyt of the event format above? We want to optionally do:

 --notify-pubsub=projects/x/topics/y

and let users push rollout and rollback notifications for them to be able to run smoke tests (or do other things like ChatOps). Is the information above sufficient for those cases?

steren commented 4 years ago

Seems like a good idea. Trying to build something real with these is the best way to see if the event contains the info you would need.

gvso commented 4 years ago

@ahmetb Why do we need to pass the project as part of the flag? We could use the project ID we already autodetect (or asked for with -project)?

ahmetb commented 4 years ago

It's possible to push to topics in another project and it's a common use case.