fix: treat pending Gitea CI as acceptable on synced main
Memind CI / Test, build, and release guards (push) Successful in 1m39s
Memind CI / Test, build, and release guards (push) Successful in 1m39s
Normal Portal releases should not block when commit status stays pending after the candidate is already pushed to origin/main. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -60,8 +60,14 @@ export function isReleaseCiAcceptable(ciStatus, { headSha, remoteSha } = {}) {
|
||||
const normalized = String(ciStatus ?? 'missing').trim().toLowerCase();
|
||||
if (normalized === 'success') return true;
|
||||
if (normalized === 'failure' || normalized === 'error') return false;
|
||||
// Self-hosted releases often have no Gitea commit status integration. Once the
|
||||
// candidate is fully pushed to origin/main, treat missing CI as acceptable.
|
||||
if (normalized === 'missing' && remoteSha && headSha === remoteSha) return true;
|
||||
// Self-hosted releases often have no meaningful Gitea commit status. Once the
|
||||
// candidate is fully pushed to origin/main, treat missing/pending CI as acceptable.
|
||||
if (
|
||||
(normalized === 'missing' || normalized === 'pending')
|
||||
&& remoteSha
|
||||
&& headSha === remoteSha
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -20,18 +20,22 @@ test('release CI accepts explicit success and rejects explicit failure', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('release CI accepts missing status when candidate equals origin/main', () => {
|
||||
test('release CI accepts missing or pending status when candidate equals origin/main', () => {
|
||||
const sha = 'c7718c683b216f08865e04edc67f4217f6abc3c1';
|
||||
assert.equal(
|
||||
isReleaseCiAcceptable('missing', { headSha: sha, remoteSha: sha }),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
isReleaseCiAcceptable('pending', { headSha: sha, remoteSha: sha }),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
isReleaseCiAcceptable('missing', { headSha: sha, remoteSha: 'other' }),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
isReleaseCiAcceptable('pending', { headSha: sha, remoteSha: sha }),
|
||||
isReleaseCiAcceptable('pending', { headSha: sha, remoteSha: 'other' }),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user