Extract initial common code into common directory#300
Merged
isabeleliassen merged 31 commits intocsg-org:developmentfrom Nov 8, 2024
Merged
Extract initial common code into common directory#300isabeleliassen merged 31 commits intocsg-org:developmentfrom
isabeleliassen merged 31 commits intocsg-org:developmentfrom
Conversation
4a68679 to
de1370b
Compare
0d7c1f9 to
de3c004
Compare
jusdino
suggested changes
Nov 7, 2024
Contributor
jusdino
left a comment
There was a problem hiding this comment.
So glad you got to this! I found a couple of improvements to make.
Since we now have a slightly more complex environmental set-up situation, we should probably revise our discussion of tests to match.
backend/compact-connect/lambdas/common-python/cc_common/data_model/client.py
Outdated
Show resolved
Hide resolved
...pact-connect/lambdas/provider-data-v1/tests/unit/test_data_model/test_schema/test_license.py
Show resolved
Hide resolved
Collaborator
Author
|
@jlkravitz This is ready for your review. Thanks. |
jlkravitz
previously approved these changes
Nov 8, 2024
Collaborator
jlkravitz
left a comment
There was a problem hiding this comment.
Looks great!
@isabeleliassen Good to merge.
to reduce the risk of namespace collisions
CDK doesn't support including layers when running hook tests, so we have determined to remove them from the bundle step. We currently run the tests as part of the PR review phase, which must pass in order for the code to be merged.
These have been moved into the lambda layer, so they do not to be redefined here as that just duplicates the dependency download.
5d004b9 to
0dd1134
Compare
isabeleliassen
previously approved these changes
Nov 8, 2024
isabeleliassen
approved these changes
Nov 8, 2024
jlkravitz
approved these changes
Nov 8, 2024
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.
As part of #271 , this ticket addresses a technical need of sharing common code across all of our lambda functions. We have opted to use a lambda layer for this. As part of this change, all of the common schema, client, and config files have been extracted into a
common-pythondirectory, which we use to create the lambda layer in the persistent stack. For local development/testing, we reference this common directory in our unit tests by updating the PYTHONPATH env var to reference it, which matches the behavior we should expect when the lambda function is deployed with the layer attached to it.It's important to note that CDK doesn't support including layers when running hook tests, so we have determined to remove the test hook from the bundle step. We currently run the tests as part of the PR review phase, which must
pass in order for the code to be merged, so we still ensure passing unit test coverage for all of our components.
Requirements List
Description List
common-pythondirectoryTesting List
yarn test:unit:allshould run without errors or warningsyarn serveshould run without errors or warningsyarn buildshould run without errors or warningsbackend/compact-connect/tests/unit/test_api.pyCloses #271