[repo] FabricaRelease: Lint the generated release notes before the page is made; fix escapes in the APK signing test
This commit is contained in:
@@ -141,7 +141,9 @@ nothing of Fabrica's.
|
|||||||
`v0.1.0`, the version every file has today.
|
`v0.1.0`, the version every file has today.
|
||||||
- **F11 — The page's words are copy.** `AULA.md`, `.fabrica/aula/brief.md` and `.fabrica/notes/*.md`
|
- **F11 — The page's words are copy.** `AULA.md`, `.fabrica/aula/brief.md` and `.fabrica/notes/*.md`
|
||||||
are what a stranger reads about Rosea, like a store listing (§8). `lint:copy` scans them, so the
|
are what a stranger reads about Rosea, like a store listing (§8). `lint:copy` scans them, so the
|
||||||
page never says *lonely*, never names the book, and makes no claim to heal anything.
|
page never says *lonely*, never names the book, and makes no claim to heal anything. The release
|
||||||
|
notes `fabrica notes` writes from commit subjects are copy too: the release's `notes-copy` step runs
|
||||||
|
`lint:copy` over `target/notes/release-notes.md` before the page is made.
|
||||||
|
|
||||||
## 3. Risk analysis
|
## 3. Risk analysis
|
||||||
|
|
||||||
|
|||||||
@@ -57,12 +57,15 @@ steps:
|
|||||||
- id: notes
|
- id: notes
|
||||||
run: fabrica notes
|
run: fabrica notes
|
||||||
artifacts: ["target/notes/release-notes.md", "target/notes/release-notes.json"]
|
artifacts: ["target/notes/release-notes.md", "target/notes/release-notes.json"]
|
||||||
|
- id: notes-copy
|
||||||
|
needs: [notes, install]
|
||||||
|
run: pnpm lint:copy
|
||||||
- id: shots
|
- id: shots
|
||||||
needs: [pictures]
|
needs: [pictures]
|
||||||
run: fabrica aula shots
|
run: fabrica aula shots
|
||||||
artifacts: ["target/aula/aula-*.png", "target/aula/aula.json"]
|
artifacts: ["target/aula/aula-*.png", "target/aula/aula.json"]
|
||||||
- id: page
|
- id: page
|
||||||
needs: [notes, shots]
|
needs: [notes-copy, shots]
|
||||||
run: fabrica aula page
|
run: fabrica aula page
|
||||||
artifacts: ["target/aula/aula-page.json", "target/aula/aula-page.html"]
|
artifacts: ["target/aula/aula-page.json", "target/aula/aula-page.html"]
|
||||||
- id: approve
|
- id: approve
|
||||||
|
|||||||
@@ -40,15 +40,15 @@ describe('signArgs', () => {
|
|||||||
|
|
||||||
describe('custosSign', () => {
|
describe('custosSign', () => {
|
||||||
it('runs the custos-sign CUSTOS_SIGN_EXE names, else the one on PATH', () => {
|
it('runs the custos-sign CUSTOS_SIGN_EXE names, else the one on PATH', () => {
|
||||||
expect(custosSign({ CUSTOS_SIGN_EXE: 'F:\Apps\Custos\custos-sign.exe' }, () => true)).toBe('F:\Apps\Custos\custos-sign.exe');
|
expect(custosSign({ CUSTOS_SIGN_EXE: 'F:\\Apps\\Custos\\custos-sign.exe' }, () => true)).toBe('F:\\Apps\\Custos\\custos-sign.exe');
|
||||||
expect(custosSign({}, () => true)).toBe('custos-sign.exe');
|
expect(custosSign({}, () => true)).toBe('custos-sign.exe');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('refuses a named custos-sign that is not there, rather than another one', () => {
|
it('refuses a named custos-sign that is not there, rather than another one', () => {
|
||||||
expect(() => custosSign({ CUSTOS_SIGN_EXE: 'X:\nowhere.exe' }, () => false)).toThrow(/not there/);
|
expect(() => custosSign({ CUSTOS_SIGN_EXE: 'X:\\nowhere.exe' }, () => false)).toThrow(/not there/);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('refuses another Custos (CUSTOS_PIPE)', () => {
|
it('refuses another Custos (CUSTOS_PIPE)', () => {
|
||||||
expect(() => custosSign({ CUSTOS_PIPE: '\\.\pipe\test' }, () => true)).toThrow(/CUSTOS_PIPE/);
|
expect(() => custosSign({ CUSTOS_PIPE: '\\\\.\\pipe\\test' }, () => true)).toThrow(/CUSTOS_PIPE/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,7 +26,15 @@ const TARGETS: readonly { dir: string; ext: readonly string[] }[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
/** Single files: the page shell, the config that builds the web manifest, the Letter, and the Aula page's text. */
|
/** Single files: the page shell, the config that builds the web manifest, the Letter, and the Aula page's text. */
|
||||||
const FILES: readonly string[] = ['apps/rosea/index.html', 'apps/rosea/vite.config.ts', 'docs/LETTER.md', 'AULA.md'];
|
const FILES: readonly string[] = [
|
||||||
|
'apps/rosea/index.html',
|
||||||
|
'apps/rosea/vite.config.ts',
|
||||||
|
'docs/LETTER.md',
|
||||||
|
'AULA.md',
|
||||||
|
// Written by `fabrica notes` from commit subjects during a release; read when it is there, so the
|
||||||
|
// release's `notes-copy` step stops a forbidden word before it reaches the page (fabrica-release.md F11).
|
||||||
|
'target/notes/release-notes.md'
|
||||||
|
];
|
||||||
|
|
||||||
function walk(dir: string, ext: readonly string[]): string[] {
|
function walk(dir: string, ext: readonly string[]): string[] {
|
||||||
if (!existsSync(dir)) return [];
|
if (!existsSync(dir)) return [];
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { spawnSync } from 'node:child_process';
|
import { spawnSync } from 'node:child_process';
|
||||||
import { createRequire } from 'node:module';
|
import { createRequire } from 'node:module';
|
||||||
import { join } from 'node:path';
|
import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
||||||
|
import { dirname, join } from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
@@ -26,6 +27,20 @@ describe('lint:copy reads the Aula page', { timeout: 60_000 }, () => {
|
|||||||
expect(files).toContain('.fabrica/notes/0.1.0.md');
|
expect(files).toContain('.fabrica/notes/0.1.0.md');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("a release's generated notes are checked when they are there", () => {
|
||||||
|
const notes = join(repo, 'target/notes/release-notes.md');
|
||||||
|
const had = existsSync(notes);
|
||||||
|
if (!had) {
|
||||||
|
mkdirSync(dirname(notes), { recursive: true });
|
||||||
|
writeFileSync(notes, '# notes\n');
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
expect(listed()).toContain('target/notes/release-notes.md');
|
||||||
|
} finally {
|
||||||
|
if (!had) rmSync(notes);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it('the game itself is still checked', () => {
|
it('the game itself is still checked', () => {
|
||||||
const files = listed();
|
const files = listed();
|
||||||
expect(files).toContain('packages/ui/src/copy/en.ts');
|
expect(files).toContain('packages/ui/src/copy/en.ts');
|
||||||
|
|||||||
Reference in New Issue
Block a user