Skip to content

Add FeatureFlag helper methods to DatabaseHelper#3087

Merged
CydeWeys merged 1 commit into
google:masterfrom
CydeWeys:add-featureflag-helpers
Jun 16, 2026
Merged

Add FeatureFlag helper methods to DatabaseHelper#3087
CydeWeys merged 1 commit into
google:masterfrom
CydeWeys:add-featureflag-helpers

Conversation

@CydeWeys

@CydeWeys CydeWeys commented Jun 16, 2026

Copy link
Copy Markdown
Member

Introduced overloaded helper methods persistFeatureFlag in DatabaseHelper to simplify the creation and persistence of FeatureFlag entities in test setups.

  1. persistFeatureFlag(FeatureName, FeatureStatus): Persists a feature flag with a single status starting from the Unix Epoch (START_INSTANT).
  2. persistFeatureFlag(FeatureName, FeatureStatus, Instant, FeatureStatus): Persists a feature flag with an initial status at START_INSTANT and a subsequent transition at a specified time.

Refactored 11 occurrences of manual 1-transition flag creation and 5 occurrences of 2-transition flag creation across the test suite to use these new helpers, significantly reducing boilerplate and improving test readability.

TAG=agy
CONV=583b8a23-9fe5-476d-ac35-aeba7b218eb0


This change is Reviewable

@CydeWeys CydeWeys force-pushed the add-featureflag-helpers branch from 8d26165 to 30db602 Compare June 16, 2026 20:26
Introduced overloaded helper methods `persistFeatureFlag` in `DatabaseHelper` to simplify the creation and persistence of `FeatureFlag` entities in test setups.

1. `persistFeatureFlag(FeatureName, FeatureStatus)`: Persists a feature flag with a single status starting from the Unix Epoch (`START_INSTANT`).
2. `persistFeatureFlag(FeatureName, FeatureStatus, Instant, FeatureStatus)`: Persists a feature flag with an initial status at `START_INSTANT` and a subsequent transition at a specified time.

Refactored 11 occurrences of manual 1-transition flag creation and 5 occurrences of 2-transition flag creation across the test suite to use these new helpers, significantly reducing boilerplate and improving test readability.

TAG=agy
CONV=583b8a23-9fe5-476d-ac35-aeba7b218eb0
@CydeWeys CydeWeys force-pushed the add-featureflag-helpers branch from 30db602 to 939c3ea Compare June 16, 2026 20:28
@CydeWeys CydeWeys requested a review from jicelhay June 16, 2026 20:29
@CydeWeys CydeWeys enabled auto-merge June 16, 2026 20:29

@jicelhay jicelhay left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@jicelhay reviewed 11 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on CydeWeys).

@CydeWeys CydeWeys added this pull request to the merge queue Jun 16, 2026
Merged via the queue into google:master with commit 4df4bf1 Jun 16, 2026
15 checks passed
@CydeWeys CydeWeys deleted the add-featureflag-helpers branch June 16, 2026 22:18
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.

2 participants