Skip to content
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

bulk-cdk: add feature flag environments #46692

Merged
merged 15 commits into from
Oct 18, 2024

Conversation

postamar
Copy link
Contributor

@postamar postamar commented Oct 9, 2024

What

Fixes https://github.com/airbytehq/airbyte-internal-issues/issues/9704

The Bulk CDK needs to support the DEPLOYMENT_MODE environment variable and the associated CLOUD feature flag.
This PR adds support for this and makes source-mysql-v2 adopt it.

How

As far as I can tell, none of the other feature flags from the legacy CDK matter for connectors.
In any case, the Bulk CDK now has a Micronaut Factory for injecting Set<FeatureFlag> where FeatureFlag is an enum and the injected value is the set of active feature flags. This is used in source-mysql-v2 to cause CHECK to fail when a config doesn't have enough encryption.

Review guide

Commit by commit

User Impact

None

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

@postamar postamar requested review from a team as code owners October 9, 2024 21:18
Copy link

vercel bot commented Oct 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 2:25am

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues CDK Connector Development Kit connectors/source/mysql-v2 labels Oct 9, 2024
@postamar postamar force-pushed the postamar/bulk-cdk-supports-env-var-feature-flags branch from 794fecc to 137d716 Compare October 9, 2024 21:22
@edgao
Copy link
Contributor

edgao commented Oct 9, 2024

@johnny-schmidt you already did something for this I think? at least destination-dev-null respects cloud vs oss mode

@postamar
Copy link
Contributor Author

Interesting! I searched and found it in the test fixtures, the substring to search for is "deployment.mode". In my PR I hadn't thought of how this would impact the test runners, I'll have to figure something out. Back to the drawing board!

@postamar postamar marked this pull request as draft October 10, 2024 11:04
@postamar postamar marked this pull request as ready for review October 10, 2024 15:35
@postamar
Copy link
Contributor Author

This is ready for review, the only failing checks are connnector version bumps.

@johnny-schmidt
Copy link
Contributor

@johnny-schmidt you already did something for this I think? at least destination-dev-null respects cloud vs oss mode
@postamar @edgao

Sorry, I missed this earlier. Micronaut automagically propagates env variables as properties. You get "deployment.mode" and any other env variable for free. The tests override the properties so that we can test both envs, but specifying them as properties isn't necessary in production.

I'm not sure what this PR accomplishes on top of that other than to limit the list of supported vars? However, you can also get that by specifying includes/excludes when building the ApplicationContext.

@postamar
Copy link
Contributor Author

I'm not sure what this PR accomplishes on top of that other than to limit the list of supported vars?

Limiting the supported vars is not the goal per se but there is value in having a clear catalog of which env vars are meaningful. The main purpose of this PR is to facilitate activating feature flags in regular junit tests which are not @MicronautTests. I understand that this may not be relevant to destinations.

Copy link
Contributor

@johnny-schmidt johnny-schmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pardon the delay. I had to confer with the team to make sure it wasn't breaking anything test-related

@postamar
Copy link
Contributor Author

No worries! Like I said it's not urgent and I only just got the build to pass. Thanks for taking a look.

@postamar postamar enabled auto-merge (squash) October 18, 2024 00:02
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Oct 18, 2024
@postamar postamar merged commit a4847df into master Oct 18, 2024
41 checks passed
@postamar postamar deleted the postamar/bulk-cdk-supports-env-var-feature-flags branch October 18, 2024 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation CDK Connector Development Kit connectors/destination/dev-null connectors/destination/s3-v2 connectors/source/mysql-v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants