Skip to content

Last One Wins with Duplicate Feature Flag Names#71

Open
mrm9084 wants to merge 5 commits into
mainfrom
LastWins
Open

Last One Wins with Duplicate Feature Flag Names#71
mrm9084 wants to merge 5 commits into
mainfrom
LastWins

Conversation

@mrm9084

@mrm9084 mrm9084 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes: #52

Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • I have read the contribution guidelines.
  • Pull request includes test coverage for the included changes.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts feature flag resolution behavior to treat duplicate feature flag ids as “last one wins,” and adds tests to validate the behavior in both sync and async FeatureManager usage.

Changes:

  • Update feature flag lookup to prefer the last occurrence when multiple feature flags share the same id.
  • De-duplicate list_feature_flag_names() output so duplicate ids are only listed once.
  • Add sync and async unit tests covering duplicate-id behavior; add .env to .gitignore.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
featuremanagement/_featuremanagerbase.py Implements last-one-wins lookup and de-duplicates feature flag name listing.
tests/test_feature_manager.py Adds sync test asserting last duplicate wins and names are unique.
tests/test_feature_manager_async.py Adds async test asserting last duplicate wins and names are unique.
.gitignore Ignores .env files.

Comment thread featuremanagement/_featuremanagerbase.py Outdated
Comment thread featuremanagement/_featuremanagerbase.py Outdated
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.

Last feature flag matches the name should win

2 participants