feat: Add git based bundling strategy #7
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.
Allow for specifying a
bundlingStrategy
as part of thebundling
params. If this isBundlingStrategy.SOURCE
then do the same as before. If it'sBundlingStrategy.GIT
then use git command output to decide if the package needs rebuilt or not.If we're not using a package in a workspace app then use the last commit hash for the entire
rootDir
and anything ingit diff
to generate the custom hash for CDK bundling.If we are using a package in a workspace app then get the list of dependencies and check and local ones for changes. This uses the hash of the last commit and any git diff in that part of the tree for each dependency and the package itself.
As this involved editing files in the project the tests add some helper functions to clone the workspace to a temporary directory and do the edits there.
This PR originally had the PACKAGE_VERSION bundling strategy but it's been removed as the tests couldn't be made to pass because of something uv related so lower confidence it would work in practise.