hotfix.yml was deleted (folded into release.yml). Remove the now-broken release-coverage-scope and policy-release-no-npm-self-upgrade assertions that readFileSync'd hotfix.yml (release.yml equivalents retained), drop the dead install-smoke.yml path trigger, and update VERSIONING.md / docs/branching.md prose to describe hotfixes via the Release workflow with a patch version. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,6 @@ const NPM_SELF_UPGRADE_RE = /\bnpm\s+(install|i)\s+(-g|--global)\b[^\n]*\bnpm(@|
|
||||
|
||||
describe('policy: no runtime npm self-upgrade in release lanes (#318)', () => {
|
||||
const releaseFile = path.join(WORKFLOWS_DIR, 'release.yml');
|
||||
const hotfixFile = path.join(WORKFLOWS_DIR, 'hotfix.yml');
|
||||
|
||||
test('release.yml must not contain a runtime global npm self-upgrade step', () => {
|
||||
const content = fs.readFileSync(releaseFile, 'utf8');
|
||||
@@ -36,21 +35,6 @@ describe('policy: no runtime npm self-upgrade in release lanes (#318)', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('hotfix.yml must not contain a runtime global npm self-upgrade step', () => {
|
||||
const content = fs.readFileSync(hotfixFile, 'utf8');
|
||||
const lines = content.split('\n');
|
||||
const violations = lines
|
||||
.map((line, idx) => ({ line, lineNo: idx + 1 }))
|
||||
.filter(({ line }) => NPM_SELF_UPGRADE_RE.test(line));
|
||||
|
||||
assert.strictEqual(
|
||||
violations.length,
|
||||
0,
|
||||
`hotfix.yml contains ${violations.length} runtime npm self-upgrade line(s) — ` +
|
||||
`Violations: ${violations.map(({ lineNo, line }) => `line ${lineNo}: ${line.trim()}`).join('; ')}`
|
||||
);
|
||||
});
|
||||
|
||||
test('NPM_SELF_UPGRADE_RE correctly matches the antipattern', () => {
|
||||
// Positive cases — must match
|
||||
assert.ok(NPM_SELF_UPGRADE_RE.test('npm install -g npm@latest'), 'should match npm install -g npm@latest');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// .github/workflows/{release,hotfix}.yml are the deployed CI contract; asserting
|
||||
// .github/workflows/release.yml is the deployed CI contract; asserting
|
||||
// the release-gate test command is only expressible against the workflow text.
|
||||
|
||||
'use strict';
|
||||
@@ -10,7 +10,6 @@ const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const RELEASE_WORKFLOW = path.join(__dirname, '..', '.github', 'workflows', 'release.yml');
|
||||
const HOTFIX_WORKFLOW = path.join(__dirname, '..', '.github', 'workflows', 'hotfix.yml');
|
||||
|
||||
describe('release-coverage-scope', () => {
|
||||
test('release.yml uses test:coverage:unit (not full suite) in both rc and finalize gates', () => {
|
||||
@@ -23,13 +22,5 @@ describe('release-coverage-scope', () => {
|
||||
`release.yml has ${unitCount} 'npm run test:coverage:unit' line(s); expected 2`);
|
||||
});
|
||||
|
||||
test('hotfix.yml uses test:coverage:unit (not full suite) in the finalize gate', () => {
|
||||
const lines = fs.readFileSync(HOTFIX_WORKFLOW, 'utf8').split('\n').map(l => l.trim());
|
||||
const bareCount = lines.filter(l => l === 'npm run test:coverage').length;
|
||||
const unitCount = lines.filter(l => l === 'npm run test:coverage:unit').length;
|
||||
assert.strictEqual(bareCount, 0,
|
||||
`hotfix.yml still has ${bareCount} bare 'npm run test:coverage' line(s); expected 0`);
|
||||
assert.strictEqual(unitCount, 1,
|
||||
`hotfix.yml has ${unitCount} 'npm run test:coverage:unit' line(s); expected 1`);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user