paperclip/scripts
Devin Foley 1944c86153
fix(ci): preserve required e2e check for sharded runs (#9923)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The pull request workflow is the main merge gate for changes to that
app.
> - The Playwright e2e lane is expensive because every spec shares one
isolated server and runs serially.
> - Splitting that lane across runners shortens the critical path, but
the public required-check contract still needs a check named exactly
`e2e`.
> - This pull request shards the real e2e work while preserving a fast
aggregate `e2e` job for branch protection.
> - The benefit is a faster PR workflow without making otherwise-good
PRs unmergeable because a legacy required check disappeared.

## Linked Issues or Issue Description

No public GitHub issue exists for this CI follow-up.

Related prior CI work:

- Refs #8360
- Refs #9168
- Refs #9516

Bug report:

### What happened?

Sharding the PR e2e lane directly at the workflow job level changes the
emitted check names to shard-specific names, while existing branch
protection expects a check named exactly `e2e`.

### Expected behavior

The PR workflow should be able to run e2e specs across multiple runners
while still emitting a stable aggregate check named `e2e`.

### Steps to reproduce

1. Open a PR against `master`.
2. Run the PR workflow with the e2e lane split only as a matrix job.
3. Observe that the shard checks complete, but a required check named
exactly `e2e` never appears.

### Paperclip version or commit

Current `master`.

### Deployment mode

GitHub Actions pull request workflow.

## What Changed

- Added `scripts/e2e-shard.mjs`, which partitions default Playwright e2e
specs by recorded per-spec duration.
- Added `scripts/e2e-shard-durations.json` with measured e2e spec
durations so the slow smoke-lab spec does not dominate one runner.
- Split the PR workflow e2e lane into two `e2e_shards` matrix jobs and
added a fast aggregate job named exactly `e2e`.
- Added `scripts/__tests__/e2e-shard.test.mjs` to lock the shard
partition, ignored-spec sync, manifest coverage, and aggregate
required-check contract.

## Verification

- `node --test scripts/__tests__/e2e-shard.test.mjs`
- `node --test scripts/__tests__/run-vitest-stable-shard.test.mjs`
- `git diff --check upstream/master..HEAD`
- Searched GitHub for duplicate or related e2e-shard / required-check
PRs and issues before opening this PR; no direct duplicate was found.

## Risks

Low risk. The main risk is that the duration manifest can drift as specs
are added or runtimes change; missing specs fall back to the median
known duration, and the focused shard test catches empty, overlapping,
or badly imbalanced partitions.

## Model Used

OpenAI GPT-5 via Codex CLI coding agent, with shell/tool execution and
repository inspection.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-07-20 16:40:19 -07:00
..
__tests__ fix(ci): preserve required e2e check for sharded runs (#9923) 2026-07-20 16:40:19 -07:00
mcp-fixtures feat(mcp) [split 1/8]: add fixture demo servers (#9556) 2026-07-14 12:56:21 -05:00
smoke feat(mcp) [split 1/8]: add fixture demo servers (#9556) 2026-07-14 12:56:21 -05:00
backfill-issue-reference-mentions.ts
…
backup-db.sh
…
bootstrap-npm-package.mjs
…
bootstrap-npm-package.test.mjs
…
build-npm.sh
…
build-standalone-public-packages.mjs
…
capture-pap-2351-binding-picker.mjs
…
check-docker-deps-stage.mjs
…
check-forbidden-tokens.mjs
…
check-no-git-push.mjs
…
check-no-git-push.test.mjs
…
check-release-package-bootstrap.mjs
…
check-release-package-bootstrap.test.mjs
…
check-token-gates.mjs
…
clean-onboard-git.sh
…
clean-onboard-npm.sh
…
clean-onboard-ref.sh
…
codemod-extract-colors.mjs
…
codemod-extract-misc.mjs
…
codemod-extract-sizes.mjs
…
codemod-extract-type.mjs
…
codemod-type-ladder.mjs
…
create-github-release.sh
…
dev-runner-output.mjs
…
dev-runner-output.ts
…
dev-runner-paths.mjs
…
dev-runner-snapshot.mjs
…
dev-runner.mjs
…
dev-runner.ts
…
dev-service-profile.ts
…
dev-service.ts
…
discord-daily-digest.sh
…
docker-build-test.sh
…
docker-entrypoint.sh
…
docker-onboard-smoke.sh
…
e2e-mcp-user-stories.mjs feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
e2e-shard-durations.json fix(ci): preserve required e2e check for sharded runs (#9923) 2026-07-20 16:40:19 -07:00
e2e-shard.mjs fix(ci): preserve required e2e check for sharded runs (#9923) 2026-07-20 16:40:19 -07:00
ensure-plugin-build-deps.mjs
…
ensure-workspace-package-links.ts
…
extract-proposed-events.mjs Add telemetry proposal extractor (#9544) 2026-07-13 23:47:27 -07:00
extract-proposed-events.test.mjs Add telemetry proposal extractor (#9544) 2026-07-13 23:47:27 -07:00
general-server-shard-durations.json perf(ci): balance general-server test shards by recorded suite duration (#9516) 2026-07-13 12:25:54 -07:00
general-server-shard.mjs perf(ci): balance general-server test shards by recorded suite duration (#9516) 2026-07-13 12:25:54 -07:00
generate-company-assets.ts
…
generate-npm-package-json.mjs
…
generate-org-chart-images.ts
…
generate-org-chart-satori-comparison.ts
…
generate-plugin-package-json.mjs
…
generate-ui-package-json.mjs
…
kill-agent-browsers.sh
…
kill-dev.sh
…
kill-vitest.sh
…
kill-workspaces.sh
…
link-plugin-dev-sdk.mjs
…
link-plugin-dev-sdk.test.js
…
measure-issue-chat-long-thread.mjs
…
migrate-inline-env-secrets.ts
…
paperclip-commit-metrics.ts
…
paperclip-issue-update.sh
…
prepare-server-ui-dist.sh
…
provision-worktree.sh feat(mcp) [split 5/8]: integrate adapters and deployment runtime (#9560) 2026-07-14 15:15:43 -05:00
release-lib.sh
…
release-lib.test.mjs
…
release-package-manifest.json feat(mcp) [split 1/8]: add fixture demo servers (#9556) 2026-07-14 12:56:21 -05:00
release-package-map.mjs
…
release-package-map.test.mjs
…
release-registry-versions.mjs
…
release-registry-versions.test.mjs
…
release.sh Fix stable release dry-run notes gate (#9334) 2026-07-13 21:11:07 -05:00
request-hot-restart.ts fix(server): restore hot-restart run adoption (#9647) 2026-07-16 02:46:09 -05:00
rollback-latest.sh
…
run-typecheck-build-gaps.mjs
…
run-vitest-stable.mjs perf(ci): balance general-server test shards by recorded suite duration (#9516) 2026-07-13 12:25:54 -07:00
screenshot-blocked-inbox.mjs
…
screenshot-file-viewer.mjs
…
screenshot-fork-flow.mjs
…
screenshot-one.mjs
…
screenshot-pap2373.mjs
…
screenshot-recovery-card.cjs
…
screenshot-subissues.mjs
…
screenshot-verdicts.mjs
…
screenshot.cjs
…
serve-storybook-static.mjs
…
storybook-visual-baseline.mjs
…
verify-release-registry-state.mjs
…
verify-release-registry-state.test.mjs
…