Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions integ-tests/add-remove-config-bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ describe('integration: add and remove config-bundle', () => {
const bundle = config.configBundles.find(b => b.name === 'FullOptsBundle');
expect(bundle).toBeDefined();
expect(bundle!.description).toBe('A bundle with all optional fields');
// --branch is gated behind ENABLE_GATED_FEATURES; when off, silently defaults to mainline
const expectedBranch = process.env.ENABLE_GATED_FEATURES === '1' ? 'feature-branch' : 'mainline';
expect(bundle!.branchName).toBe(expectedBranch);
expect(bundle!.branchName).toBe('feature-branch');
expect(bundle!.commitMessage).toBe('initial config');
});

Expand Down
4 changes: 1 addition & 3 deletions src/cli/commands/config-bundle/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
ListConfigurationBundleVersionsFilter,
} from '../../aws/agentcore-config-bundles';
import { getErrorMessage } from '../../errors';
import { isGatedFeaturesEnabled } from '../../feature-flags';
import { deepDiff } from '../../operations/config-bundle/diff-versions';
import { resolveBundleByName } from '../../operations/config-bundle/resolve-bundle';
import { requireProject } from '../../tui/guards';
Expand Down Expand Up @@ -259,8 +258,7 @@ export const registerConfigBundle = (program: Command) => {
}
});

// --- create-branch: gated until upstream CFN read-back bug is fixed for non-default branches ---
if (!isGatedFeaturesEnabled()) return cmd;
// --- create-branch ---
cmd
.command('create-branch')
.description('Create a new branch on an existing configuration bundle')
Expand Down
11 changes: 2 additions & 9 deletions src/cli/primitives/ConfigBundlePrimitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import type { Result } from '../../lib/result';
import type { ConfigBundle } from '../../schema';
import { ConfigBundleSchema } from '../../schema';
import { getErrorMessage } from '../errors';
import { isGatedFeaturesEnabled } from '../feature-flags';
import type { RemovalPreview, SchemaChange } from '../operations/remove/types';
import { BasePrimitive } from './BasePrimitive';
import type { AddResult, AddScreenComponent, RemovableResource } from './types';
import { Option } from '@commander-js/extra-typings';
import type { Command } from '@commander-js/extra-typings';
import { readFileSync } from 'fs';

Expand Down Expand Up @@ -116,12 +114,7 @@ export class ConfigBundlePrimitive extends BasePrimitive<AddConfigBundleOptions,
'Components map as inline JSON. Keys are ARNs or placeholders: {{runtime:<name>}}, {{gateway:<name>}}. Placeholders resolve to real ARNs at deploy time.'
)
.option('--components-file <path>', 'Path to components JSON file (same format as --components)')
// Gated: custom branches blocked by upstream CFN read-back bug. Remove gate when service fixes GetConfigurationBundle.
.addOption(
isGatedFeaturesEnabled()
? new Option('--branch <name>', 'Branch name for versioning')
: new Option('--branch <name>', 'Branch name for versioning').hideHelp()
)
.option('--branch <name>', 'Branch name for versioning')
.option('--commit-message <text>', 'Commit message for this version')
.option('--json', 'Output as JSON')
.action(
Expand Down Expand Up @@ -173,7 +166,7 @@ export class ConfigBundlePrimitive extends BasePrimitive<AddConfigBundleOptions,
name: cliOptions.name!,
description: cliOptions.description,
components,
branchName: isGatedFeaturesEnabled() ? cliOptions.branch : undefined,
branchName: cliOptions.branch,
commitMessage: cliOptions.commitMessage,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,11 @@ describe('useAddConfigBundleWizard — add-another back-navigation (BUG TUI-B)',
const { ref } = setup();
advanceToAddAnother(ref);
act(() => ref.current!.wizard.doneAddingComponents());
// When ENABLE_GATED_FEATURES is off, branchName is skipped (defaults to mainline)
const expectedStep = process.env.ENABLE_GATED_FEATURES === '1' ? 'branchName' : 'commitMessage';
expect(ref.current!.wizard.step).toBe(expectedStep);
expect(ref.current!.wizard.step).toBe('branchName');

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

it('first-pass back-navigation is unaffected (componentType → description)', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { ComponentConfigurationMap } from '../../../../schema';
import { isGatedFeaturesEnabled } from '../../../feature-flags';
import type { AddConfigBundleConfig, AddConfigBundleStep, ComponentType } from './types';
import { useCallback, useState } from 'react';

Expand Down Expand Up @@ -103,11 +102,7 @@ export function useAddConfigBundleWizard() {

const doneAddingComponents = useCallback(() => {
setInAddAnotherLoop(false);
if (isGatedFeaturesEnabled()) {
setStep('branchName');
} else {
setStep('commitMessage');
}
setStep('branchName');
}, []);

const setBranchName = useCallback((branchName: string) => {
Expand Down
Loading