Repository navigation
test(e2e): run the Node suite against an astro build --devOutput build #4518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ostenbom
wants to merge
4
commits into
emdash-cms:main
Choose a base branch
from
endformdev:e2e/dev-output-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+117
−37
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b656c46
test(e2e): run the Node suite against a dev-output build
ostenbom f4c0ccf
fix(core): accept localhost registries in astro build --devOutput
ostenbom 7f36235
ci: run the Node E2E shards against a dev-output build
ostenbom 837c119
test(core): drop the registry localhost build unit test
ostenbom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "emdash": patch | ||
| --- | ||
|
|
||
| Fixes `astro build --devOutput` for sites whose `registry` points at a plain-HTTP localhost aggregator. The build no longer fails with "must use HTTPS outside development"; a development-output build now accepts the same localhost registry URLs as `astro dev`. Production builds still reject them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { defineMiddleware } from "astro:middleware"; | ||
|
|
||
| // Manual i18n routing requires a middleware file; the fixture's `[locale]` | ||
| // routes handle locale prefixes themselves. | ||
| export const onRequest = defineMiddleware((_context, next) => next()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[needs fixing] This line changes the build-time registry URL policy. HTTP and localhost aggregators are now accepted when
process.env.NODE_ENV === "development"during any command, not onlydevandsync. Two problems:Convention (raised by one reviewer, not the other): AGENTS.md requires development/production decisions to use Astro/Vite environment semantics and says never to use
process.env.NODE_ENV. The runtime validator inregistry/config.tsusesimport.meta.env.DEV, so this adds a second source of truth for the same policy. Determine development-output status through the appropriate Astro/Vite configuration boundary, or document an explicit config-time exception if the hook cannot access that signal. The other reviewer found the build-time and runtime checks agree in practice, since Astro defaultsNODE_ENVonly when it is unset andDEVfollows it, but did not address the AGENTS.md rule.No test coverage (raised by both reviewers):
tests/unit/astro/integration/already calls theastro:config:setuphook directly withcommand: "build"(seeimage-remote-patterns.test.ts), so a test is cheap to add. The changeset promises "Production builds still reject them", and nothing guards that. Add cases withregistry: "http://localhost:1234"andcommand: "build":NODE_ENVunset or"production": expectREGISTRY_AGGREGATOR_URL_FORBIDDEN.NODE_ENV = "development"(the--devOutputcase): expect the hook to succeed.Restore
process.env.NODE_ENVafter each case.