-
Notifications
You must be signed in to change notification settings - Fork 21
RFC 0196 - Trigger hooks from Github Service #196
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
base: main
Are you sure you want to change the base?
Conversation
5ccb5fb to
c241428
Compare
|
|
||
| The `triggerHook` API returns the hook task's `taskId` as part of the response. | ||
| Taskcluster Github will use this `taskId` to create a record in the Github | ||
| builds table. This will allow Taskcluster Github to add the task to Github's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For checks and statuses to work properly, github internal queue listener depends on the routing keys - route.checks/route.statuses.
Maybe this should be part of the context passed to the trigger, since .taskcluster.yml knows which type to use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, maybe it could just add reporting to the payload. Maybe also policy? Not sure if that would be useful though..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we just ignore status as isn't it supposedly deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we should make checks default (iirc currently statuses are being used if reporting is not defined)
Would policy be useful for hook payload? I thought github service would still make that decision prior to trigger that hook or not.
But we can surely pass whole .taskcluster.yml source that was used as part of the trigger payload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't immediately think of a reason we'd need policy, so let's forget about that.
I'm equally happy adding reporting to the context, or for our use case, just assuming that everything is using checks (which afaik it is). Wnat me to update the RFC to include reporting?
|
Thank you @ahal, that's a solid proposal. As I understand we don't limit the number of hooks we could trigger here, same way as we didn't limit number of tasks created. But I guess this might not be the desired flow |
|
So we need to filter on more than just the Github event type and action. Off the top of my head, we also filter on branch name and repo URL, but there are probably others. Currently we use the JSON-e in the From the docs:
This gives us more control over where tasks can run. I'm not opposed to TC Github also providing a way to do some basic filtering, I just don't think it would benefit our specific use case much. Unless it's trivial to do, I'd suggest leaving it out of this RFC to keep things simple. We can always implement later if needed. |
c241428 to
33c2060
Compare
|
Added a blurb to the "Edge Cases" section about what to do if the |
Though thinking about it.. without any GH service side filtering, we would have a lot of I dunno, I could be persuaded either way. |
Right, this might a good reason to not trigger a hook knowing it would be competing with valid tasks in the dedicated worker pools. I quickly checked logs Gives me ~9k for the last 2 weeks (most of which are web-platform-tests ~5k of those) So maybe in the grand scheme that is not too many tasks |
| - `event` - the raw Github event object | ||
| - `now` - the current time, as a string | ||
| - `taskcluster_root_url` - the root URL of the Taskcluster deployment | ||
| - `tasks_for` - the Github event type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume these would overwrite any version of them provided in the context? If so, these should probably be forbidden from being in the context in the first place to avoid confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this proposal anything in the context would be in a separate namespace. So in the JSON-e it would be possible to have:
${payload.tasks_for} # implicit
${payload.context.tasks_for} # project provided
I agree it would be confusing if a project did this, but given they don't overlap, I don't think we should prevent it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aaaah, okay. Yep, makes sense to me!
|
|
||
| A new `hooks` key will be added to the [taskcluster-yml-v1] schema. This key is | ||
| a list, where each item is an object containing `hookId` and optionally | ||
| additional `context`. Hook ID corresponds to an existing hook in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love the word context here, but I couldn't think of anything better.
Rendered