Repository navigation
feat: show names and states in the plaintext status output - #920
Conversation
9608847 to
f1deeee
Compare
f1deeee to
55ca900
Compare
55ca900 to
8dc00c1
Compare
8dc00c1 to
ab0787c
Compare
|
bugbot run |
ab0787c to
aa3c980
Compare
| assert.True(t, strings.HasSuffix(trimmed, awsdevops.ConsoleURL("us-east-1")), "output must end with the console URL") | ||
| } | ||
|
|
||
| func TestStatusEmptyNamesSetupCommand(t *testing.T) { |
There was a problem hiding this comment.
The status code is correct, but three faults pass every test in cmd/aws_devops_agent and internal/awsdevops. I tried each one in a worktree.
- Replace the empty-account condition at
status.go:63withif false. Tests pass.TestStatusEmptyNamesSetupCommandchecks for the setup command, the account ID, and the console URL, but the "No agent spaces. Run ldcli aws-devops-agent setup." line also has them. Suggest: assert "Nothing is set up" and assert that "IAM roles:" is absent. - Change
anyRole(status.go:59-62) to "all roles exist". Tests pass. No test has one role ready with no services and no spaces. With this fault, a half-finished setup prints "Nothing is set up" and hides the role. Suggest: a test with roles[ready, missing]and nothing else. - Make
plainStatereturn""forpending-confirmation, or return the raw value forinvalid. Tests pass.TestStatusAssociationShowsPlainStateonly asserts that the raw words are absent. Suggest: assert "waiting for confirmation", and addinvalidand empty cases.
There was a problem hiding this comment.
Thank you. Commit 68672dd4 adds tests for all three faults. I ran each fault again, and each one now fails a test.
TestStatusEmptyNamesSetupCommandnow asserts "Nothing is set up. Run ldcli aws-devops-agent setup." and asserts that "IAM roles:" is absent.TestStatusOneRoleShowsTheRoleshas roles[ready, missing]and nothing else. It asserts that "Nothing is set up" is absent and that each role shows its state.TestStatusAssociationShowsPlainStatenow asserts "waiting for confirmation".TestStatusPlainStateNamesEachStatecoversvalid,invalid,pending-confirmation, an empty state, and an unknown state.
This reply is from Claude.
|
Two notes from a pass through this PR — both minor but worth catching before it lands. 1.
|
e42b508 to
0eec8ae
Compare
|
@Andrewjeska, thank you. Commit
This reply is from Claude. |
The status command names each role with a state, not an ARN. Each association names its service, not only the service ID. If nothing is set up, the output names the setup command. The JSON output does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDK has one service type for each MCP server vendor, for example mcpserverdatadog. The status output now calls each of them an MCP server. New tests cover the empty account, an account with only one ready role, each association state, and the JSON fields that a partial setup sets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An agent space can read other AWS accounts. Each of those associations has the service ID "aws", so the status output showed the account that ran the command on every one of them. GetStatus now reads the account ID and the account type from the configuration of the association. The output names the account, and calls another account a source account. The status output also gives a plain name to each service type that the SDK knows, for example GitHub or PagerDuty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17e3475 to
1f768f4
Compare
Requirements
Related issues
None.
Describe the solution you've provided
statusoutput showed the full ARN of each IAM role. The ARN did not tell you if the role was ready.pending-confirmation. You could not see which service it was.AWS account 123456789012or the MCP server name. The state is in plain words, such asreadyorwaiting for confirmation.Nothing is set upand names thesetupcommand. It says that only if the account has no roles, no registered services, and no agent spaces, so a registered MCP server still shows.aws, so a label from the service ID alone named the wrong account.statusreads the account ID and the account type from the configuration of each AWS account association. Another account shows asSource AWS account <id>.githuborremoteagentsigv4showed as AWS sends them.GitHub. Each MCP server type isMCP server. An unknown type shows as AWS sends it.accountIdandaccountTypeto each AWS account association.aws-devops-agentcommand takes one. The JSON output still has them.Describe alternatives you've considered
None.
Additional context
Testing:
go test ./...andgolangci-lintpass on this branch.🤖 Generated with Claude Code
Note
Overview
Improves human-readable
ldcli aws-devops-agent statusby restructuring plaintext output into sections (IAM roles, services, agent spaces) with ready/missing role states instead of ARNs, friendly service labels (including MCP servers and multi-account AWS links), and plain-language association states (e.g.waiting for confirmation). When nothing is provisioned—or there are no agent spaces—it points users atldcli aws-devops-agent setup.Status data from AWS now populates
accountId/accountTypeon AWS (aws) associations so monitor vs source accounts can be distinguished in output; JSON mode still uses the sameprintJSONpath but association objects can include those optional fields (covered by fixture tests). Broad unit tests lock plaintext formatting and JSON shape.Reviewed by Cursor Bugbot for commit 17e3475. Bugbot is set up for automated code reviews on this repo. Configure here.