{{ message }}
fix(github): create build records for all unique taskGroupIds#8756
Open
nitishagar wants to merge 1 commit into
Open
fix(github): create build records for all unique taskGroupIds#8756nitishagar wants to merge 1 commit into
nitishagar wants to merge 1 commit into
Conversation
e5d7967 to
ab52904
Compare
Contributor
…uster#8751) When .taskcluster.yml defines tasks with different taskGroupId values, the github service now creates one github_builds row and publishes one taskGroupCreationRequested message per unique taskGroupId. Previously only tasks[0]'s group was recorded, leaving all other task groups invisible to GitHub checks and statuses. cancelPreviousTaskGroups is called once after all records are created; sibling builds from the same event share the same event_id and are already excluded by the existing event_id filter, so no interface change was needed there. Fixes taskcluster#8751
ab52904 to
4c07ea1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
When a
.taskcluster.ymldefines tasks with differenttaskGroupIdvalues, the GitHub service only recordedtasks[0]'staskGroupIdin thegithub_buildstable and only publishedtaskGroupCreationRequestedfor that first group. All other task groups were invisible to GitHub checks and statuses — the build record was never created, so no status was ever posted.What changed
services/github/src/handlers/job.jsThe
graphConfig.tasksprocessing block now:Map<taskGroupId, routes>over all tasks, keeping the routes of the first task in each group.github_buildsrow per uniquetaskGroupId(parallel, like the hooks path).createTasksunchanged (still a single call with all tasks).cancelPreviousTaskGroupsonce with the first new build. Sibling builds from the same event share the sameevent_idand are already excluded by the existingevent_idfilter insidecancelPreviousTaskGroups, so no interface change was needed there.taskGroupCreationRequestedonce per uniquetaskGroupId(mirroring the hooks code path).No database schema or API changes are needed —
github_buildsalready supports multiple rows per SHA with differenttask_group_idvalues, and downstream handlers (status.js,deprecatedStatus.js,taskGroupCreation.js) look up builds bytaskGroupIdand need no changes.Test coverage
valid-yaml-v1-multi-group.json: 3 tasks — task1 and task2 in group A, task3 in group B.multi-group yml creates one build record per unique taskGroupId— verifies 2github_buildsrows (one per group), bothpending.multi-group yml publishes taskGroupCreationRequested once per unique group— verifies exactly 2 publishes, one per group ID.multi-group yml calls cancelPreviousTaskGroups once for pull_request— verifies the function is called exactly once regardless of group count.does not cancel sibling task groups from the same event(incancelPreviousTaskGroupsunit suite) — verifies that builds from the same event (sameevent_id) are not cancelled whencancelPreviousTaskGroupsis called for one of them.Maintainer note
I followed the hooks code path (
job.js:335-392) as the structural model, which already publishestaskGroupCreationRequestedonce per hook. I'd welcome feedback on whether publishing once per uniquetaskGroupIdis the right behaviour, or whether there are downstream consumers that expect a single publish per job event.Fixes #8751