Repository navigation
Description
Feature Request
What challenge are you facing?
We have one single GitHub repository that includes many different conceptual resources. For example, n directories, one for each application we release. We use source.paths to generate versions for the resources only when the folder representing the contents of the resource has changed. This results in n checks every check_interval, which puts a lot of strain on our workers.
We want to use webhook_tokens to reduce strain (and setting check_interval to a very high number), but each resource has its own webhook URL, which means we must create a GitHub webhook for each resource. Not only is this an operational burden, but GitHub has a limit of 20 webhooks for a single repository (see docs), preventing us from using this solution as our number of resources grows.
A Modest Proposal
I would like to be able to define a single webhook URL that can trigger all n resources. This would still result in n checks on every push, but would greatly reduce the total number of checks that are run. Some YAML like this would be good:
resources:
- name: app-one
type: git
source:
uri: [email protected]:org/repo.git
branch: master
paths: [app_one]
webhook:
name: MY_WEBHOOK
token: WEBHOOK_TOKEN
- name: app-two
type: git
source:
uri: [email protected]:org/repo.git
branch: master
paths: [app_two]
webhook:
name: MY_WEBHOOK
token: WEBHOOK_TOKEN
Which would allow me to configure GitHub with a webhook path of https://my-concourse.example.com/api/v1/teams/TEAM_NAME/pipelines/PIPELINE_NAME/webhooks/MY_WEBHOOK?webhook_token=WEBHOOK_TOKEN.
An alternate structure:
webhooks:
- name: MY_WEBHOOK
token: WEBHOOK_TOKEN
resources:
- name: app-one
type: git
source:
uri: [email protected]:org/repo.git
branch: master
paths: [app_one]
webhooks: [MY_WEBHOOK]
- name: app-two
type: git
source:
uri: [email protected]:org/repo.git
branch: master
paths: [app_two]
webhooks: [MY_WEBHOOK]
Activity
billimek commentedon May 21, 2018
👍 for this as well. We end up creating a ton of webhooks on the github side and would love to have just one trigger a check for everything.
a459259 commentedon May 22, 2018
+1 - We have a similar use-case, would make a lot of sense to have this in place...
haganbmj commentedon Jun 11, 2018
Echoing these sentiments. Currently putting off transitioning a couple dozen projects because it would mean manually creating 4+ webhooks per each one while still not having support for building feature branches.
bump etree tsa handlers mux clockwork goxmldsig genproto grpc
databus23 commentedon Aug 15, 2018
FYI: I created a small service to solve this issue for our concourse deployment: https://github.com/sapcc/webhook-broadcaster
vito commentedon Aug 15, 2018
@wendorf Neat! I like the second form. Is there a use case for listing multiple webhook names? (It makes sense to me, just curious.)
@databus23 That's awesome, thanks for open-sourcing it!
wendorf commentedon Aug 15, 2018
@vito I prefer the second form as well. I don't think I had any use-case for multiple webhooks—probably just overeager.
Took a look at @databus23 's webhook-broadcaster, which looks super useful in the interim. That use case has even tougher requirements, though, with 70 pipelines, and would still not be satisfied by this proposal. It'd be worth thinking if there's an elegant solution to share webhooks across pipelines (scoped to teams, likely), but that's above my pay grade.
timrchavez commentedon Aug 24, 2018
We have not discovered a need for a single resource to have multiple webhook tokens. Also, now that we've made webhook tokens Vault-able, reusing tokens has become very simple with Concourse cred interpolation. Presumably you could have a pipeline-level webhook trigger where any resource configured with the same
webhook_tokenwould trigger. However, I think @databus23 actually solves that problem much better by eliminating the need for a user to add a webhook at all. They just configure their repo to use a webhook and presto their pipeline triggers on repo events. Developers love when they get something for free and with the Drones and Travis's, they've come to expect it, really.add initial development of shared resource webhooks - issue #2230
schmurfy commentedon Oct 26, 2020
I just found this, is there anything happening for that issue ?
Sure the broadcaster may solve the issue but this should be done by concourse itself and not need an external application.
taylorsilva commentedon Oct 26, 2020
@schmurfy This issue is not part of the team's backlog. Someone in the community could pick this one up, as indicated by the help wanted label
vito commentedon Nov 5, 2020
@schmurfy I've been working on an RFC proposing a new design for this, but I'm currently too busy with other things to finish it up. A very very messy WIP is here if you care to poke around. Note that some ideas the document are scrapped but still left around, so take it with a grain of salt.
schmurfy commentedon Nov 10, 2020
@vito after looking at this I think one such system should be even simpler, I was thinking you could just define webhooks on one side with no intelligence and link them to resources of other entities by using their name/id/whatever:
The webhook would have no intelligence by itself (other than maybe allowing to respond to challenge but I am pretty sure a first version could even ignore this) aside from keeping a list of "things" to trigger.
vito commentedon Nov 10, 2020
@schmurfy Yeah, that'd work too, the rfc I'm working on is just aiming to eliminate the need for configuring it at all, since it's a lot of boilerplate. If someone wants to contribute a simpler solution first, by all means - I think there's a path to victory in sight with the rfc, it'll just take a while longer to finalize the proposal and implement.
aoldershaw commentedon Jul 27, 2021
I put together a proposal roughly based on @vito's WIP RFC if anyone's interested in taking a look: concourse/rfcs#110
It takes a similar "no (pipeline) config" approach, where users/operators can define webhooks via
fly, and prototypes can define how resources should "subscribe" to particular webhook payloads based on thesourceconfiguration.Would love any feedback!
VRanga000 commentedon Mar 1, 2023
This is great. It seems like this has been open for quite some time, but would still be a useful feature for many (altho it seems like there is a nice solution - but it requires the deployment of additional components, and a concourse-native solution would still be valuable).
I am interested in proposing this feature and your RFC as an entry for an open source hackathon that is being organized at my company. Would you be open to contributions on this from developers at the hackathon? And would you also be open to providing mentorship / guidance if needed? @wendorf @aoldershaw Thank you.
taylorsilva commentedon Jan 6, 2025
Closing and suggesting that all future discussion move to the referenced RFC