mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 10:23:11 +00:00
Run live isolation on the merge-queue event so ci-complete actually gates mixed change sets, without treating the group union as one PR.
29 lines
1 KiB
JavaScript
29 lines
1 KiB
JavaScript
/**
|
|
* Live G13 scheduling and how a GitHub event is split into change sets.
|
|
*
|
|
* Isolation is a per-change rule. pull_request and local runs classify the
|
|
* merge-base...HEAD range (one PR). merge_group classifies each first-parent
|
|
* commit vs its parent (one queued PR per squash or merge-commit). The group
|
|
* union is not a change set: a Terraform-only PR stacked with an app-only PR
|
|
* must still pass. push is not classified; landing already happened.
|
|
*/
|
|
|
|
export function shouldRunLiveIsolation(eventName) {
|
|
return !eventName || eventName === "pull_request" || eventName === "merge_group";
|
|
}
|
|
|
|
export function usesPerCommitIsolation(eventName) {
|
|
return eventName === "merge_group";
|
|
}
|
|
|
|
/**
|
|
* File lists to run through check_app_terraform_isolation.py.
|
|
* `commitDiffs` is first-parent order (oldest first); ignored except on
|
|
* merge_group.
|
|
*/
|
|
export function liveIsolationFileSets(eventName, rangeFiles, commitDiffs) {
|
|
if (usesPerCommitIsolation(eventName)) {
|
|
return commitDiffs.map((commit) => commit.files);
|
|
}
|
|
return [rangeFiles];
|
|
}
|