Add webhook support for GitHub topic updates. This can be specified in the scmProvider generator but cannot receive updates via webhook notifications.
Motivation
Being able to add/remove apps based on topic is very useful but updates are often slow. Sure we could increase polling frequency but it'd be even more lightweight to add support for repository events!
Proposal
Here's an example ApplicationSet that uses a labelMatch filter.
The associated github app sends repository events (specific created and updated actions) when repository topics change (I'm using label and topic interchangeably here). In the github app configuration the event is called repository:
Here's a sample event when I add or remove a topic from a repo (shortened for brevity):
{
"event": "repository",
"payload": {
"action": "created|edited",
"changes": {
"topics": {
"from": []
}
},
"repository": {
"topics": [] /* this is what we care about */
},
"organization": {},
"sender": {},
"installation": {}
}
}
And the logs from the applicationset controller show that the event is unsupported:
argocd-applicationset-controller-*** time="2024-08-26T23:27:08Z" level=info msg="Webhook processing failed: event not defined to be parsed"
Summary
Add webhook support for GitHub topic updates. This can be specified in the
scmProvider
generator but cannot receive updates via webhook notifications.Motivation
Being able to add/remove apps based on topic is very useful but updates are often slow. Sure we could increase polling frequency but it'd be even more lightweight to add support for
repository
events!Proposal
Here's an example
ApplicationSet
that uses alabelMatch
filter.The associated github app sends
repository
events (specificcreated
andupdated
actions) when repository topics change (I'm usinglabel
andtopic
interchangeably here). In the github app configuration the event is calledrepository
:Here's a sample event when I add or remove a topic from a repo (shortened for brevity):
And the logs from the applicationset controller show that the event is unsupported:
Adding support for this event looks like it could go here: https://github.com/argoproj/argo-cd/blob/master/applicationset/webhook/webhook.go#L164C3-L164C10
More info about the
repository
object (we only care aboutedited
andcreated
actions):