Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a9787ef
chore(repo): Improve express e2e tests
wobsoriano Aug 9, 2025
dc8c7be
chore: placeholder changeset
wobsoriano Aug 9, 2025
58191b1
chore(express): Deprecate enableHandshake option
wobsoriano Aug 9, 2025
1707c12
chore: add changeset
wobsoriano Aug 9, 2025
56867b2
add machine secret key to custom authenticate request
wobsoriano Aug 9, 2025
757ea76
add jsdoc
wobsoriano Aug 9, 2025
dc77a3f
fix changeset
wobsoriano Aug 9, 2025
ebff149
update jsdoc
wobsoriano Aug 9, 2025
4f0bd61
add back deprecated option but keep deprecated status
wobsoriano Aug 9, 2025
ebd8b96
update changeset
wobsoriano Aug 9, 2025
398c3cf
init m2m e2e
wobsoriano Aug 9, 2025
7fad6ca
chore(repo): Add machine-to-machine e2e tests
wobsoriano Aug 9, 2025
48bc893
improvements
wobsoriano Aug 9, 2025
2fa0b44
clean up long running apps
wobsoriano Aug 9, 2025
98b79d7
add turbo entry for machine tests
wobsoriano Aug 9, 2025
91a7e56
revert package versions
wobsoriano Aug 9, 2025
c224d6f
Merge branch 'main' into rob/m2m-e2e
wobsoriano Aug 11, 2025
b52c3b9
Merge branch 'main' into rob/m2m-e2e
wobsoriano Aug 11, 2025
45a490d
ci: add machine to tests
wobsoriano Aug 11, 2025
268c92b
simplify test
wobsoriano Aug 11, 2025
8807419
fix tests
wobsoriano Aug 11, 2025
2dff52b
add jsdoc description for secondsUntilExpiration
wobsoriano Aug 11, 2025
b628254
chore: add changeset
wobsoriano Aug 11, 2025
f3837b1
chore(repo): Group related machine auth tests
wobsoriano Aug 11, 2025
630410f
Merge branch 'main' into rob/machine-e2e-tests-cleanup
wobsoriano Aug 12, 2025
8f4f54a
chore: placeholder changeset
wobsoriano Aug 12, 2025
aa7b09b
fix tests
wobsoriano Aug 12, 2025
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/eighty-plums-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Empty Changeset is likely non-actionable and may confuse/impact the release workflow

This file only contains YAML front matter delimiters with no package bumps or summary. Depending on your Changesets setup, this can either be ignored or cause CI confusion. For test-only/grouping changes, prefer either removing the changeset entirely or adding a proper bump if a release is intended.

  • If no release is intended: remove this file.
  • If a release is intended: specify the packages and bump type, plus a short summary.

Run the following to inspect repo configs and references to the Changesets workflow to ensure an empty changeset is acceptable here:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "List changeset files:"
fd -a '^.+\.md$' .changeset || true

echo -e "\nShow Changesets config (if present):"
if [ -f ".changeset/config.json" ]; then
  cat .changeset/config.json
else
  echo "No .changeset/config.json found"
fi

echo -e "\nLook for GH Actions using changesets:"
fd -a ".github/workflows" | xargs -I{} rg -n "changeset|Changesets" {} || true

echo -e "\nSearch for Danger/CI rules that mandate changesets:"
rg -n "changeset|Changesets|require-changeset|no-changeset" -S . || true

echo -e "\nIf CI requires a changeset for every PR, confirm if an 'empty' changeset is allowed or if a special label should be used instead."

Length of output: 14405


Clarify Intent for This Empty Changeset

This file is an intentionally empty changeset (just the --- front-matter) created by pnpm changeset:empty. Per our CONTRIBUTING guide, empty changesets are supported as an “escape hatch” for internal refactors or test-only PRs and will not generate any changelog entries.

• If you intended not to produce a release or changelog entry, no further action is needed.
• If you do want to publish changes, update this file’s front-matter to list the affected package(s), bump type (patch/minor/major), and add a brief summary.

🤖 Prompt for AI Agents
In .changeset/eighty-plums-listen.md around lines 1 to 2, the changeset contains
only empty front-matter (---) so you must either leave it as-is if this PR is
intentionally test/internal and shouldn't produce a release, or update the
front-matter to declare the affected package(s), bump type, and a short summary;
to fix it, replace the front-matter with a YAML block listing the package names
and their release types (patch/minor/major) and add a one-line summary
describing the change so the changeset will generate a changelog/release for
those packages.

Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Invalid/empty Changeset frontmatter will break the Changesets pipeline

The file only contains an empty frontmatter block (------) without any package release entries or summary. This typically causes the Changesets step to fail parsing.

Action:

  • Either remove the changeset if your repo allows test-only PRs without a changeset, or
  • Populate it with valid entries (use none for all relevant packages if you do not intend to publish), and add a short summary line.

Example template (replace PACKAGE_NAME with actual workspace package names):

