Support Astro 6 and 7 with real compatibility tests#936
Conversation
Broaden @fedify/astro's peer range and add a compatibility harness that builds and exercises Astro 5, 6, and 7 across the supported runtimes. Move the Astro example and initializer to Astro 7, pin scaffolding to the matching template, and use the Node standalone adapter for Bun. Run the compatibility suite and example builds in their own workflow, and update the documentation. fedify-dev#931 fedify-dev#936 Assisted-by: Codex:gpt-5.6-sol
✅ Deploy Preview for fedify-json-schema canceled.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughUpdates ChangesAstro package and initializer baseline
Real Astro compatibility harness
Example builds and CI integration
Documentation and release notes
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CI
participant CompatibilityRunner
participant AstroApp
participant HTTPAssertions
CI->>CompatibilityRunner: run Astro compatibility task
CompatibilityRunner->>AstroApp: install, build, and start fixture
CompatibilityRunner->>AstroApp: wait for readiness
HTTPAssertions->>AstroApp: request HTML, ActivityPub, WebFinger, 404, and 406 routes
AstroApp-->>HTTPAssertions: return rendered responses and headers
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds and tests support for Astro 6 and 7 while maintaining compatibility with Astro 5. It updates the Astro example and fedify init templates to use Astro 7, and switches the Bun runtime adapter from the Astro-5-only @nurodev/astro-bun to @astrojs/node in standalone mode. Additionally, a new compatibility test suite has been introduced to verify @fedify/astro across different Astro and runtime versions. Feedback on these changes includes correcting a file path formatting style in the documentation and avoiding a hardcoded port for Deno in the compatibility runner to prevent potential port collisions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@codex review |
Use the runtime's official name in changelog entries, migration guidance, and tutorial prose instead of shortening it to Node. fedify-dev#936 Assisted-by: Codex:gpt-5.6-sol
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 @.github/workflows/examples.yaml:
- Line 14: Update both actions/checkout steps in the workflow to pin the action
to a specific commit SHA instead of the v6 tag, and set persist-credentials to
false. Apply the same hardening to the checkout step referenced at the
additional location while preserving the existing job behavior.
- Around line 11-16: Add an explicit top-level permissions block to the
workflow, granting only contents: read for the checkout and test steps. Keep the
existing test-astro-compat job steps unchanged.
In `@packages/init/src/test/create.ts`:
- Around line 173-192: Update validateFrameworkBuild so Astro projects using
Deno are not excluded by the early-return condition. Allow the existing
build-command execution and result validation to run for the supported
Astro/Deno combination while preserving the skip behavior for non-Astro
frameworks.
🪄 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
Run ID: 491ba7f7-811a-466c-86f2-d48f0cf18db9
⛔ Files ignored due to path filters (2)
deno.lockis excluded by!**/*.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (25)
.github/workflows/examples.yamlCHANGES.mddeno.jsondocs/manual/integration.mddocs/tutorial/astro-blog.mdexamples/astro/README.mdexamples/astro/astro.config.bun.tsexamples/astro/deno.jsonexamples/astro/package.jsonexamples/astro/src/middleware.tsmise.tomlpackages/astro/README.mdpackages/astro/compat/astro.config.mjs.tplpackages/astro/compat/run.tspackages/astro/compat/src/federation.tspackages/astro/compat/src/middleware.tspackages/astro/compat/src/pages/users/[identifier].astropackages/astro/package.jsonpackages/init/src/json/deps.jsonpackages/init/src/lib.tspackages/init/src/package.test.tspackages/init/src/templates/astro/astro.config.bun.ts.tplpackages/init/src/test/create.tspackages/init/src/webframeworks/astro.tspnpm-workspace.yaml
Follow the documentation convention for file paths in the example's implementation overview. fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
Give the workflow read-only repository access and prevent checkout from persisting credentials before dependency install and build steps run. fedify-dev#936 (comment) fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
Give each Deno compatibility server a reserved port and embed that port in the adapter configuration at build time. Generate npm-backed dependencies that Vite can resolve, then build generated Deno projects with local package links exposed through node_modules. fedify-dev#936 (comment) fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for Astro 6 and 7 while maintaining compatibility with Astro 5, replacing the Astro-5-only @nurodev/astro-bun adapter with @astrojs/node in standalone mode for Bun, and introducing a compatibility test suite. Feedback on these changes focuses on improving robustness and maintainability: specifically, ensuring fetched response bodies are cancelled in the test runner to prevent resource leaks, resolving cross-platform path issues on Windows by normalizing backslashes in file: dependencies, using lstat instead of stat to safely handle broken symlinks, and dynamically referencing dependency versions from deps.json in test assertions to avoid fragile hardcoded values.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Use package-relative tarball references so pnpm receives portable file specifiers on every platform. Cancel response bodies even when status assertions fail so repeated compatibility cases do not leak resources. fedify-dev#936 (comment) fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
Inspect workspace link entries without following them. This keeps a broken symlink from being mistaken for a missing path and avoids trying to recreate an entry that already exists. fedify-dev#936 (comment) fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
Read initializer dependency expectations from deps.json so routine version updates do not leave the Astro assertions stale or require a second set of hardcoded versions to be maintained. fedify-dev#936 (comment) fedify-dev#936 (comment) fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
|
/gemini review |
|
@codex review |
There was a problem hiding this comment.
Code Review
This pull request adds and tests support for Astro 6 and 7 within the @fedify/astro package while maintaining compatibility with Astro 5. Key changes include upgrading default dependencies to Astro 7 and @astrojs/node 11, replacing the Astro-5-only @nurodev/astro-bun adapter with @astrojs/node in standalone mode for Bun runtimes, and introducing a comprehensive compatibility test suite (packages/astro/compat/run.ts). Additionally, documentation, examples, and the @fedify/init templates have been updated to align with these upgrades. There are no review comments to address in this pull request.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Code Review
This pull request adds and tests support for Astro 6 and 7 in @fedify/astro while maintaining Astro 5 compatibility. It updates templates and examples to use Astro 7, replacing the Astro-5-only @nurodev/astro-bun adapter with @astrojs/node in standalone mode for Bun, and introduces a compatibility test suite. Feedback on the new test runner (run.ts) highlights a potential deadlock issue when spawning the test server with piped stdout/stderr without actively consuming them in the background, which could cause the readiness check to time out, as well as a potential block when calling process.output() on already-consumed streams.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Document that the JSR package remains available while Deno-based Astro projects use npm packages because Vite resolves their bare imports from node_modules. Keep the same rationale beside the initializer dependency selection so it is not mistaken for an accidental registry choice. fedify-dev#936 Assisted-by: Codex:gpt-5.6-sol
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4c4742cf5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Consume stdout and stderr as soon as the compatibility server starts so its pipe buffers cannot block readiness checks. Reuse those background reads when reporting a failed server run. fedify-dev#936 (comment) fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
Normalize Fedify KV and message queue adapters to npm in Deno-based Astro projects so Vite can resolve non-default backends from node_modules. Keep the Deno lint plugin on JSR because Vite does not load it. fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
|
@codex review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for Astro 6 and 7 in @fedify/astro while maintaining Astro 5 compatibility, updating examples, templates, and documentation accordingly. Notably, the Bun adapter configuration has been migrated from @nurodev/astro-bun to @astrojs/node in standalone mode, and a new compatibility test suite has been added. Feedback on the compatibility test runner (packages/astro/compat/run.ts) highlights a cross-platform issue where calling process.kill("SIGTERM") will fail on Windows, potentially leaking background server processes; using SIGKILL or checking the OS is recommended to resolve this.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2627705004
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/astro/README.md (1)
54-67: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMake the middleware composition example self-contained.
otherMiddlewareis never declared or imported, so copying this example into a TypeScript middleware file produces an unresolved identifier. Add a minimalMiddlewareHandlerdefinition or explicitly mark it as a project-provided placeholder.Proposed fix
import { fedifyMiddleware } from "`@fedify/astro`"; +import type { MiddlewareHandler } from "astro"; import { sequence } from "astro:middleware"; import federation from "./federation.ts"; +const otherMiddleware: MiddlewareHandler = async (_context, next) => next(); + export const onRequest = sequence( otherMiddleware,🤖 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/astro/README.md` around lines 54 - 67, Add a self-contained declaration for otherMiddleware in the middleware composition example, importing MiddlewareHandler as a type from astro and defining a minimal pass-through handler before onRequest. Keep the existing fedifyMiddleware and sequence composition unchanged.
🤖 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/astro/compat/run.ts`:
- Around line 199-200: Add SIGKILL escalation to the shutdown handling around
the process managed by main: after sending SIGTERM, wait only a short grace
period while allowing normal process.status completion, then send SIGKILL if the
child remains alive. Ensure the finally path cannot hang when SIGTERM is
ignored, while preserving graceful shutdown for processes that exit promptly.
---
Outside diff comments:
In `@packages/astro/README.md`:
- Around line 54-67: Add a self-contained declaration for otherMiddleware in the
middleware composition example, importing MiddlewareHandler as a type from astro
and defining a minimal pass-through handler before onRequest. Keep the existing
fedifyMiddleware and sequence composition 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
Run ID: c1986675-495e-454a-9075-ec9ae3346bd4
📒 Files selected for processing (6)
docs/manual/integration.mdpackages/astro/README.mdpackages/astro/compat/run.tspackages/init/src/action/configs.test.tspackages/init/src/action/deps.tspackages/init/src/webframeworks/astro.ts
Declare the additional middleware in the composition example so readers can copy a self-contained, type-checked sequence without inventing the missing handler. fedify-dev#936 (review) Assisted-by: Codex:gpt-5.6-sol
Use an immediate hard kill on Windows and allow a short graceful shutdown period elsewhere before escalating to SIGKILL. This prevents compatibility tests from leaking servers or waiting forever for an ignored signal. fedify-dev#936 (comment) fedify-dev#936 (comment) fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
Check for Node.js 22.12 or later before npm, pnpm, or Yarn scaffolds an Astro 7 project. Deno and Bun paths keep using their own runtimes and do not need the Node.js guard. fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
|
@codex review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for Astro 6 and 7 in @fedify/astro while maintaining Astro 5 compatibility. It updates the Astro example and fedify init templates to use Astro 7, replaces the Astro-5-only @nurodev/astro-bun adapter with @astrojs/node in standalone mode for Bun, and adds a compatibility test suite. Documentation and initialization logic have also been updated to reflect these changes and ensure proper Vite resolution for Deno. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d49afcbcb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Run the Deno and Bun compatibility builds through their own Astro command paths instead of using a Node.js/pnpm build for every case. This lets the matrix catch runtime-specific package resolution and build failures. fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
|
@codex review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for Astro 6 and 7 to @fedify/astro while maintaining compatibility with Astro 5. It updates the fedify init templates, examples, and documentation to use Astro 7, and replaces the Astro-5-only @nurodev/astro-bun adapter with @astrojs/node in standalone mode for Bun runtimes. Additionally, a compatibility test suite has been introduced to verify @fedify/astro across different Astro versions and runtimes. Feedback on the changes suggests wrapping the temporary directory cleanup in a try/catch block within the test runner's finally block to prevent cleanup errors from masking primary test failures.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4fd7345ba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Include the supported Astro range in generated Deno tasks and the Deno compatibility build. This prevents a future npm default from silently changing the CLI major used with an Astro 7 project or matrix case. fedify-dev#936 (comment) fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
Log temporary-directory cleanup errors when a compatibility case has already failed, so cleanup cannot hide the original diagnostic. Cleanup failures still fail otherwise successful cases instead of passing silently. fedify-dev#936 (comment) Assisted-by: Codex:gpt-5.6-sol
|
@codex review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for Astro 6 and 7 in @fedify/astro while maintaining backward compatibility with Astro 5. Key changes include updating the Astro example and fedify init templates to use Astro 7 and @astrojs/node 11, replacing the Astro-5-only @nurodev/astro-bun adapter with @astrojs/node in standalone mode for Bun runtimes, and adding a comprehensive compatibility test suite (packages/astro/compat/run.ts) to verify integrations across different Astro and runtime versions. Additionally, documentation, examples, and initializer scripts have been updated to reflect these upgrades and guide users on middleware composition using sequence(). No review comments were provided, so there is no feedback to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Pre-release has been published for this pull request: Packages
DocumentationThe docs for this pull request have been published: |
Closes #931.
Why this approach
The integration relies on Astro APIs that remained stable across Astro 5, 6, and 7, but its peer dependency and tests did not establish that compatibility. The old tests exercised mocked Astro contexts, which could not catch failures in Vite SSR configuration, adapter peer dependencies, server output, or request routing in a built application.
This PR keeps the supported range explicit at Astro 5–7. Astro 8 will therefore require its own compatibility work instead of being accepted automatically. The repository's development catalog moves to Astro 7 so normal builds and type checks use the newest supported major, while a separate compatibility task protects the older majors.
How compatibility is verified
The compatibility runner in packages/astro/compat/run.ts packs the local Fedify packages, installs them into a minimal Astro application with strict peer dependency checks, and builds a server for each supported Astro major. It then starts the built application and makes real HTTP requests rather than calling the middleware with a mocked context.
The requests cover the boundary between Astro and Fedify: HTML falls through to an Astro page on a shared route, ActivityPub and WebFinger requests are handled by Fedify, unrelated routes retain Astro's 404 response, and an unacceptable representation returns 406 with
Vary: Accept. The fixture also usessequence()so middleware composition is exercised by the same test.Astro 5, 6, and 7 are paired with Node.js adapter majors 9, 10, and 11. Astro 7 is also built and run with Deno and Bun. Bun uses the Node.js standalone adapter because the previous Bun-specific adapter only declares support for Astro 5; the generated server has been tested under Bun instead of relying on that incompatible peer range.
How generated projects avoid version drift
The Astro initializer now generates Astro 7 projects with matching Node.js and Deno adapters. It pins both the
create-astromajor and the Astro repository template ref, rather than combining a futureastro@latestscaffold with pinned Astro 7 dependencies. The initializer tests assert those versions and build generated Node.js/Bun projects after installation, which catches template and adapter mismatches at the point users would encounter them.The Astro example follows the same runtime configurations as generated projects. Its Node.js/Deno/Bun builds and the compatibility suite run in .github/workflows/examples.yaml, keeping example and framework compatibility checks separate from the already broad main workflow.
The integration guide, packages/astro/README.md, examples/astro/README.md, and docs/tutorial/astro-blog.md explain why Fedify needs on-demand rendering, how HTML and ActivityPub can share a route, how to compose middleware, and which adapters are tested for each runtime.
Verification
mise run checkmise run test-each astro initmise run test:astro-compatactionlintfor .github/workflows/examples.yaml