Skip to content

Conversation

@flora-five
Copy link

Description

This set of changes does the following:

  • when hashing source paths with commands and patterns, use the patterns to filter what files are hashed
  • uses os.path.normpath to normalize other paths used as input to the prepare step
  • fixes some source paths used in README and examples
  • updates examples to version 6.x of terraform-aws-vpc to fix warnings about deprecated attributes
  • hashes again the content of package.py
  • avoids double encoding of source_path strings, with jsencode, when passed from Terraform to python

Motivation and Context

When commands and patterns are used together, the patterns filter is applied when building the archive, but not during the prepare step. Files that are not included in the archive due to the filter are still hashed. If some of those files are generated, with their content depending on the build environment, then, even if the built archives are the same across different build environments, the calculated hashes are not the same and the module wants to create again the archive and redeploy. Making the hashing step take into account the patterns filter fixes #672.

Hashing again the content of package.py restores the logic that was necessary to disable in #66 to fix #63. This time only the content of package.py is hashed, without its path.

The change to normalize other paths used as input with os.path.normpath is for consistency with existing normalization on some input paths.

Breaking Changes

None, but all the hashes will change due to inclusion of package.py into the hashing.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Previously, the following paths were normalized: the working directory
for commands and the path elements when source_path is a list.
With this change, the following paths are normalized too: plain paths
given as source_path strings, path values of npm_requirements and
pip_requirements.
…ecated attributes with version 6.x of AWS provider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant