Skip to content

Commit 2fdec1e

Browse files
authored
fix(config-bundle): ungate custom branchName feature (#1632)
1 parent bac7f61 commit 2fdec1e

5 files changed

Lines changed: 7 additions & 26 deletions

File tree

integ-tests/add-remove-config-bundle.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ describe('integration: add and remove config-bundle', () => {
109109
const bundle = config.configBundles.find(b => b.name === 'FullOptsBundle');
110110
expect(bundle).toBeDefined();
111111
expect(bundle!.description).toBe('A bundle with all optional fields');
112-
// --branch is gated behind ENABLE_GATED_FEATURES; when off, silently defaults to mainline
113-
const expectedBranch = process.env.ENABLE_GATED_FEATURES === '1' ? 'feature-branch' : 'mainline';
114-
expect(bundle!.branchName).toBe(expectedBranch);
112+
expect(bundle!.branchName).toBe('feature-branch');
115113
expect(bundle!.commitMessage).toBe('initial config');
116114
});
117115

src/cli/commands/config-bundle/command.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
ListConfigurationBundleVersionsFilter,
99
} from '../../aws/agentcore-config-bundles';
1010
import { getErrorMessage } from '../../errors';
11-
import { isGatedFeaturesEnabled } from '../../feature-flags';
1211
import { deepDiff } from '../../operations/config-bundle/diff-versions';
1312
import { resolveBundleByName } from '../../operations/config-bundle/resolve-bundle';
1413
import { requireProject } from '../../tui/guards';
@@ -259,8 +258,7 @@ export const registerConfigBundle = (program: Command) => {
259258
}
260259
});
261260

262-
// --- create-branch: gated until upstream CFN read-back bug is fixed for non-default branches ---
263-
if (!isGatedFeaturesEnabled()) return cmd;
261+
// --- create-branch ---
264262
cmd
265263
.command('create-branch')
266264
.description('Create a new branch on an existing configuration bundle')

src/cli/primitives/ConfigBundlePrimitive.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import type { Result } from '../../lib/result';
33
import type { ConfigBundle } from '../../schema';
44
import { ConfigBundleSchema } from '../../schema';
55
import { getErrorMessage } from '../errors';
6-
import { isGatedFeaturesEnabled } from '../feature-flags';
76
import type { RemovalPreview, SchemaChange } from '../operations/remove/types';
87
import { BasePrimitive } from './BasePrimitive';
98
import type { AddResult, AddScreenComponent, RemovableResource } from './types';
10-
import { Option } from '@commander-js/extra-typings';
119
import type { Command } from '@commander-js/extra-typings';
1210
import { readFileSync } from 'fs';
1311

@@ -116,12 +114,7 @@ export class ConfigBundlePrimitive extends BasePrimitive<AddConfigBundleOptions,
116114
'Components map as inline JSON. Keys are ARNs or placeholders: {{runtime:<name>}}, {{gateway:<name>}}. Placeholders resolve to real ARNs at deploy time.'
117115
)
118116
.option('--components-file <path>', 'Path to components JSON file (same format as --components)')
119-
// Gated: custom branches blocked by upstream CFN read-back bug. Remove gate when service fixes GetConfigurationBundle.
120-
.addOption(
121-
isGatedFeaturesEnabled()
122-
? new Option('--branch <name>', 'Branch name for versioning')
123-
: new Option('--branch <name>', 'Branch name for versioning').hideHelp()
124-
)
117+
.option('--branch <name>', 'Branch name for versioning')
125118
.option('--commit-message <text>', 'Commit message for this version')
126119
.option('--json', 'Output as JSON')
127120
.action(
@@ -173,7 +166,7 @@ export class ConfigBundlePrimitive extends BasePrimitive<AddConfigBundleOptions,
173166
name: cliOptions.name!,
174167
description: cliOptions.description,
175168
components,
176-
branchName: isGatedFeaturesEnabled() ? cliOptions.branch : undefined,
169+
branchName: cliOptions.branch,
177170
commitMessage: cliOptions.commitMessage,
178171
});
179172

src/cli/tui/screens/config-bundle/__tests__/useAddConfigBundleWizard.test.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,11 @@ describe('useAddConfigBundleWizard — add-another back-navigation (BUG TUI-B)',
7474
const { ref } = setup();
7575
advanceToAddAnother(ref);
7676
act(() => ref.current!.wizard.doneAddingComponents());
77-
// When ENABLE_GATED_FEATURES is off, branchName is skipped (defaults to mainline)
78-
const expectedStep = process.env.ENABLE_GATED_FEATURES === '1' ? 'branchName' : 'commitMessage';
79-
expect(ref.current!.wizard.step).toBe(expectedStep);
77+
expect(ref.current!.wizard.step).toBe('branchName');
8078

8179
// Back from the current step follows the linear order, not the loop guard.
8280
act(() => ref.current!.wizard.goBack());
83-
const expectedBackStep = process.env.ENABLE_GATED_FEATURES === '1' ? 'addAnother' : 'branchName';
84-
expect(ref.current!.wizard.step).toBe(expectedBackStep);
81+
expect(ref.current!.wizard.step).toBe('addAnother');
8582
});
8683

8784
it('first-pass back-navigation is unaffected (componentType → description)', () => {

src/cli/tui/screens/config-bundle/useAddConfigBundleWizard.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { ComponentConfigurationMap } from '../../../../schema';
2-
import { isGatedFeaturesEnabled } from '../../../feature-flags';
32
import type { AddConfigBundleConfig, AddConfigBundleStep, ComponentType } from './types';
43
import { useCallback, useState } from 'react';
54

@@ -103,11 +102,7 @@ export function useAddConfigBundleWizard() {
103102

104103
const doneAddingComponents = useCallback(() => {
105104
setInAddAnotherLoop(false);
106-
if (isGatedFeaturesEnabled()) {
107-
setStep('branchName');
108-
} else {
109-
setStep('commitMessage');
110-
}
105+
setStep('branchName');
111106
}, []);
112107

113108
const setBranchName = useCallback((branchName: string) => {

0 commit comments

Comments
 (0)