Skip to content

Fix tests and add header detection test for fedify/next - #977

Closed
Bananamilk452 wants to merge 3 commits into
fedify-dev:mainfrom
Bananamilk452:add-fedify-next-test
Closed

Fix tests and add header detection test for fedify/next#977
Bananamilk452 wants to merge 3 commits into
fedify-dev:mainfrom
Bananamilk452:add-fedify-next-test

Conversation

@Bananamilk452

Copy link
Copy Markdown
Contributor

Description

  • Fix check-each and test-each is not working in fedify/next
  • Add Accept header test
  • Add Content-Type test

Github Copilot helped me making title of this PR, gpt-5.6-terra helped checking code quality.

@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for fedify-json-schema canceled.

Name Link
🔨 Latest commit ede1cc4
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6a6d85911ccbd80008439891

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d1eef480-a3e4-45fb-92bc-66d382c65b56

📥 Commits

Reviewing files that changed from the base of the PR and between a12b58e and ede1cc4.

⛔ Files ignored due to path filters (1)
  • deno.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • deno.json
  • packages/next/deno.json
  • packages/next/src/index.test.ts
  • packages/next/src/index.ts

📝 Walkthrough

Walkthrough

The PR adds packages/next to the Deno workspace, defines its package configuration, updates the NextResponse import path, updates root import mappings, and adds tests for ActivityPub request detection.

Changes

Next.js package integration

Layer / File(s) Summary
Workspace and package setup
deno.json, packages/next/deno.json
The Deno workspace includes the required packages and example directory. Root import mappings and @fedify/next package metadata, exports, dependencies, exclusions, publish files, and tasks are defined.
Next.js runtime import
packages/next/src/index.ts
The NextResponse import uses the explicit next/server.js module path.
Federation request validation
packages/next/src/index.test.ts
Tests verify ActivityPub request detection from Accept and Content-Type headers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • fedify-dev/fedify#866: Adds the Accept-header test for isFederationRequest.
  • fedify-dev/fedify#867: Adds the Content-Type detection test for isFederationRequest.

Possibly related PRs

Suggested labels: component/integration

Suggested reviewers: 2chanhaeng, dahlia

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the test fixes and header detection tests for fedify/next.
Description check ✅ Passed The description directly summarizes the fedify/next test fixes and the added Accept and Content-Type header tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch add-fedify-next-test
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/next/src/index.test.ts`:
- Line 1: Update the test harness import in the package’s test file to use the
built-in test symbol from node:test instead of `@fedify/fixture`, leaving the
request-detection tests unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0a2cb1df-fdf1-4c40-8eda-55a326521d39

📥 Commits

Reviewing files that changed from the base of the PR and between 9b6f025 and a12b58e.

⛔ Files ignored due to path filters (1)
  • deno.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • deno.json
  • packages/next/deno.json
  • packages/next/src/index.test.ts
  • packages/next/src/index.ts

@@ -0,0 +1,24 @@
import { test } from "@fedify/fixture";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use node:test as the test harness.

Line 1 imports test from @fedify/fixture, although this file tests pure request-detection logic and uses no fixture utility. Import test from node:test instead.

Based on learnings, new-package tests in this repository use Node’s built-in node:test harness.

Proposed fix
-import { test } from "`@fedify/fixture`";
+import { test } from "node:test";
📝 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
import { test } from "@fedify/fixture";
import { test } from "node:test";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/next/src/index.test.ts` at line 1, Update the test harness import in
the package’s test file to use the built-in test symbol from node:test instead
of `@fedify/fixture`, leaving the request-detection tests unchanged.

Source: Learnings

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