You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similarly to Cron Support; there are events from other services (e.g. Kokoro) whose job completion may trigger the invocation of a bot.
Proposed changes:
Bots
A bot that wants to subscribe to PubSub triggers needs to include a topic file in their source folder
A bot that wishes to subscribe to PubSub triggers needs to subscribe to the topic.repository event in the appFn:
app.on('topic.repository',asynccontext=>{});
Infrastructure
The build process will inspect all bots && if a bot has a topic file and no corresponding PubSub topic it will
Create a PubSub topic whose name is the bot name
Create a Push Subscription for the topic and point it at the Cloud Run serverless-scheduler-proxy instance. NOTE: This will use a custom ServiceAccount that has permissions to invoke the CloudRun instance.
serverless-scheduler-proxy
Move the cron processing endpoint to /cron (was /)
Add a new endpoint /pubsub which handles incoming PubSub push messages of form:
// PubSubMessage is the payload of a Pub/Sub event.typePubSubMessagestruct {
Messagestruct {
Data []byte`json:"data,omitempty"`IDstring`json:"id"`
} `json:"message"`Subscriptionstring`json:"subscription"`
}
This handler parses the name of the bot from the Subscription field, and creates a new HTTP request to the bot/Cloud Function whose name is in the subscription. This request will be signed using the signing key of the bot in the x-hub-signature header, and the x-github-event header will be topic.repository
The text was updated successfully, but these errors were encountered:
Similarly to Cron Support; there are events from other services (e.g. Kokoro) whose job completion may trigger the invocation of a bot.
Proposed changes:
Bots
topic
file in their source foldertopic.repository
event in the appFn:Infrastructure
topic
file and no corresponding PubSub topic it willserverless-scheduler-proxy
instance. NOTE: This will use a custom ServiceAccount that has permissions to invoke the CloudRun instance.serverless-scheduler-proxy
/cron
(was/
)/pubsub
which handles incoming PubSub push messages of form:Subscription
field, and creates a new HTTP request to the bot/Cloud Function whose name is in the subscription. This request will be signed using the signing key of the bot in thex-hub-signature
header, and thex-github-event
header will betopic.repository
The text was updated successfully, but these errors were encountered: