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
9 changes: 6 additions & 3 deletions scripts/pr-effort.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// copy fresh. Pull request search has no size qualifier, which leaves reading
// effort as the one axis a query cannot express.

const EFFORT_LABELS = ['effort/XS', 'effort/S', 'effort/M', 'effort/L', 'effort/XL'];
const EFFORT_LABELS = ['effort/XS', 'effort/S', 'effort/M', 'effort/L', 'effort/XL', 'effort/XXL'];

// Counted changes should track what a human actually reads. Lockfiles,
// regenerated artifacts and binaries are verified by their own contracts, so
Expand All @@ -40,13 +40,16 @@ const UNREAD_PATTERNS = [
];

// Tier boundaries are inclusive upper bounds on readable lines. Test code is
// not discounted anywhere here; it is reviewed too.
// not discounted anywhere here; it is reviewed too. Past 2500 lines a pull
// request is no longer reviewable as one change, so the top tier exists to
// start the split conversation before the review does.
const EFFORT_TIERS = [
{ label: 'effort/XS', maxLines: 10 },
{ label: 'effort/S', maxLines: 100 },
{ label: 'effort/M', maxLines: 500 },
{ label: 'effort/L', maxLines: 1000 },
{ label: 'effort/XL', maxLines: Number.POSITIVE_INFINITY },
{ label: 'effort/XL', maxLines: 2500 },
{ label: 'effort/XXL', maxLines: Number.POSITIVE_INFINITY },
];

function isUnreadPath(path) {
Expand Down
2 changes: 2 additions & 0 deletions scripts/pr-effort.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ describe('tier boundaries', () => {
assert.equal(tier([file('a.ts', 501)]), 'effort/L');
assert.equal(tier([file('a.ts', 1000)]), 'effort/L');
assert.equal(tier([file('a.ts', 1001)]), 'effort/XL');
assert.equal(tier([file('a.ts', 2500)]), 'effort/XL');
assert.equal(tier([file('a.ts', 2501)]), 'effort/XXL');
});

it('counts additions and deletions together', () => {
Expand Down