fix(sign): Excluded the artifacts directory from the signed package - #3834
Open
MaxFreedomPollard wants to merge 3 commits into
Open
MaxFreedomPollard wants to merge 3 commits into
MaxFreedomPollard wants to merge 3 commits into
Conversation
The sign command builds its package into a temporary directory, and build creates its default file filter from that temporary path. FileFilter only adds ignore rules for the artifacts directory when it sits inside the source directory, so a temporary path meant the rule was never added and everything under web-ext-artifacts that is not a .zip or .xpi ended up in the archive sent to AMO. Sign now builds the file filter itself from the real artifacts directory and passes it to build. The same ignoreFiles are still passed in, so --ignore-files is unaffected, and the existing isSubPath guard keeps behaviour unchanged when --artifacts-dir points outside the source directory.
Rob--W
requested changes
Sep 24, 2026
Rob--W
left a comment
Member
There was a problem hiding this comment.
This patch seems to fix the issue at the wrong layer. The build command should exclude the artifacts directory; sign should not exclude files that the build includes, because otherwise someone testing the output of build may get a result that differs from what users would encounter after signing the package.
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.
Fixes #1640.
web-ext buildleaves the artifacts directory out of its package, butweb-ext signcan include it. Files such as.crxpackages, unpacked extension copies, and screenshots underweb-ext-artifacts/can then end up in the archive uploaded to AMO. Existing.zipand.xpifiles are already excluded by the base ignore patterns.sign()builds into a temporary directory, sobuild()previously made its file filter from that temporary output path instead of the real artifacts directory inside the source tree.build()now acceptsartifactsDirToIgnorefor its own file filter, defaulting to its outputartifactsDir.sign()passes the real artifacts directory through this option while keeping the temporary build output. Build constructs the filter in both commands. The existing--ignore-fileshandling and the behavior when the artifacts directory is outside the source tree remain unchanged.A sign integration test checks that the archive contains
manifest.jsonbut excludes a prior.crxin the artifacts directory. A sign unit test checks that it passes the real directory to build. A build unit test checks that the directory used for filtering can differ from the output directory.Validation: all 45 tests in
test.build.jsandtest.sign.jspassed. ESLint and Prettier passed for the four changed files.