Skip to content

[feature-flags] Remove deprecated logic from tests - #6597

Open
nick-nlb wants to merge 2 commits into
datacommonsorg:masterfrom
nick-nlb:feature-flags-remove-deprecation-exclusion
Open

[feature-flags] Remove deprecated logic from tests#6597
nick-nlb wants to merge 2 commits into
datacommonsorg:masterfrom
nick-nlb:feature-flags-remove-deprecation-exclusion

Conversation

@nick-nlb

@nick-nlb nick-nlb commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

Before this PR, the feature-flag tests filtered the list of feature flags in any given environment's feature flag list by deprecated.

With this behavior, the tests passed when a flag was marked as deprecated in production, and completely removed from other environments. However, flag deployment in scripts/update_gcs_feature_flags.sh did not exclude deprecated flags from considerations. This mismatch resulted in the standard tests passing, but the deployment script subsequently failing.

The attribute deprecated is purely an indicator to us, to mark a flag as being on the path to being removed, and plays no role in actual flag behavior. Marking a flag as deprecated is effectively a no-op. Most critically, a deprecated flag that is set to true is still in force in that environment.

Following from the fact that deprecation plays no roll in actually turning down a flag, deprecation status should play no roll in tests. In other words, the behavior of the deployment script best fits how the flags work.

This PR updates the feature flag test logic so that flags marked as deprecated no longer affect test results.

Note

We can still use the deprecated flag as intended, as an indicator to us that a flag is due to be removed but that development lifecycle is such that we are not able to remove the flag yet.

However, we cannot (as we couldn't already during feature flag deployment) mark a production flag as deprecated in order to get around the requirement that a flag that exists in production has been removed in another environment.

As a separate note (but relating to something that surfaced during the removal of the feature flag that surfaced this issue), we should adhere to a process by which a PR that adds, alters or removes a flag in production contains no other functionality but that single update, and alters no other files other than production.json. This means that the complete removal of a flag set will be, by design, a multi-PR process.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request removes the logic that filtered out deprecated feature flags during test execution. By treating deprecated flags the same as active ones in tests, the codebase now aligns with the deployment script's behavior, preventing discrepancies where tests would pass while deployments failed.

Highlights

  • Removal of deprecation filtering: Updated the feature flag test logic to include all flags regardless of their deprecation status, ensuring consistency between test validation and deployment scripts.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the test_load_feature_flag_files test in server/tests/lib/util_test.py to no longer filter out deprecated feature flags when parsing the feature flag data. There are no review comments, and I have no feedback to provide.

@nick-nlb
nick-nlb marked this pull request as ready for review August 19, 2026 15:52
@nick-nlb
nick-nlb requested a review from gmechali August 19, 2026 15:52
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