From 0452d026939a1ee89b54ad5b1c2d9c2d482f9928 Mon Sep 17 00:00:00 2001 From: ElaineDeMattosSilvaB Date: Mon, 8 Dec 2025 13:03:23 +0100 Subject: [PATCH 1/8] feat(core-plugin-api): add optional description to plugin feature flags Signed-off-by: ElaineDeMattosSilvaB --- .changeset/eager-toes-rest.md | 23 ++++++++++++++++++++ packages/core-app-api/src/app/AppManager.tsx | 1 + packages/core-plugin-api/src/plugin/types.ts | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 .changeset/eager-toes-rest.md diff --git a/.changeset/eager-toes-rest.md b/.changeset/eager-toes-rest.md new file mode 100644 index 0000000000..bf5a167264 --- /dev/null +++ b/.changeset/eager-toes-rest.md @@ -0,0 +1,23 @@ +--- +'@backstage/core-plugin-api': patch +'@backstage/core-app-api': patch +--- + +Add optional `description` field to plugin-level feature flags. + +Plugin developers can now provide an optional description for their feature flags: + +```ts +export const myPlugin = createPlugin({ + id: 'my-plugin', + featureFlags: [ + { + name: 'show-beta-feature', + description: 'Enables the new beta dashboard view', + }, + ], +}); + +If no description is provided, the default "Registered in {pluginId} plugin" message is shown. + +``` diff --git a/packages/core-app-api/src/app/AppManager.tsx b/packages/core-app-api/src/app/AppManager.tsx index 98067267b5..f9a992cb6e 100644 --- a/packages/core-app-api/src/app/AppManager.tsx +++ b/packages/core-app-api/src/app/AppManager.tsx @@ -336,6 +336,7 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be for (const flag of plugin.getFeatureFlags()) { featureFlagsApi.registerFlag({ name: flag.name, + description: flag.description, pluginId: plugin.getId(), }); } diff --git a/packages/core-plugin-api/src/plugin/types.ts b/packages/core-plugin-api/src/plugin/types.ts index 3ba7706e16..057f493530 100644 --- a/packages/core-plugin-api/src/plugin/types.ts +++ b/packages/core-plugin-api/src/plugin/types.ts @@ -73,6 +73,8 @@ export type BackstagePlugin< export type PluginFeatureFlagConfig = { /** Feature flag name */ name: string; + /** Feature flag description */ + description?: string; }; /** From 0ec181bd2f35eee373ce8e5ec1a9d5da1c3e5f5c Mon Sep 17 00:00:00 2001 From: ElaineDeMattosSilvaB Date: Mon, 8 Dec 2025 13:29:57 +0100 Subject: [PATCH 2/8] chore: add report api Signed-off-by: ElaineDeMattosSilvaB --- packages/core-plugin-api/report.api.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core-plugin-api/report.api.md b/packages/core-plugin-api/report.api.md index dc5a042488..2953e15700 100644 --- a/packages/core-plugin-api/report.api.md +++ b/packages/core-plugin-api/report.api.md @@ -500,6 +500,7 @@ export type PluginConfig< // @public export type PluginFeatureFlagConfig = { name: string; + description?: string; }; export { ProfileInfo }; From f6a9cffd748b985d2398d4c6d7a7144a281f6b31 Mon Sep 17 00:00:00 2001 From: ElaineDeMattosSilvaB Date: Wed, 25 Feb 2026 16:25:34 +0100 Subject: [PATCH 3/8] chore: remove additional text from changelog and add to docu Signed-off-by: ElaineDeMattosSilvaB --- .changeset/eager-toes-rest.md | 17 ----------------- docs/plugins/feature-flags.md | 8 +++++++- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/.changeset/eager-toes-rest.md b/.changeset/eager-toes-rest.md index bf5a167264..491b0f625a 100644 --- a/.changeset/eager-toes-rest.md +++ b/.changeset/eager-toes-rest.md @@ -4,20 +4,3 @@ --- Add optional `description` field to plugin-level feature flags. - -Plugin developers can now provide an optional description for their feature flags: - -```ts -export const myPlugin = createPlugin({ - id: 'my-plugin', - featureFlags: [ - { - name: 'show-beta-feature', - description: 'Enables the new beta dashboard view', - }, - ], -}); - -If no description is provided, the default "Registered in {pluginId} plugin" message is shown. - -``` diff --git a/docs/plugins/feature-flags.md b/docs/plugins/feature-flags.md index e9e000df0d..95fd4a0a74 100644 --- a/docs/plugins/feature-flags.md +++ b/docs/plugins/feature-flags.md @@ -19,11 +19,17 @@ import { createPlugin } from '@backstage/core-plugin-api'; export const examplePlugin = createPlugin({ // ... - featureFlags: [{ name: 'show-example-feature' }], + featureFlags: [ + { + name: 'show-example-feature', + description: 'Enables the new beta dashboard view', + }, // ... }); ``` +Note that the `description` property is optional. If not provided, the default "Registered in {pluginId} plugin" message is shown. + ### In the application Defining a feature flag in the application is done by adding feature flags in `featureFlags` array in the From 9f0596427734f31713d7bbf8840db0b252109168 Mon Sep 17 00:00:00 2001 From: ElaineDeMattosSilvaB Date: Wed, 25 Feb 2026 17:13:23 +0100 Subject: [PATCH 4/8] feat: add the description also to the NFS Signed-off-by: ElaineDeMattosSilvaB --- .changeset/polite-deer-rhyme.md | 6 ++++++ .../frontend-app-api/src/wiring/createSpecializedApp.tsx | 2 ++ packages/frontend-plugin-api/src/wiring/types.ts | 1 + 3 files changed, 9 insertions(+) create mode 100644 .changeset/polite-deer-rhyme.md diff --git a/.changeset/polite-deer-rhyme.md b/.changeset/polite-deer-rhyme.md new file mode 100644 index 0000000000..890cc16c1e --- /dev/null +++ b/.changeset/polite-deer-rhyme.md @@ -0,0 +1,6 @@ +--- +'@backstage/frontend-plugin-api': patch +'@backstage/frontend-app-api': patch +--- + +Add optional `description` field to plugin-level feature flags. diff --git a/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx b/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx index d56a609bb9..c53e3191ea 100644 --- a/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx +++ b/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx @@ -357,6 +357,7 @@ export function createSpecializedApp(options?: CreateSpecializedAppOptions): { OpaqueFrontendPlugin.toInternal(feature).featureFlags.forEach(flag => featureFlagApi.registerFlag({ name: flag.name, + description: flag.description, pluginId: feature.id, }), ); @@ -365,6 +366,7 @@ export function createSpecializedApp(options?: CreateSpecializedAppOptions): { toInternalFrontendModule(feature).featureFlags.forEach(flag => featureFlagApi.registerFlag({ name: flag.name, + description: flag.description, pluginId: feature.pluginId, }), ); diff --git a/packages/frontend-plugin-api/src/wiring/types.ts b/packages/frontend-plugin-api/src/wiring/types.ts index 0b59e7a7fb..f4d0af9501 100644 --- a/packages/frontend-plugin-api/src/wiring/types.ts +++ b/packages/frontend-plugin-api/src/wiring/types.ts @@ -29,6 +29,7 @@ import { FrontendPlugin } from './createFrontendPlugin'; export type FeatureFlagConfig = { /** Feature flag name */ name: string; + description?: string; }; /** @public */ From 661038ce80e7d0ef4f60f108be3d5d11596de274 Mon Sep 17 00:00:00 2001 From: ElaineDeMattosSilvaB Date: Wed, 25 Feb 2026 17:21:02 +0100 Subject: [PATCH 5/8] chore: add api report Signed-off-by: ElaineDeMattosSilvaB --- packages/frontend-plugin-api/report.api.md | 1 + packages/frontend-plugin-api/src/wiring/types.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index c83511fc47..eb33d23ec9 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -1290,6 +1290,7 @@ export type FeatureFlag = { // @public export type FeatureFlagConfig = { name: string; + description?: string; }; // @public diff --git a/packages/frontend-plugin-api/src/wiring/types.ts b/packages/frontend-plugin-api/src/wiring/types.ts index f4d0af9501..eeba468c37 100644 --- a/packages/frontend-plugin-api/src/wiring/types.ts +++ b/packages/frontend-plugin-api/src/wiring/types.ts @@ -29,6 +29,7 @@ import { FrontendPlugin } from './createFrontendPlugin'; export type FeatureFlagConfig = { /** Feature flag name */ name: string; + /** Feature flag description */ description?: string; }; From 457d6c2c06acc9a73c0411e2679e8b76064e3eb9 Mon Sep 17 00:00:00 2001 From: ElaineDeMattosSilvaB Date: Wed, 25 Feb 2026 17:24:57 +0100 Subject: [PATCH 6/8] chore: add both changes to the same changelog Signed-off-by: ElaineDeMattosSilvaB --- .changeset/eager-toes-rest.md | 2 ++ .changeset/polite-deer-rhyme.md | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 .changeset/polite-deer-rhyme.md diff --git a/.changeset/eager-toes-rest.md b/.changeset/eager-toes-rest.md index 491b0f625a..ce9764574c 100644 --- a/.changeset/eager-toes-rest.md +++ b/.changeset/eager-toes-rest.md @@ -1,6 +1,8 @@ --- '@backstage/core-plugin-api': patch '@backstage/core-app-api': patch +'@backstage/frontend-plugin-api': patch +'@backstage/frontend-app-api': patch --- Add optional `description` field to plugin-level feature flags. diff --git a/.changeset/polite-deer-rhyme.md b/.changeset/polite-deer-rhyme.md deleted file mode 100644 index 890cc16c1e..0000000000 --- a/.changeset/polite-deer-rhyme.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/frontend-plugin-api': patch -'@backstage/frontend-app-api': patch ---- - -Add optional `description` field to plugin-level feature flags. From 4a656e2a4bce2863dc208a555f4381e23174227f Mon Sep 17 00:00:00 2001 From: ElaineDeMattosSilvaB Date: Wed, 25 Feb 2026 17:51:51 +0100 Subject: [PATCH 7/8] fix: add closing bracket Signed-off-by: ElaineDeMattosSilvaB --- docs/plugins/feature-flags.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/plugins/feature-flags.md b/docs/plugins/feature-flags.md index 95fd4a0a74..2d0e34ba4b 100644 --- a/docs/plugins/feature-flags.md +++ b/docs/plugins/feature-flags.md @@ -24,6 +24,7 @@ export const examplePlugin = createPlugin({ name: 'show-example-feature', description: 'Enables the new beta dashboard view', }, + ], // ... }); ``` From a252e4d412000bac26071e3b682782b0d0c9751d Mon Sep 17 00:00:00 2001 From: ElaineDeMattosSilvaB Date: Wed, 25 Feb 2026 17:52:22 +0100 Subject: [PATCH 8/8] chore: add test Signed-off-by: ElaineDeMattosSilvaB --- .../src/wiring/createSpecializedApp.test.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/frontend-app-api/src/wiring/createSpecializedApp.test.tsx b/packages/frontend-app-api/src/wiring/createSpecializedApp.test.tsx index e21befc80e..51c31aca25 100644 --- a/packages/frontend-app-api/src/wiring/createSpecializedApp.test.tsx +++ b/packages/frontend-app-api/src/wiring/createSpecializedApp.test.tsx @@ -103,7 +103,10 @@ describe('createSpecializedApp', () => { features: [ createFrontendPlugin({ pluginId: 'test', - featureFlags: [{ name: 'a' }, { name: 'b' }], + featureFlags: [ + { name: 'a' }, + { name: 'b', description: 'Feature B description' }, + ], extensions: [ createExtension({ attachTo: { id: 'root', input: 'app' }, @@ -146,6 +149,11 @@ describe('createSpecializedApp', () => { expect(screen.getByText('flags:test=a,test=b')).toBeInTheDocument(); + expect(flags).toEqual([ + { name: 'a', pluginId: 'test' }, + { name: 'b', pluginId: 'test', description: 'Feature B description' }, + ]); + expect(app.apis).toMatchInlineSnapshot(` ApiResolver { "apis": Map {