Skip to content

Conversation

@gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Oct 30, 2025

Description Of Changes

Added an explicit label property to the feature flags configuration in flags.json to decouple the display label from the flag key name. Previously, labels were automatically generated from flag keys using camelToSentenceCase(). Now labels are explicitly defined in the configuration, providing flexibility for future customization while maintaining the same user-facing labels.

Code Changes

  • Added label property to all flag definitions in flags.json with auto-generated values matching previous camelToSentenceCase() output
  • Updated FlagEnvs type definition to include optional label?: string property
  • Modified FlagControl component to use FLAG_CONFIG[flag].label instead of computing label from flag key
  • Removed unused camelToSentenceCase import from FlagControl.tsx

Steps to Confirm

  1. Navigate to the feature flags settings page in the Admin UI
  2. Verify all flag labels display correctly and match their previous values
  3. Confirm flag toggles function as expected with no visual or behavioral changes

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link

vercel bot commented Oct 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Oct 30, 2025 9:39pm
fides-privacy-center Ignored Ignored Oct 30, 2025 9:39pm

@gilluminate gilluminate marked this pull request as ready for review October 30, 2025 18:10
@gilluminate gilluminate requested a review from a team as a code owner October 30, 2025 18:10
@gilluminate gilluminate requested review from speaker-ender and removed request for a team October 30, 2025 18:10
@gilluminate gilluminate enabled auto-merge October 30, 2025 18:12
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Refactored feature flag labels from dynamic generation to explicit configuration by adding a label property to each flag definition in flags.json and updating FlagControl.tsx to read from the configuration instead of calling camelToSentenceCase().

  • All 12 feature flags now have explicit labels that match the previous camelToSentenceCase() output
  • Removed dependency on the camelToSentenceCase utility function from FlagControl.tsx
  • Type definition updated to include optional label property in FlagEnvs

Issue found:

  • The label property is defined as optional (label?: string) but is accessed without null checking in FlagControl.tsx:61, which could cause runtime errors if a flag doesn't have a label defined

Confidence Score: 4/5

  • This PR is mostly safe to merge but has a type safety issue that should be addressed
  • The refactoring is straightforward and all existing labels are properly defined. However, the label property is marked as optional in the type definition but accessed without null checks in the component. While all current flags have labels defined, this creates a type safety gap that could cause runtime errors if a future flag is added without a label. Making label required in the type definition would prevent this issue.
  • Pay attention to clients/admin-ui/src/features/common/features/types.ts - the optional label property should be made required

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/flags.json 5/5 Added explicit label property to all 12 feature flags with matching camelToSentenceCase values
clients/admin-ui/src/features/common/features/types.ts 4/5 Added optional label?: string property to FlagEnvs type definition
clients/admin-ui/src/features/common/features/FlagControl.tsx 4/5 Updated to use FLAG_CONFIG[flag].label instead of camelToSentenceCase(), removed unused import

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@gilluminate
Copy link
Contributor Author

@greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Refactored feature flag configuration to use explicit label properties in flags.json instead of auto-generating labels from flag keys using camelToSentenceCase(). This provides flexibility for future customization while maintaining the same user-facing labels.

  • Added label property to all 12 flag definitions in flags.json with values matching previous auto-generated output
  • Updated FlagEnvs type to include optional label property
  • Modified FlagControl to use explicit label from configuration
  • Removed unused camelToSentenceCase import from FlagControl

The main issue is that label is defined as optional in the type definition but accessed without null checking in FlagControl.tsx:61, which was already flagged in previous comments.

Confidence Score: 4/5

  • This PR is safe to merge with low risk once the type safety issue is addressed
  • The changes are straightforward and mechanical - adding explicit labels to feature flags instead of generating them dynamically. All existing labels match the previous auto-generated values, so there's no behavior change. The only concern is the type safety issue where label is optional but accessed without null checking, which was already identified in previous comments. This won't cause runtime issues currently since all flags have labels, but it creates technical debt.
  • The types.ts file needs attention to make the label property required instead of optional to match actual usage

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/features/common/features/types.ts 3/5 Added optional label property to FlagEnvs type but it's accessed without null check in FlagControl
clients/admin-ui/src/features/common/features/FlagControl.tsx 4/5 Removed camelToSentenceCase import and now uses explicit label from FLAG_CONFIG
clients/admin-ui/src/flags.json 5/5 Added explicit label property to all flag definitions matching previous auto-generated values

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@gilluminate gilluminate force-pushed the gill/feature-flag-labels branch from f8f70d1 to 8ad3101 Compare October 30, 2025 20:25
auto-merge was automatically disabled October 30, 2025 20:29

Pull Request is not mergeable

@gilluminate
Copy link
Contributor Author

@greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Decouples feature flag display labels from flag keys by adding explicit label property to flag configuration. Previously, labels were auto-generated from camelCase keys using camelToSentenceCase(). Now all 12 flags have explicit labels defined in flags.json, maintaining identical display text while enabling future customization.

  • Added optional label field to FlagEnvs type definition
  • Updated FlagControl component to read label from config with camelToSentenceCase() fallback
  • Added explicit labels to all feature flags in flags.json matching previous auto-generated values
  • Updated documentation examples across type definitions and config

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • This is a straightforward refactoring that explicitly defines labels while maintaining backward compatibility with a fallback. All flags have labels defined, no breaking changes, and the implementation is simple and well-tested by the existing UI
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/features/common/features/types.ts 5/5 Added optional label property to FlagEnvs type with updated documentation examples
clients/admin-ui/src/features/common/features/FlagControl.tsx 5/5 Updated to use explicit label from config with fallback to camelToSentenceCase, import path simplified
clients/admin-ui/src/flags.json 5/5 Added explicit label property to all 12 feature flags with sentence-case display names

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@gilluminate gilluminate force-pushed the gill/feature-flag-labels branch from 760cd4d to d666467 Compare October 31, 2025 15:27
@vercel
Copy link

vercel bot commented Oct 31, 2025

Deployment failed with the following error:

You must set up Two-Factor Authentication before accessing this team.

View Documentation: https://vercel.com/docs/two-factor-authentication

@gilluminate gilluminate force-pushed the gill/feature-flag-labels branch from d666467 to e42a460 Compare October 31, 2025 15:28
@gilluminate gilluminate enabled auto-merge October 31, 2025 15:28
@gilluminate gilluminate added this pull request to the merge queue Oct 31, 2025
Merged via the queue into main with commit 8b4fa08 Oct 31, 2025
43 of 45 checks passed
@gilluminate gilluminate deleted the gill/feature-flag-labels branch October 31, 2025 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.

3 participants