-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timx 412 establish feature flagging pathways #313
Timx 412 establish feature flagging pathways #313
Conversation
bd3b8f4
to
3cd12ff
Compare
Pull Request Test Coverage Report for Build 12240426182Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looking good! Feels thorough, and will support dropping in "v2" logic when we're ready.
My primary question is about when to pull the ETL_VERSION
. It seems like if we do that in helper functions like generate_transform_command()
and generate_load_command()
, we could avoid some of the function signature changes.
Not-blocking per say, as it's all temporary code, just curious the thinking here.
@@ -51,6 +52,15 @@ def configure_logger( | |||
) | |||
|
|||
|
|||
# NOTE: FEATURE FLAG: function will be removed after v2 work is complete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more we can follow this comment convention of # NOTE: FEATURE FLAG: ...
the easier I think it'll be to find feature flag branching logic in code when we're ready to remove! Maybe/probably better ways, but hopeful this will work, thanks for implementing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, well-marked code that should be easy to remove and I agree on the minimal but sufficient testing approach given that this is temporary. Deferring to @ghukill for approval so feel free to merge after he approves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Nice work.
Why these changes are being introduced: * We will be using a feature flag approach while modifying TIMDEX Pipeline Lambdas to generate the required commands for the Transform step to output files to a parquet dataset and for the Load step to read records a parquet dataset and index records into TIMDEX. We are doing so with the goal of full backwards compatibility until that refactor is complete. How this addresses that need: * Utilizes a new optional env var 'ETL_VERSION' to provide an ETL version for code to branch from. * Format Input Lambda function handler is updated to provide an ETL version to the functions that generate commands for the Transform and Load step. * Add branching logic and submethods to the functions that generate commands for the Transform and Load step. * All feature flag logic branching is noted by comments, suitable for removal when the development work is complete. Side effects of this change: * TIMDEX Pipeline Lambdas remains fully backwards compatible, either via the absence of env var 'ETL_VERSION' or if the value equals '1'. Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/TIMX-412
Why these changes are being introduced: * We do not need to heavily test the feature flagging logic, knowing it will be removed after development work. But a bit of testing can ensure that it works as expected while termporarily in a deployed state. How this addresses that need: * Adds new test file tests/test_temporary_feature_flagging.py that is noted to be removed after development work is complete * Test branching logic in Format Input handler using 'ETL_VERSION' env var * Test config function for retrieving 'ETL_VERSION' env var Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/TIMX-412
9923300
to
b859e80
Compare
Purpose and background context
We will be using a feature flag approach while modifying TIMDEX Pipeline Lambdas to generate the required commands for the Transform step to output files to a parquet dataset and for the Load step to read records a parquet dataset
and index records into TIMDEX.
We are doing so with the goal of full backwards compatibility until that refactor is complete.
How can a reviewer manually see the effects of these changes?
The instructions for review involve running the Lambda function locally using Docker.
Prerequisite: Build a Docker image by running
make dist-dev
.Generate commands when
ETL_VERSION=1
a. Launch a Docker container using the following command, setting
ETL_VERSION=1
and AWSAdministratorAccess credentials for Dev1.b. Generate Transform commands. In a second terminal, run the following command to POST to the container.
You should get the following output:
c. Generate Load commands. In a second terminal, run the following command to POST to the container.
You should get the following output:
d. Exit the container.
Generating commands when
ETL_VERSION=2
a. Launch a Docker container using the following command, setting
ETL_VERSION=2
and AWSAdministratorAccess credentials for Dev1.b. Generate Transform commands. In a second terminal, run the following command to POST to the container.
You should get the following output:
c. Generate Load commands. In a second terminal, run the following command to POST to the container.
You should get the following output:
d. Exit the container.
Includes new or updated dependencies?
YES
Changes expectations for external applications?
NO: TIMDEX Pipeline Lambdas remains fully backwards compatible, either via the absence of env var
ETL_VERSION
or if the value equals 1What are the relevant tickets?
Developer
Code Reviewer(s)