Skip to content

refactor: consolidate cli-config into global-config#802

Open
Hweinstock wants to merge 1 commit intoaws:mainfrom
Hweinstock:feat/consolidate-global-config
Open

refactor: consolidate cli-config into global-config#802
Hweinstock wants to merge 1 commit intoaws:mainfrom
Hweinstock:feat/consolidate-global-config

Conversation

@Hweinstock
Copy link
Copy Markdown
Contributor

@Hweinstock Hweinstock commented Apr 9, 2026

Description

cli-config.ts and global-config.ts both read/write ~/.agentcore/config.json with separate schemas and I/O. This consolidates them into a single owner (global-config.ts) with a Zod schema covering all fields.

  • Moved global-config.ts to src/lib/schemas/io/
  • Added readGlobalConfigSync for callers that want sync reads (build-args.ts, post-deploy-observability.ts)
  • Migrated both callers from readCliConfig to readGlobalConfigSync
  • Deleted cli-config.ts
  • Added tests for readGlobalConfigSync

Related Issue

Follow-up to #797

Documentation PR

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe): Internal refactor — consolidate two modules reading the same config file

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Verified: readGlobalConfigSync covers happy path (parsed config) and error paths (missing file, malformed JSON). Post-deploy-observability tests pass with updated mock target. Zero remaining references to readCliConfig or cli-config.ts.

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/l PR size: L label Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Package Tarball

aws-agentcore-0.7.1.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-802-tarball/aws-agentcore-0.7.1.tgz

@Hweinstock Hweinstock force-pushed the feat/consolidate-global-config branch from fb1cb6d to ce11738 Compare April 9, 2026 18:32
@github-actions github-actions bot added size/s PR size: S and removed size/l PR size: L labels Apr 9, 2026
@Hweinstock Hweinstock force-pushed the feat/consolidate-global-config branch from ce11738 to 17ed5c8 Compare April 9, 2026 18:45
@github-actions github-actions bot added size/m PR size: M and removed size/s PR size: S labels Apr 9, 2026
@Hweinstock Hweinstock force-pushed the feat/consolidate-global-config branch from 17ed5c8 to 39c6bc8 Compare April 9, 2026 18:53
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Apr 9, 2026
@Hweinstock Hweinstock marked this pull request as ready for review April 9, 2026 20:52
@Hweinstock Hweinstock requested a review from a team April 9, 2026 20:52
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.

2 participants