Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/heavy-caps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ runs:
if (login.endsWith('[bot]')) return;

// Agent lanes share one login: each branch prefix counts as an author.
// The same list as SHARED_AGENT_LOGINS (.github/scripts/ci-pr-gate.mjs).
const shared = ['cixzhang'].includes(login);
const lane = ref => (shared ? ref.split('/')[0] : '');
const mine = ref => lane(ref) === lane(pr.head.ref);
Expand Down
25 changes: 18 additions & 7 deletions .github/scripts/ci-admission.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,20 @@ describe('where runs wait', () => {
expect(room.outputs[key]).toBe(`\${{ steps.room.outputs.${key} }}`);
// Every job but the Storybook build reaches admission, directly or through
// the jobs it needs, never only through the build.
// heavy-ci, the agent-push deferral decision (spec:AST-030 FR20), is one
// slim job beside admission that the build needs.
const BESIDE = 'build-storybook';
expect(needsOf(ci.jobs[BESIDE])).toEqual(['room']);
const DEFERRAL = 'heavy-ci';
expect(needsOf(ci.jobs[BESIDE])).toEqual(['room', DEFERRAL]);
expect(needsOf(ci.jobs[DEFERRAL])).toEqual(['room']);
const reaches = id =>
needsOf(ci.jobs[id]).some(
need => need === 'admission' || (need !== BESIDE && reaches(need)),
need =>
need === 'admission' ||
(need !== BESIDE && need !== DEFERRAL && reaches(need)),
);
for (const id of Object.keys(ci.jobs)) {
if (!['room', 'admission', 'ci-full', BESIDE].includes(id))
if (!['room', 'admission', 'ci-full', BESIDE, DEFERRAL].includes(id))
expect(reaches(id), id).toBe(true);
}
});
Expand Down Expand Up @@ -237,8 +243,12 @@ describe('peaks', () => {
const closure = new Set();
const visit = name => {
for (const need of needsOf(ci.jobs[name])) {
// heavy-ci decides an agent push's deferral and skips for a
// release-check (spec:AST-030 FR20).
if (
['maintenance-request', 'room', 'admission'].includes(need) ||
['maintenance-request', 'room', 'admission', 'heavy-ci'].includes(
need,
) ||
closure.has(need)
)
continue;
Expand Down Expand Up @@ -299,9 +309,10 @@ describe('peaks', () => {
});

it('gives a pull request a peak that covers every job it starts at once', () => {
// The jobs that need only the waits start together the moment admission
// ends; the Storybook build may still be running then.
const waits = ['room', 'admission'];
// The jobs that need only the waits (and heavy-ci, the deferral decision
// that runs only for an agent push; spec:AST-030 FR20) start together the
// moment admission ends; the Storybook build may still be running then.
const waits = ['room', 'admission', 'heavy-ci'];
const first = Object.keys(ci.jobs).filter(
name =>
!waits.includes(name) &&
Expand Down
9 changes: 6 additions & 3 deletions .github/scripts/ci-docsite-browser.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ describe('docsite-test', () => {
expect(jobs['docsite-data']).toBeUndefined();
expect(jobs['docsite-browser']).toBeUndefined();
// Only CI's run admission, which never skips (ci-admission.test.mjs).
// room tells it when CI is full (ci-admission.test.mjs).
expect(owner.needs).toEqual(['room', 'admission']);
// room tells it when CI is full (ci-admission.test.mjs); heavy-ci whether
// an agent push deferred it (spec:AST-030 FR20).
expect(owner.needs).toEqual(['room', 'admission', 'heavy-ci']);
expect(owner['continue-on-error']).toBeUndefined();
// A required context keeps only the draft skip in its condition; an
// outside contributor's run stops at the first step with the reason.
Expand All @@ -46,7 +47,9 @@ describe('docsite-test', () => {
);
// After the FR17 gate and the CI-is-full stop (ci-admission.test.mjs).
expect(owner.steps[1].name).toBe('Stop when CI is full');
expect(owner.steps.findIndex(s => s.id === 'scope')).toBe(3);
// Then an agent push's deferral (spec:AST-030 FR20), then the scope.
expect(owner.steps[2].name).toBe('Heavy CI deferred');
expect(owner.steps.findIndex(s => s.id === 'scope')).toBe(4);

const builds = owner.steps.filter(s =>
/pnpm -F @astryxdesign\/docsite build/.test(s.run ?? ''),
Expand Down
Loading
Loading