Skip to content

feat(cli): add consistent JSON output to project mutations - #2218

Draft
notgitika wants to merge 2 commits into
refactorfrom
feat/json-output-consistency
Draft

feat(cli): add consistent JSON output to project mutations#2218
notgitika wants to merge 2 commits into
refactorfrom
feat/json-output-consistency

Conversation

@notgitika

Copy link
Copy Markdown
Contributor

Uses the existing global JsonKey / JsonRendererKey path with a shared project mutation envelope for create, add, and remove. All project add leaves now use one runWithProgress wrapper, and nested help shows inherited global options.

Human-readable output remains unchanged.

@github-actions github-actions Bot added the size/l PR size: L label Sep 4, 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 4, 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 the claude-security-reviewing Claude Code /security-review in progress label Sep 4, 2026
@notgitika
notgitika marked this pull request as draft September 4, 2026 05:26

@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, well-scoped refactor. The new ProjectMutationResult contract via src/handlers/project/output.ts is consistent across create, add *, and remove *, and the addProjectResource helper in src/handlers/project/add/shared.ts cleanly collapses the duplicated for await loops. A few small observations, none blocking:

  • parentFor in add/shared.ts and the ternary chain in remove/index.ts (lines 135–142) encode the same parent-relationship knowledge in two places. If a third resource ever gains a parent, both must be updated. Consider extracting a single parentFor(resourceType, flags) helper shared by both sides — optional cleanup, not required now.
  • addProjectResource hard-codes interactive: false for runWithProgress. That preserves byte-for-byte behavior of the previous for await loop, which is what the comment says is intended, so this is fine — just worth noting if you later want add commands to get the same live TaskList UI as create/deploy.
  • remove always emits removedEnvironmentKeys (including [] when nothing was removed), while add/create never emit it. The contract is unambiguous, but you may want to document that shape somewhere consumer-facing (schema/docs) so tools can rely on it.

The tests use real temp-dir projects and go through run(...) end-to-end — no excessive mocking. The router showGlobalOptions: true change is small, covered by a new test, and orthogonal but reasonable to bundle here.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 4, 2026
@codecov-commenter

codecov-commenter commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.05%. Comparing base (da28031) to head (775a74a).

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2218      +/-   ##
============================================
+ Coverage     97.04%   97.05%   +0.01%     
============================================
  Files           544      546       +2     
  Lines         37536    37669     +133     
============================================
+ Hits          36428    36561     +133     
  Misses         1108     1108              

☔ 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.

@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Sep 4, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 4, 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 the claude-security-reviewing Claude Code /security-review in progress label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants