Skip to content

refactor(gateway): remove the separate mutation feature flag - #2402

Merged
aidandaly24 merged 5 commits into
aws:refactorfrom
aidandaly24:chore/remove-imperative-mutation-flag
Sep 25, 2026
Merged

aidandaly24 merged 5 commits into
aws:refactorfrom
aidandaly24:chore/remove-imperative-mutation-flag

Conversation

@aidandaly24

Copy link
Copy Markdown
Contributor

Description

Remove imperative-mutation-commands so Gateway mutations use the same default-off imperative-commands gate as the other standalone resource commands. This eliminates the overlapping settings and the extra config plumbing through Gateway factories. Existing config files tolerate the retired key, and tests cover availability, help, project guidance, and config compatibility.

Related Issue

Refs #2400. Follow-up to #2396.

Documentation PR

Not applicable: these internal opt-in settings are not part of the public command reference.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe): consolidate internal feature flags; the retired config key is no longer accepted by config.

Testing

3,559 tests passed with 98.00% line coverage. Also passed 59 built-CLI smoke checks covering both parent-flag states, existing retired-key values, all 12 Gateway mutations, and config reads/writes.

  • I ran bun test
  • I ran the relevant end-to-end tests with bun run test:e2e, or explained why they are not applicable
  • I ran bun run typecheck
  • I ran bun run lint:check
  • I ran bun run format:check
  • I ran bun run build
  • If I modified src/assets/, I updated affected snapshots with bun test <test-file> --update-snapshots and committed them

AWS deployment E2E tests are not applicable: no deployment logic or AWS request semantics changed. Fixture-backed command tests and TUI tests ran in the full suite. No assets changed.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@github-actions github-actions Bot added the size/m PR size: M label Sep 24, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added claude-security-reviewing Claude Code /security-review in progress agentcore-harness-reviewing AgentCore Harness review in progress labels Sep 24, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed claude-security-reviewing Claude Code /security-review in progress agentcore-harness-reviewing AgentCore Harness review in progress labels Sep 24, 2026

@agentcore-devx-automation agentcore-devx-automation Bot 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.

AgentCore Harness Review

Verdict: Looks good

Nice consolidation. The retired imperative-mutation-commands key is handled cleanly end-to-end:

  • Removed from globalConfigFileSchema, so Zod strips it on read (backward-compat for existing config files, including the previously-rejected "true" string form — covered by the parameterized test).
  • diff() in DefaultGlobalConfigAccessor.set naturally drops it on the next write since it only iterates keys present in DEFAULT_GLOBAL_CONFIG.
  • The config CLI handler rejects reads/writes of the retired key via its z.enum(getKeys(DEFAULT_GLOBAL_CONFIG)) argument schema.

The added gateway.name() === "gateway" guard in GatewayCreateScreen is a real fix: when imperative-commands is off, resolveCommand walks off the tree and returns the root command, whose create child would otherwise cause the screen to incorrectly render CliOnlyScreen. The test in gateway.mutations.screen.test.tsx (“disabled direct create opens project guidance and returns to root”) exercises exactly this path.

Test coverage looks thorough (both flag states, legacy on-disk values, help/menu registration, project-guidance routing), no new mocking concerns, and no telemetry gap since this is a pure refactor.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.25%. Comparing base (7d8f74d) to head (6715fdc).

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2402      +/-   ##
============================================
- Coverage     97.25%   97.25%   -0.01%     
============================================
  Files           612      612              
  Lines         41019    40986      -33     
============================================
- Hits          39893    39860      -33     
  Misses         1126     1126              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

nice!

globalConfigAccessor: new TestGlobalConfigAccessor({
initialConfigData: IMPERATIVE_GLOBAL_CONFIG,
}),
globalConfig: IMPERATIVE_GLOBAL_CONFIG,

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.

this still looks so strange to me, but I know it requires so re-wiring so OOS here.

@aidandaly24
aidandaly24 merged commit f43a731 into aws:refactor Sep 25, 2026
22 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants