Skip to content

Load init logging on Fedify 2.1 templates#729

Merged
dahlia merged 2 commits intofedify-dev:2.1-maintenancefrom
dahlia:bugfix/astro-logging
Apr 27, 2026
Merged

Load init logging on Fedify 2.1 templates#729
dahlia merged 2 commits intofedify-dev:2.1-maintenancefrom
dahlia:bugfix/astro-logging

Conversation

@dahlia
Copy link
Copy Markdown
Member

@dahlia dahlia commented Apr 26, 2026

Summary

Fixes #725.

This backports the fedify init logging startup fix to 2.1-maintenance and completes it for the framework template that exists only on the 2.1 line.

The merged 2.0-maintenance change already made generated Nitro projects load server/logging.ts through server/plugins/logging.ts, and generated Next.js projects load logging.ts through instrumentation.ts. This PR keeps those changes on 2.1-maintenance and adds the missing Astro wiring: generated Astro projects now import src/logging.ts from src/middleware.ts before creating the Fedify middleware.

SolidStart is not changed in this PR because 2.1-maintenance does not include a fedify init -w solidstart option. The SolidStart initializer appears only on the later main line.

Tests

  • deno fmt --check packages/init/src/templates/astro/src/middleware.ts.tpl packages/init/src/webframeworks.test.ts CHANGES.md
  • deno check packages/init/src/webframeworks.test.ts
  • pnpm --filter @fedify/init test
  • deno task check in packages/init
  • deno run -A packages/init/src/test/execute.ts init /tmp/fedify-init-725-astro -w astro -p npm -k in-memory -m in-process --dry-run
  • git diff --check

Import the generated LogTape setup from Astro middleware so scaffolded
Astro applications configure logging before Fedify handles requests.

Add regression coverage for the generated Astro middleware and update the
changelog entry for the broader init template fix.

Fixes fedify-dev#725

Assisted-by: Codex:gpt-5.5
@dahlia dahlia self-assigned this Apr 26, 2026
@dahlia dahlia added component/cli CLI tools related integration/astro Astro integration (@fedify/astro) labels Apr 26, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9f703964-c18d-4a7b-a270-a33d79645bdd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 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 and usage tips.

@issues-auto-labeler issues-auto-labeler Bot added component/build Build system and packaging component/integration Web framework integration labels Apr 26, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for loading LogTape configuration in Astro project templates by importing the logging.ts file within src/middleware.ts. The changes include the template modification, a new test case to verify the import, and an update to the changelog. Review feedback suggested improvements to the changelog entry to clarify that the initialization happens before Fedify handles requests for all supported frameworks and to ensure that file paths and package names are formatted with italics according to the repository style guide.

Comment thread CHANGES.md Outdated
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 26, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

ℹ️ 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".

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Tighten the changelog wording for the init template logging fix so the
startup timing applies to Astro, Nitro, and Next.js, and so the Astro
middleware is described as the place where the logging setup is imported.

Review comment: fedify-dev#729 (comment)

Assisted-by: Codex:gpt-5.5
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 26, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 26, 2026

/gemini review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ 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".

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the @fedify/init Astro project template to ensure that the generated logging.ts file is loaded during server startup by adding an import statement to src/middleware.ts. It also includes a new test case to verify this behavior and updates the CHANGES.md file. I have no feedback to provide.

@dahlia dahlia marked this pull request as ready for review April 26, 2026 16:14
@dahlia dahlia requested review from 2chanhaeng and sij411 April 26, 2026 16:50
Copy link
Copy Markdown
Contributor

@2chanhaeng 2chanhaeng left a comment

Choose a reason for hiding this comment

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

Looks great! It would be better to test about logging in test:init. #648

@dahlia dahlia merged commit 2b6efe5 into fedify-dev:2.1-maintenance Apr 27, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/build Build system and packaging component/cli CLI tools related component/integration Web framework integration integration/astro Astro integration (@fedify/astro)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants