fix(ci): bound qa-profile-evidence git fetch operations with timeout (#110282)

* fix(ci): bound qa-profile-evidence git fetch operations with timeout

* fix(ci): bound qa-profile-evidence git fetch operations with timeout

ci: retrigger checks

* test(ci): guard QA evidence fetch timeouts

Co-authored-by: wanyongstar <wan.yong@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Peter Steinberger <peter@steipete.me>
This commit is contained in:
wanyongstar
2026-07-18 13:34:43 +08:00
committed by GitHub
parent c1e5c1d4fa
commit e6534018e1
2 changed files with 21 additions and 2 deletions

View File

@@ -157,14 +157,14 @@ jobs:
exit 1
fi
git fetch --no-tags origin +refs/heads/main:refs/remotes/origin/main
timeout --signal=TERM --kill-after=10s 120s git fetch --no-tags origin +refs/heads/main:refs/remotes/origin/main
if git merge-base --is-ancestor "$selected_revision" refs/remotes/origin/main; then
trusted_reason="main-ancestor"
elif git tag --points-at "$selected_revision" | grep -Eq '^v'; then
trusted_reason="release-tag"
elif [[ "$INPUT_REF" =~ ^release/[0-9]{4}\.[0-9]+\.[0-9]+$ ]]; then
git fetch --no-tags origin "+refs/heads/${INPUT_REF}:refs/remotes/origin/${INPUT_REF}"
timeout --signal=TERM --kill-after=10s 120s git fetch --no-tags origin "+refs/heads/${INPUT_REF}:refs/remotes/origin/${INPUT_REF}"
release_branch_sha="$(git rev-parse "refs/remotes/origin/${INPUT_REF}")"
if [[ "$selected_revision" == "$release_branch_sha" ]]; then
trusted_reason="release-branch-head"

View File

@@ -4317,6 +4317,25 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}"
},
);
it("bounds QA profile selected-ref fetches", () => {
const validateSelectedRef = expectDefined(
readQaProfileEvidenceWorkflow().jobs.validate_selected_ref.steps.find(
(step: WorkflowStep) => step.name === "Validate selected ref",
),
"QA profile selected-ref validation step",
);
const gitFetchLines = validateSelectedRef.run
.split("\n")
.filter((line: string) => line.includes("git fetch"));
expect(gitFetchLines).toHaveLength(2);
expect(
gitFetchLines.every((line: string) =>
line.trimStart().startsWith("timeout --signal=TERM --kill-after=10s 120s git fetch"),
),
).toBe(true);
});
it("keeps maturity scorecard generated QA evidence handoff strict", () => {
const maturityWorkflow = readMaturityScorecardWorkflow();
const qaEvidenceWorkflow = readQaProfileEvidenceWorkflow();