refactor: split smoke and integration test configs into separate CI jobs (#264)

* refactor: split smoke and integration test configs into separate CI jobs

* fix: move CLA labeling from triage to CLA workflow

* fix: install formatters in temp dir to avoid catalog: protocol error

* fix: handle 404 when removing labels that don't exist on the PR
This commit is contained in:
Matt Kane
2026-04-05 08:22:17 +01:00
committed by GitHub
parent c4977e1fd1
commit 5beb0ddc33
8 changed files with 97 additions and 71 deletions

View File

@@ -81,29 +81,7 @@ jobs:
// Ignore -- mergeable state may not be computed yet
}
// --- CLA status ---
// The CLA assistant sets a commit status named "license/cla".
// Check the latest status for this PR's head SHA.
try {
const { data: statuses } = await github.rest.repos.listCommitStatusesForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: pr.head.sha,
});
const claStatus = statuses.find(s => s.context === 'license/cla');
if (claStatus) {
if (claStatus.state === 'success') {
labels.add('cla: signed');
} else {
labels.add('cla: needed');
}
} else {
// CLA check hasn't run yet -- mark as pending
labels.add('cla: needed');
}
} catch {
// If we can't read statuses, don't add CLA labels
}
// CLA labels are managed by the CLA workflow (cla.yml), not here.
// --- Ensure all labels exist, then apply ---
const labelColors = {
@@ -121,8 +99,6 @@ jobs:
'area/ci': '000000',
'area/auth': 'd4c5f9',
'area/cloudflare': 'f9a825',
'cla: signed': '0e8a16',
'cla: needed': 'b60205',
'needs-rebase': 'e11d48',
};
@@ -152,39 +128,30 @@ jobs:
// Get current labels on the PR to remove stale ones
const currentLabels = new Set(pr.labels.map(l => l.name));
// Remove stale size labels (only one size label at a time)
for (const sl of sizeLabels) {
if (sl !== sizeLabel && currentLabels.has(sl)) {
// Helper: remove a label, ignoring 404 if it's already gone
async function safeRemoveLabel(name) {
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
name: sl,
name,
});
} catch (e) {
if (e.status !== 404) throw e;
}
}
// Remove stale CLA labels
const claLabels = ['cla: signed', 'cla: needed'];
for (const cl of claLabels) {
if (!labels.has(cl) && currentLabels.has(cl)) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
name: cl,
});
// Remove stale size labels (only one size label at a time)
for (const sl of sizeLabels) {
if (sl !== sizeLabel && currentLabels.has(sl)) {
await safeRemoveLabel(sl);
}
}
// Remove needs-rebase if PR is now mergeable
if (!labels.has('needs-rebase') && currentLabels.has('needs-rebase')) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
name: 'needs-rebase',
});
await safeRemoveLabel('needs-rebase');
}
// Add new labels