Skip to content

feat: allow LaunchDarkly project-wide flag prefixes#111

Merged
greghuels merged 1 commit into
mainfrom
greg.huels/FFL-2816/prefix
Jul 20, 2026
Merged

feat: allow LaunchDarkly project-wide flag prefixes#111
greghuels merged 1 commit into
mainfrom
greg.huels/FFL-2816/prefix

Conversation

@greghuels

@greghuels greghuels commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a LaunchDarkly interactive migration prompt that lets users prefix every new Datadog flag key for a selected LD project, not only conflicting keys, so all flags from that project can share a consistent prefix.
  • Detects an existing project prefix from migration metadata or previously migrated key shape and offers it first for re-migrations.
  • Centralizes Datadog key planning for interactive runs so existing same-project/manual flags sync in place, new flags use the selected prefix, and original, prefixed, or custom-key collisions are caught before creation.
  • Persists prefix/remap metadata in migration reports and keeps failure reporting keyed by the source LaunchDarkly flag key.
  • Keeps non-interactive conflict handling strict while preserving explicit --feature-flag source,target mappings.
Screenshot 2026-07-20 at 4 00 06 PM

@greghuels
greghuels force-pushed the greg.huels/FFL-2816/prefix branch from 5083cf8 to eee5deb Compare July 20, 2026 20:54
@greghuels greghuels changed the title feat: allow users to apply a prefix to all migrated LD flag keys feat: prompt user to rename or skip flags with cross-project key conflicts Jul 20, 2026
@greghuels
greghuels force-pushed the greg.huels/FFL-2816/prefix branch from eee5deb to c8860f7 Compare July 20, 2026 20:55
@greghuels greghuels changed the title feat: prompt user to rename or skip flags with cross-project key conflicts feat: allow LaunchDarkly project-wide flag prefixes Jul 20, 2026
@greghuels
greghuels marked this pull request as ready for review July 20, 2026 21:00
@greghuels
greghuels requested a review from a team as a code owner July 20, 2026 21:00
@greghuels
greghuels requested review from mark-caii and vjfridge July 20, 2026 21:03

@vjfridge vjfridge 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.

Left a few comments!

Comment on lines -1019 to +1192
flagKeyMapping,
flagKeyMapping: flagKeyMappingsForReport(),

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.

🤖[claude] Suggestion

The SIGINT partial-save handler is missing semverForcedClientKeys and jsonArrayWrappedKeys, both of which are accumulated during the migration. If the user interrupts with Ctrl+C, those fields won't appear in the saved JSON, so an xlsx export from the partial report will show SEMVER-forced and JSON-array-wrapped flags without any warning highlighting.

Consider adding them here to match the success-path shape:

semverForcedClientKeys: semverForcedClientKeys.length > 0 ? semverForcedClientKeys : undefined,
jsonArrayWrappedKeys: jsonArrayWrappedKeys.length > 0 ? jsonArrayWrappedKeys : undefined,

),
);
}
resolvedDdKey = customKey;

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.

🤖[claude] Suggestion

After the user confirms a custom key, reservedDatadogKeys is never updated. A later flag in the same migration could pass the classifyDatadogKeyConflict check with the same key (since it's not yet reserved), only for the API creation to fail at runtime with a less clear error.

Consider adding the key to the reserved set immediately after confirmation, matching the pattern at the create path:

resolvedDdKey = customKey;
reservedDatadogKeys.add(customKey); // prevent a later flag from claiming the same key

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh good catch. I'll add a follow up PR

@greghuels
greghuels merged commit c2e108f into main Jul 20, 2026
4 checks passed
@greghuels
greghuels deleted the greg.huels/FFL-2816/prefix branch July 20, 2026 22:13
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