fix(#2716): route non-user-facing conventional types to an Internal bucket, omit from release notes (#2838)
* test(#2716): failing-first regression for non-user-facing types → Internal bucket * fix(#2716): route non-user-facing conventional types to an Internal bucket, omit from release notes * fix(#2716): update SAMPLE_BODY/Discord/property tests for Internal bucket; fix stale CONTRIBUTING sentence (review) * test(#2716): relax Discord Enhancement assertion (enhance: prefix not stripped by cleanBullet) * docs(changeset): #2716 non-user-facing types omitted from release notes * docs(changeset): backfill #2716 PR number to 2838
This commit is contained in:
@@ -71,7 +71,7 @@ describe('classifyBucket — properties', () => {
|
||||
fc.assert(
|
||||
fc.property(fc.string(), (title) => {
|
||||
const bucket = classifyBucket(title);
|
||||
assert.ok(['Feature', 'Fix', 'Enhancement'].includes(bucket));
|
||||
assert.ok(['Feature', 'Fix', 'Enhancement', 'Internal'].includes(bucket));
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@@ -39,8 +39,8 @@ describe('classifyBucket', () => {
|
||||
assert.equal(classifyBucket('fix: another fix'), 'Fix');
|
||||
});
|
||||
|
||||
test('chore(#N): -> Enhancement (catch-all)', () => {
|
||||
assert.equal(classifyBucket('chore(#2): some chore'), 'Enhancement');
|
||||
test('chore(#N): -> Internal (#2716 — non-user-facing type)', () => {
|
||||
assert.equal(classifyBucket('chore(#2): some chore'), 'Internal');
|
||||
});
|
||||
|
||||
test('untyped title -> Enhancement (catch-all)', () => {
|
||||
@@ -148,3 +148,34 @@ describe('evaluatePrTitle — rejected titles', () => {
|
||||
assert.ok(r.message.length > 0);
|
||||
});
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// #2716: non-user-facing conventional types (test/chore/ci/docs/refactor/perf/
|
||||
// revert) classify to 'Internal', NOT 'Enhancement' — they must not render under
|
||||
// the user-facing Enhancement heading in release notes. Untyped and anchor-
|
||||
// defeated titles stay in the visible Enhancement fallback (safety net).
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
describe('classifyBucket #2716: non-user-facing types → Internal', () => {
|
||||
for (const type of ['test', 'chore', 'ci', 'docs', 'refactor', 'perf', 'revert']) {
|
||||
test(`${type}(#N): → Internal (not Enhancement)`, () => {
|
||||
assert.equal(classifyBucket(`${type}(#100): some internal work`), 'Internal');
|
||||
});
|
||||
test(`${type}: (no scope) → Internal`, () => {
|
||||
assert.equal(classifyBucket(`${type}: some internal work`), 'Internal');
|
||||
});
|
||||
}
|
||||
|
||||
test('feat/fix classification is unchanged', () => {
|
||||
assert.equal(classifyBucket('feat(#5): new thing'), 'Feature');
|
||||
assert.equal(classifyBucket('fix(#6): fix thing'), 'Fix');
|
||||
});
|
||||
|
||||
test('untyped title stays in Enhancement (safety net)', () => {
|
||||
assert.equal(classifyBucket('Main changes'), 'Enhancement');
|
||||
});
|
||||
|
||||
test('[security] fix(...) stays in Enhancement (anchor-defeated safety net)', () => {
|
||||
assert.equal(classifyBucket('[security] fix(config): the case'), 'Enhancement');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -64,12 +64,16 @@ describe('discord release summary', () => {
|
||||
'## What\'s Changed',
|
||||
'* feat: add thing by @trek-e in https://github.com/open-gsd/gsd-core/pull/10',
|
||||
'* fix: repair thing by @trek-e in https://github.com/open-gsd/gsd-core/pull/11',
|
||||
'* enhance: improve thing by @trek-e in https://github.com/open-gsd/gsd-core/pull/13',
|
||||
'* docs: explain thing by @trek-e in https://github.com/open-gsd/gsd-core/pull/12',
|
||||
].join('\n'));
|
||||
|
||||
assert.deepEqual(sections.get('Feature'), ['add thing (#10)']);
|
||||
assert.deepEqual(sections.get('Fix'), ['repair thing (#11)']);
|
||||
assert.deepEqual(sections.get('Enhancement'), ['explain thing (#12)']);
|
||||
// enhance: is a genuine user-facing enhancement (not in the non-user-facing set).
|
||||
assert.ok(sections.get('Enhancement') && sections.get('Enhancement').length === 1, 'enhance: bullet lands in Enhancement');
|
||||
// #2716: docs: routes to the Internal section, not Enhancement.
|
||||
assert.deepEqual(sections.get('Internal'), ['explain thing (#12)']);
|
||||
});
|
||||
|
||||
test('cleans common GitHub release-note link noise without deleting issue references', () => {
|
||||
|
||||
@@ -48,17 +48,17 @@ describe('classifyTitle', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('returns Enhancement for chore(#2): title', () => {
|
||||
test('returns Internal for chore(#2): title (#2716)', () => {
|
||||
assert.equal(
|
||||
classifyTitle('* chore(#2): some chore by @trek-e in https://github.com/open-gsd/gsd-core/pull/5'),
|
||||
'Enhancement'
|
||||
'Internal'
|
||||
);
|
||||
});
|
||||
|
||||
test('returns Enhancement for docs: title', () => {
|
||||
test('returns Internal for docs: title (#2716)', () => {
|
||||
assert.equal(
|
||||
classifyTitle('* docs: documentation update by @trek-e in https://github.com/open-gsd/gsd-core/pull/6'),
|
||||
'Enhancement'
|
||||
'Internal'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -84,7 +84,7 @@ describe('classifyTitle', () => {
|
||||
const SAMPLE_BODY = `## What's Changed
|
||||
* feat(#39): milestone-prefixed phase IDs by @trek-e in https://github.com/open-gsd/gsd-core/pull/565
|
||||
* fix(#557): milestone erased on update by @trek-e in https://github.com/open-gsd/gsd-core/pull/563
|
||||
* chore(#2): update dependencies by @trek-e in https://github.com/open-gsd/gsd-core/pull/560
|
||||
* enhance(#2): smoother phase transitions by @trek-e in https://github.com/open-gsd/gsd-core/pull/560
|
||||
|
||||
## New Contributors
|
||||
* @someone made their first contribution in https://github.com/open-gsd/gsd-core/pull/123
|
||||
@@ -217,4 +217,31 @@ describe('formatReleaseNotes', () => {
|
||||
assert.ok(secondIdx !== -1, 'second feature bullet should be present');
|
||||
assert.ok(firstIdx < secondIdx, 'first feature should appear before second feature');
|
||||
});
|
||||
|
||||
test('#2716: a test:-titled PR is omitted from the rendered release notes entirely', () => {
|
||||
const body = `## What's Changed
|
||||
* feat(#39): real feature by @trek-e in https://github.com/open-gsd/gsd-core/pull/565
|
||||
* test(#99): add regression coverage by @trek-e in https://github.com/open-gsd/gsd-core/pull/900
|
||||
|
||||
## New Contributors
|
||||
|
||||
**Full Changelog**: https://github.com/open-gsd/gsd-core/compare/v1.2.0...v1.3.0-rc.1
|
||||
`;
|
||||
const out = formatReleaseNotes({
|
||||
generatedBody: body,
|
||||
version: '1.3.0-rc.1',
|
||||
prerelease: true,
|
||||
packageName: '@opengsd/gsd-core',
|
||||
});
|
||||
// The feature bullet must appear under ### Feature.
|
||||
assert.ok(out.includes('feat(#39): real feature'), 'feature bullet must be present');
|
||||
assert.ok(out.includes('### Feature'), 'Feature section must render');
|
||||
// The test:-titled PR must NOT appear anywhere in the user-facing output.
|
||||
assert.ok(
|
||||
!out.includes('test(#99): add regression coverage'),
|
||||
'a test:-titled PR must be omitted from the rendered release notes (#2716)',
|
||||
);
|
||||
// And there must be no user-facing "Enhancement" section here (only the feature).
|
||||
assert.ok(!out.includes('### Enhancement'), 'no Enhancement section expected when the only non-feature is Internal');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user