Skip to content

[EW | test gates] dev: ew definition of done#379

Draft
anfibiacreativa wants to merge 6 commits intoewfrom
feat/ew-definition-of-done
Draft

[EW | test gates] dev: ew definition of done#379
anfibiacreativa wants to merge 6 commits intoewfrom
feat/ew-definition-of-done

Conversation

@anfibiacreativa
Copy link
Copy Markdown
Member

[EW] Definition of Done — PR template, CI check, and pre-push E2E gate

Summary

  • Adds a selectable [EW] pull request template with a consolidated Definition of Done checklist (functional, quality, architecture/contracts, Skills Lab, E2E, security, branch hygiene).
  • Adds a GitHub Actions workflow that validates required checklist items are checked on PRs targeting ew, with conditional Skills Lab sub-checks when the "Skills Lab changed in this PR" box is ticked.
  • Updates the default PR template with a pointer to the EW template for Experience Builder work.
  • Adds a Husky pre-push hook that maps changed source paths to their matching Playwright E2E spec(s) in the sibling da-live checkout and runs only the relevant specs before a push is allowed.

Why

  • Experience Builder work needs tighter, consistent quality gates than the default PR template provides.
  • The Skills Lab migration from exp-workspace to feat/experience-builder has behavioral contracts (data model, dual storage, .md wins merge rule, public CSS selectors, DA admin API surface) that must not regress silently.
  • CI-only validation is too late; developers should catch regressions locally on push rather than after opening a PR.

What Changed

PR template + CI enforcement

  • .github/PULL_REQUEST_TEMPLATE/ew_pr_template.md — selectable EW template with the full DoD checklist, conditional Skills Lab section, and public API reminders.
  • .github/workflows/ew-pr-checklist.yml — GH Actions job that parses the PR body, skips when the EW template isn't in use, fails when required items are unchecked, and additionally enforces Skills Lab sub-items when that box is ticked.
  • .github/pull_request_template.md — note added pointing to ?template=ew_pr_template.md for EW work.

Local pre-push gate

  • .husky/pre-push — Husky hook that:
    • reads commits being pushed,
    • matches changed paths against patterns (skills-lab, browse, canvas/form/quick-edit, loc, snapshot-admin, shared),
    • builds a deduplicated list of specs to run,
    • runs them via npx playwright test <specs> --project=chromium in ../da-live/test/e2e,
    • blocks the push on failure with a clear message,
    • is a no-op when no tracked paths are touched,
    • has commented placeholder blocks for canvas.spec.js / nav.spec.js ready to uncomment when those specs land.

Misc

  • .gitignorePR-throwaways/ entry so local PR drafts are never tracked.

Test Plan

  • Open a test PR targeting ew without the EW template → CI job runs and skips silently (green).
  • Open a test PR targeting ew using ?template=ew_pr_template.md with required items unchecked → CI job fails with a list of missing items.
  • Tick all required items → CI job passes.
  • Tick "Skills Lab changed in this PR" with its sub-items unchecked → CI job fails with Skills Lab-specific list.
  • Run git push from da-nx on a branch that doesn't touch any mapped path → hook exits immediately, push proceeds.
  • Run git push from da-nx on a branch that touches nx/blocks/skills-lab/** with da-live cloned as sibling → hook runs skills-lab.spec.js in chromium and blocks on failure.
  • Run git push without da-live as sibling → hook prints a helpful error and blocks.
  • git push --no-verify bypasses the hook cleanly.

Risks / Follow-ups

  • Risks:

    • CI enforcement is honor-system on the E2E checkbox — it doesn't actually run Playwright. The pre-push hook is the real enforcement, but only for developers who have the hook installed (npm install runs Husky's prepare).
    • pull_request_target trigger runs with base-branch permissions and PR body content. The workflow only reads text and doesn't checkout the PR, so the attack surface is minimal, but worth noting.
    • The hook assumes da-live is a sibling clone. If not present, the hook errors rather than silently skipping — intentional, but new contributors may be surprised.
  • Follow-ups:

    • Add a real CI Playwright run on PRs targeting main in da-live (so merging to main is gated regardless of local hooks).
    • Add mappings for canvas.spec.js / nav.spec.js when those specs are added to da-live.
    • Consider a lightweight npm run prepare reminder in the EW template so contributors activate Husky locally.

- .github/PULL_REQUEST_TEMPLATE/ew_pr_template.md — selectable [EW]
  template with consolidated DoD checklist (functional, quality,
  architecture/contracts, Skills Lab conditional, E2E, security,
  branch hygiene)
- .github/workflows/ew-pr-checklist.yml — GitHub Actions job that
  validates required DoD items are checked; enforces Skills Lab
  sub-checklist when "Skills Lab changed in this PR" is ticked
- .github/pull_request_template.md — adds pointer to EW template
  for Experience Builder work
Husky pre-push hook detects if commits touching Skills Lab source
files are being pushed, then automatically runs the 13 Playwright
E2E tests in ../da-live before allowing the push to proceed.

- Checks git diff of pushed range for nx/nx2 skills-lab paths
- Resolves da-live test dir relative to da-nx root (sibling clone)
- Errors with clear message if da-live is not found
- Push can be bypassed with --no-verify when intentionally skipping
Routes changed source paths to their matching Playwright E2E spec(s):
- skills-lab/skills-editor → skills-lab.spec.js
- browse → browse.spec.js
- canvas/form/quick-edit → edit.spec.js, formatting.spec.js
- form/loc → sheet.spec.js
- browse/shared → copy_rename.spec.js, delete.spec.js
- snapshot-admin/canvas → versions.spec.js

Canvas and nav specs stubbed as commented placeholders,
ready to uncomment when specs land in da-live.
Only runs specs relevant to what changed; no-ops on unrelated paths.
@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented Apr 21, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

@anfibiacreativa anfibiacreativa marked this pull request as draft April 21, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant