Skip to content

[Feature flags] Add a persistence layer#2898

Merged
jonathanmos merged 4 commits into
feature/feature-flaggingfrom
jmoskovich/ff-persistence-layer
Oct 9, 2025
Merged

[Feature flags] Add a persistence layer#2898
jonathanmos merged 4 commits into
feature/feature-flaggingfrom
jmoskovich/ff-persistence-layer

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Sep 25, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Part of the feature flag development.
• Uses the datastore to persist precomputed flags between sessions.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@codecov-commenter

codecov-commenter commented Sep 25, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.67033% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.73%. Comparing base (09aacbf) to head (c3c8620).
⚠️ Report is 277 commits behind head on feature/feature-flagging.

Files with missing lines Patch % Lines
...ags/internal/persistence/FlagsStateDeserializer.kt 84.48% 8 Missing and 1 partial ⚠️
...gs/internal/persistence/FlagsPersistenceManager.kt 73.33% 8 Missing ⚠️
...flags/internal/persistence/FlagsStateSerializer.kt 78.79% 7 Missing ⚠️
...lags/internal/repository/DefaultFlagsRepository.kt 61.11% 7 Missing ⚠️
...src/main/kotlin/com/datadog/android/flags/Flags.kt 25.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feature/feature-flagging    #2898      +/-   ##
============================================================
+ Coverage                     70.67%   70.73%   +0.06%     
============================================================
  Files                           830      834       +4     
  Lines                         30203    30369     +166     
  Branches                       5128     5134       +6     
============================================================
+ Hits                          21344    21479     +135     
- Misses                         7403     7443      +40     
+ Partials                       1456     1447       -9     
Files with missing lines Coverage Δ
...ags/featureflags/internal/model/FlagsStateEntry.kt 100.00% <100.00%> (ø)
...reflags/internal/model/PrecomputedFlagConstants.kt 100.00% <100.00%> (+33.33%) ⬆️
...eflags/internal/repository/net/PrecomputeMapper.kt 100.00% <100.00%> (ø)
...src/main/kotlin/com/datadog/android/flags/Flags.kt 80.00% <25.00%> (-8.89%) ⬇️
...flags/internal/persistence/FlagsStateSerializer.kt 78.79% <78.79%> (ø)
...lags/internal/repository/DefaultFlagsRepository.kt 48.65% <61.11%> (+5.17%) ⬆️
...gs/internal/persistence/FlagsPersistenceManager.kt 73.33% <73.33%> (ø)
...ags/internal/persistence/FlagsStateDeserializer.kt 84.48% <84.48%> (ø)

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos
jonathanmos marked this pull request as ready for review September 29, 2025 12:43
@jonathanmos
jonathanmos requested review from a team as code owners September 29, 2025 12:43
internal enum class VariationType(val value: String) {
BOOLEAN("boolean"),
STRING("string"),
INTEGER("integer"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Long values are not supported?

@jonathanmos
jonathanmos force-pushed the jmoskovich/ff-persistence-layer branch 3 times, most recently from 8b9e500 to fbd826b Compare October 6, 2025 07:47
@jonathanmos
jonathanmos requested review from 0xnm and ambushwork October 6, 2025 11:26
typotter
typotter previously approved these changes Oct 6, 2025
Comment thread features/dd-sdk-android-flags/src/main/kotlin/com/datadog/android/flags/Flags.kt Outdated
Comment on lines +29 to +34
private lateinit var testedSerializer: FlagsStateSerializer

@BeforeEach
fun `set up`() {
testedSerializer = FlagsStateSerializer(mockInternalLogger)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
private lateinit var testedSerializer: FlagsStateSerializer
@BeforeEach
fun `set up`() {
testedSerializer = FlagsStateSerializer(mockInternalLogger)
}
private val testedSerialize = FlagsStateSerializer(mockInternalLogger)

very minor

@jonathanmos
jonathanmos force-pushed the jmoskovich/ff-persistence-layer branch from fbd826b to e4109cd Compare October 8, 2025 13:34
0xnm
0xnm previously approved these changes Oct 8, 2025
@jonathanmos
jonathanmos dismissed stale reviews from aleksandr-gringauz and 0xnm via 00b67aa October 9, 2025 07:21
0xnm
0xnm previously approved these changes Oct 9, 2025
@jonathanmos
jonathanmos dismissed stale reviews from 0xnm and aleksandr-gringauz via a93541e October 9, 2025 11:36
@jonathanmos
jonathanmos force-pushed the jmoskovich/ff-persistence-layer branch from 00b67aa to a93541e Compare October 9, 2025 11:36
@jonathanmos
jonathanmos force-pushed the jmoskovich/ff-persistence-layer branch from a93541e to 3065076 Compare October 9, 2025 16:38
@jonathanmos
jonathanmos force-pushed the jmoskovich/ff-persistence-layer branch from 3065076 to c3c8620 Compare October 9, 2025 16:49
@jonathanmos
jonathanmos merged commit 31f0ce3 into feature/feature-flagging Oct 9, 2025
25 checks passed
@jonathanmos
jonathanmos deleted the jmoskovich/ff-persistence-layer branch October 9, 2025 17:46
This was referenced Nov 4, 2025
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.

6 participants