Repository navigation
test(bundle): assert dist/index.js requires only node built-ins and inlines every package src/ imports - #266
Merged
Conversation
…nlines every package src/ imports action.yml runs dist/index.js on a runner without node_modules, so every package has to be inlined by ncc. bundle.test.ts only checks node --check and the webpackMissingModule marker; a module left external emits a literal require() that passes both, and runBundle.ts spawns from the repository root where node_modules resolves it anyway. Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
Member
|
/kind cleanup |
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Test Improvement
Adds
__tests__/bundle/selfContained.test.ts(new file; does not touchbundle.test.ts, which the held bundle PRs #236–#262 edit):requires only node built-in modules— everyrequire(<literal>)specifier indist/index.jssatisfiesnode:module'sisBuiltin. Catches a package left external by ncc, whichwebpackMissingModuledoes not (that marker only fires for modules ncc could not resolve at build time), and which the bundle e2e suite cannot see becauserunBundle.tsspawns from the repository root wherenode_modulesresolves the import.inlines every package src/ imports— every bare package imported bysrc/**/*.ts(@actions/core,@actions/github,@octokit/rest,js-yaml) appears in the bundle as an inlinednode_modules/<pkg>/module.Verified on
main@ c48bd6d, Node v26.10.0: both tests pass;npx eslintclean. Mutation check: appendingrequire("js-yaml")todist/index.jsfails the first test withexpected [ 'js-yaml' ] to deeply equal [].Related Issue
Closes #265
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88