Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .changeset/hotload-boundary-review-gate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@
- [ ] `pnpm build` runs as expected.
- [ ] (If applicable) [JSDoc comments](https://jsdoc.app/about-getting-started.html) have been added or updated for any package exports
- [ ] (If applicable) [Documentation](https://github.com/clerk/clerk-docs) has been updated
- [ ] (If applicable) Hotload-boundary review completed for Clerk core / IsomorphicClerk changes.

<!--
Complete the hotload-boundary review item when this PR changes:
- packages/clerk-js/src/core/clerk.ts
- packages/react/src/isomorphicClerk.ts

Non-major releases in packages/clerk-js and packages/ui can hotload into
applications that still have older framework SDKs or @clerk/shared installed.
If this PR removes, renames, or changes a Clerk / IsomorphicClerk member,
explicitly document whether older installed packages consume it across that
hotload boundary. A cross-boundary member needs a compatibility shim,
deprecation plan, or major-version removal plan.
-->

## Type of change

Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/hotload-boundary-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Hotload Boundary Review

on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
branches:
- main
- release/v4
- release/core-2

permissions:
contents: read
pull-requests: read

jobs:
clerk-core-review:
name: Clerk Core Review Gate
if: ${{ github.event.pull_request.draft == false }}
runs-on: ${{ vars.RUNNER_NORMAL || 'ubuntu-latest' }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_SHORT && fromJSON(vars.TIMEOUT_MINUTES_SHORT) || 3 }}
steps:
- name: Verify hotload-boundary review
uses: actions/github-script@v7
with:
script: |
const guardedPaths = new Set([
'packages/clerk-js/src/core/clerk.ts',
'packages/react/src/isomorphicClerk.ts',
]);
const markerPattern =
/- \[[xX]\] \(If applicable\) Hotload-boundary review completed for Clerk core \/ IsomorphicClerk changes\./;

const { owner, repo } = context.repo;
const pull_number = context.payload.pull_request.number;
const files = await github.paginate(github.rest.pulls.listFiles, {
owner,
repo,
pull_number,
per_page: 100,
});
const touchedGuardedPaths = files
.map(file => file.filename)
.filter(filename => guardedPaths.has(filename));

if (touchedGuardedPaths.length === 0) {
core.info('No Clerk core hotload-boundary files changed.');
return;
}

await core.summary
.addHeading('Hotload Boundary Review')
.addRaw(
'This PR changes files that define Clerk runtime members consumed across hotloaded package boundaries.\n\n',
)
.addList(touchedGuardedPaths)
.addRaw(
'\nConfirm the PR template checklist item after reviewing whether changed `Clerk` / `IsomorphicClerk` members are consumed by older installed SDK packages.\n',
)
.write();

const body = context.payload.pull_request.body ?? '';
if (!markerPattern.test(body)) {
core.setFailed(
[
'This PR changes Clerk core hotload-boundary files:',
...touchedGuardedPaths.map(path => `- ${path}`),
'',
'Check the PR template item "Hotload-boundary review completed for Clerk core / IsomorphicClerk changes." after documenting the compatibility decision.',
'Non-major Clerk.js and UI releases can hotload into apps with older installed SDK packages, so removals or renames need a compatibility shim, deprecation plan, or major-version removal plan.',
].join('\n'),
);
}
Loading