Skip to content

Conversation

@KevinFairise2
Copy link
Member

@KevinFairise2 KevinFairise2 commented Oct 15, 2025

Create LocalFeatureFlagManager vs CIFeatureFlagManager, these are two different subclasses because they are quite different in the way they retrieve secrets, and the context they provide.

Also add some documentation about how to use feature flags in actual dda code.

Using the feature flag in the CI expect you to pass some keys as environment variable. As the way the secrets can be retrieved is not the same on the different OSes and that the parameter name can be different, you need the following environment variables in .gitlab-ci.yaml to configure token retrieval for dda features flags
DDA_FEATURE_FLAGS_CI_VAULT_KEY
DDA_FEATURE_FLAGS_CI_VAULT_PATH
DDA_FEATURE_FLAGS_CI_VAULT_KEY_MACOS
DDA_FEATURE_FLAGS_CI_VAULT_PATH_MACOS
DDA_FEATURE_FLAGS_CI_SSM_KEY_WINDOWS

Example of jobs running with that on datadog-agent side: https://gitlab.ddbuild.io/DataDog/datadog-agent/-/jobs/1184492696

@KevinFairise2 KevinFairise2 requested a review from a team as a code owner October 15, 2025 16:27
@KevinFairise2 KevinFairise2 changed the title Address comment + some doc about using feature flags Support feature flags in the CI Oct 15, 2025
@KevinFairise2 KevinFairise2 force-pushed the kfairise/feature-flags-dda branch 3 times, most recently from 536a5fc to d7a0c79 Compare October 16, 2025 09:00
@KevinFairise2 KevinFairise2 force-pushed the kfairise/support-feature-flag-ci branch 25 times, most recently from 4355fe1 to 3dea7c7 Compare October 17, 2025 12:20
@KevinFairise2 KevinFairise2 force-pushed the kfairise/support-feature-flag-ci branch 3 times, most recently from f0dcb5e to be7a4ee Compare October 17, 2025 12:30
@KevinFairise2 KevinFairise2 force-pushed the kfairise/feature-flags-dda branch 2 times, most recently from a7a0f61 to fa3cd53 Compare October 29, 2025 13:05
Base automatically changed from kfairise/feature-flags-dda to main November 6, 2025 08:28
@KevinFairise2 KevinFairise2 force-pushed the kfairise/support-feature-flag-ci branch 5 times, most recently from c875cc7 to 7efa4d7 Compare November 6, 2025 10:42
@KevinFairise2 KevinFairise2 force-pushed the kfairise/support-feature-flag-ci branch from 7efa4d7 to 2d11958 Compare November 6, 2025 10:52
@KevinFairise2 KevinFairise2 force-pushed the kfairise/support-feature-flag-ci branch 2 times, most recently from 34ae8dd to 401a746 Compare November 6, 2025 12:37
Copy link
Member

@chouetz chouetz left a comment

Choose a reason for hiding this comment

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

LGTM

from dda.feature_flags.manager import FeatureFlagManager

return FeatureFlagManager(self)
self.display_info(f"IS IT RUNNING IN CI {running_in_ci()}")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.display_info(f"IS IT RUNNING IN CI {running_in_ci()}")
self.display_info(f"Is it running in CI {running_in_ci()}")

🥜 the capital letters seems aggressive

@@ -0,0 +1,6 @@
def fetch_secret_ssm(name: str) -> str:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def fetch_secret_ssm(name: str) -> str:
def fetch_secret(name: str) -> str:

As it's in the ssm namespace I guess it's ok. Just to align on the naming from the vault module

DDA_FEATURE_FLAGS_CI_VAULT_KEY: CLIENT_TOKEN
DDA_FEATURE_FLAGS_CI_VAULT_PATH_MACOS: kv/path/to/dda/feature-flags
DDA_FEATURE_FLAGS_CI_VAULT_KEY_MACOS: CLIENT_TOKEN
DDA_FEATURE_FLAGS_CI_SSM_KEY_WINDOWS: my/ssm/parameter/name
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
DDA_FEATURE_FLAGS_CI_SSM_KEY_WINDOWS: my/ssm/parameter/name
DDA_FEATURE_FLAGS_CI_SSM_KEY_WINDOWS: ci.repo-name.my-ssm-parameter-name

🥜 but I think the naming is important for the ssm param to be retrieved correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants