Skip to content

Detect duplicate redirects and optimize file writing process#1077

Merged
maartenba merged 9 commits intomainfrom
mb/duplicate-redirects
Apr 27, 2026
Merged

Detect duplicate redirects and optimize file writing process#1077
maartenba merged 9 commits intomainfrom
mb/duplicate-redirects

Conversation

@maartenba
Copy link
Copy Markdown
Member

No description provided.

@maartenba maartenba self-assigned this Apr 27, 2026
Copilot AI review requested due to automatic review settings April 27, 2026 08:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the static redirects generation plugin by adding detection for duplicate redirect_from declarations in docs frontmatter, and changes how the redirects JSON file is written. It also increases Node’s memory limit for Astro builds via the build script.

Changes:

  • Convert redirect storage from a plain object to a Map and write redirects.json via incremental writes.
  • Scan src/content/docs/**/*.{md,mdx} frontmatter to detect duplicate redirect_from sources and fail the build if found.
  • Update the build script to set NODE_OPTIONS=--max_old_space_size=8192.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
astro/src/plugins/static-redirects.ts Adds duplicate redirect_from detection and changes redirect map + output writing logic.
astro/package.json Adjusts the build script to increase Node memory limit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread astro/src/plugins/static-redirects.ts Outdated
Comment thread astro/src/plugins/static-redirects.ts Outdated
Comment thread astro/src/plugins/static-redirects.ts Outdated
Comment thread astro/package.json Outdated
Comment thread astro/src/plugins/static-redirects.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 09:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread astro/package.json Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings April 27, 2026 09:14
@maartenba maartenba review requested due to automatic review settings April 27, 2026 09:14
Comment thread astro/src/plugins/static-redirects.ts Outdated
Copilot AI review requested due to automatic review settings April 27, 2026 09:18
@maartenba maartenba enabled auto-merge April 27, 2026 09:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread astro/src/plugins/static-redirects.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 10:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread astro/src/plugins/static-redirects.ts Outdated
auto-merge was automatically disabled April 27, 2026 10:11

Head branch was pushed to by a user without write access

@maartenba maartenba enabled auto-merge April 27, 2026 11:08
@maartenba maartenba added the preview Spins up a preview of the Pull Request for review label Apr 27, 2026
@maartenba maartenba disabled auto-merge April 27, 2026 11:11
@maartenba maartenba enabled auto-merge (squash) April 27, 2026 11:12
@duende-github-bot
Copy link
Copy Markdown

Preview Environment Provisioned

@maartenba maartenba merged commit fb84af2 into main Apr 27, 2026
7 checks passed
@maartenba maartenba deleted the mb/duplicate-redirects branch April 27, 2026 11:54
@maartenba maartenba removed the preview Spins up a preview of the Pull Request for review label Apr 27, 2026
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.

4 participants