fix(packaging): preserve top-level agentcore Python package in zip#1424
Open
NishchayMahor wants to merge 1 commit into
Open
fix(packaging): preserve top-level agentcore Python package in zip#1424NishchayMahor wants to merge 1 commit into
NishchayMahor wants to merge 1 commit into
Conversation
PR aws#1015 removed a stale CONFIG_DIR exclusion from the zip-stage collectFiles helpers because the zip operates on the staging directory, not the project root, and the project config dir is filtered out at the copy stage. PR aws#1068 reintroduced the check via a merge resolution that took the wrong side. Any Python package whose top-level module is named agentcore (i.e. staging/agentcore/) gets silently dropped from the deployment artifact on main. Restore the PR aws#1015 state: drop the CONFIG_DIR check from collectFiles and collectFilesSync and drop the now-unused rootDir parameter and call sites. Existing copy-stage exclusion for the project config dir is unaffected. Add zip-stage regression tests under issue aws#1408. Closes aws#1408
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.
Summary
Restores the state from #1015. The CONFIG_DIR check in the zip-stage
collectFiles/collectFilesSynchelpers was reintroduced by the #1068 merge and is currently on main. The zip stage runs against the staging directory, not the project root, and the project config dir is already filtered out at the copy stage, so the check is both unnecessary and harmful: any Python package whose top-level module is namedagentcoregets silently dropped from the deployment artifact.What changed
collectFilesandcollectFilesSyncinsrc/lib/packaging/helpers.ts.rootDirparameter from both helpers and from the two internal call sites increateZipFromDir/createZipFromDirSync.agentcore/config dir check incopyEntry) is left as-is, since that one is correct.agentcorePython packages from deployment artifact #1408 that builds a staging fixture with a top-levelagentcore/Python package and asserts it is preserved in both the async and sync zip paths.Test plan
npx vitest run src/lib/packaging/__tests__/helpers.test.tsreports 39 passed (including the 2 new issue Regression in #1068: CONFIG_DIR check re-introduced in zip stage, drops top-levelagentcorePython packages from deployment artifact #1408 cases and the unchanged issue agentcore directory incorrectly excluded from CodeZip artifact when used as a Python package name #843 copy-stage cases).npm run typecheckclean.npx eslint src/lib/packaging/helpers.ts src/lib/packaging/__tests__/helpers.test.tsclean.npx prettier --checkon both files clean.Closes #1408