---
'PACKAGE_NAME': none
---

chore(repo): Group related machine auth tests

I can help enumerate workspace package names to fill this properly if needed.

🤖 Prompt for AI Agents
.changeset/eighty-plums-listen.md lines 1-2: the changeset contains only an
empty frontmatter block which breaks the Changesets pipeline; either delete the
file if this PR shouldn't include a changeset, or replace the empty frontmatter
with valid frontmatter listing workspace package names and release types (use
'none' for packages you don't intend to publish) and add a short summary body
line beneath the frontmatter (e.g. three lines: frontmatter mapping, closing
dashes, and a one-line summary).

3 changes: 1 addition & 2 deletions integration/presets/longRunningApps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const createLongRunningApps = () => {
{ id: 'next.appRouter.withSignInOrUpFlow', config: next.appRouter, env: envs.withSignInOrUpFlow },
{ id: 'next.appRouter.withSignInOrUpEmailLinksFlow', config: next.appRouter, env: envs.withSignInOrUpEmailLinksFlow },
{ id: 'next.appRouter.withSessionTasks', config: next.appRouter, env: envs.withSessionTasks },
{ id: 'next.appRouter.withAPIKeys', config: next.appRouter, env: envs.withAPIKeys },
{ id: 'next.appRouter.withLegalConsent', config: next.appRouter, env: envs.withLegalConsent },

/**
Expand All @@ -49,9 +48,9 @@ export const createLongRunningApps = () => {

/**
* Machine auth apps
* TODO(rob): Group other machine auth apps together (api keys, m2m tokens, etc)
*/
{ id: 'withMachine.express.vite', config: express.vite, env: envs.withAPIKeys },
{ id: 'withMachine.next.appRouter', config: next.appRouter, env: envs.withAPIKeys },

/**
* Vite apps - basic flows
Expand Down
2 changes: 1 addition & 1 deletion integration/tests/machine-auth/api-keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { appConfigs } from '../../presets';
import type { FakeAPIKey, FakeUser } from '../../testUtils';
import { createTestUtils } from '../../testUtils';

test.describe('Next.js API key auth within clerkMiddleware() @nextjs', () => {
test.describe('Next.js API key auth within clerkMiddleware() @machine', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Switched tag to @machine — ensure tag-based runners are updated

The suite label now ends with "@machine". If your CI or dev tooling filters by tags (e.g., to shard or selectively run tests), update those filters accordingly. Consider tagging related suites consistently for easier targeting (e.g., also tagging Next.js-specific cases with @machine if they belong to the same group).

Run this to audit tag usage patterns in this file and related tests:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Tags in this file:"
rg -n --hidden -S "@[a-zA-Z0-9_-]+" integration/tests/machine-auth/api-keys.test.ts

echo
echo "All '@machine' test labels across machine-auth tests:"
rg -n --hidden -S "@machine" integration/tests/machine-auth

Length of output: 1249


Align test suite tagging for consistent filtering

There are two suites in integration/tests/machine-auth/api-keys.test.ts:

  • Line 10: tagged @machine
  • Line 100: tagged @nextjs only

If you want Next.js–specific machine-auth tests to run when filtering by @machine, add the @machine tag to the second suite. Otherwise, update your CI/dev-tool filters to account for @nextjs-only suites.

• File: integration/tests/machine-auth/api-keys.test.ts
– Line 100: include @machine alongside @nextjs

Suggested diff:

-test.describe('Next.js API key auth within routes @nextjs', () => {
+test.describe('Next.js API key auth within routes @nextjs @machine', () => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
test.describe('Next.js API key auth within clerkMiddleware() @machine', () => {
test.describe('Next.js API key auth within routes @nextjs @machine', () => {
🤖 Prompt for AI Agents
In integration/tests/machine-auth/api-keys.test.ts around lines 10 and 100, the
second test suite at line 100 is tagged only with @nextjs while the first suite
is tagged @machine; update the second suite to include @machine alongside
@nextjs (e.g., add " @machine" to the suite's tag list) so filtering by @machine
includes both suites, or alternatively adjust CI/test filters if you intend to
keep it @nextjs-only.

test.describe.configure({ mode: 'parallel' });
let app: Application;
let fakeUser: FakeUser;
Expand Down
5 changes: 4 additions & 1 deletion integration/tests/machine-auth/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { appConfigs } from '../../presets';
import type { FakeOrganization, FakeUser } from '../../testUtils';
import { createTestUtils, testAgainstRunningApps } from '../../testUtils';

testAgainstRunningApps({ withEnv: [appConfigs.envs.withAPIKeys] })('api keys @generic', ({ app }) => {
testAgainstRunningApps({
withEnv: [appConfigs.envs.withAPIKeys],
withPattern: ['withMachine.next.appRouter'],
})('api keys component @machine', ({ app }) => {
test.describe.configure({ mode: 'serial' });

let fakeAdmin: FakeUser;
Expand Down
Loading