Repository navigation
feat: plan the AWS setup steps - #928
Conversation
07a0ea4 to
3489632
Compare
3489632 to
57a42ab
Compare
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 57a42ab. Configure here.
57a42ab to
e4b9c97
Compare
|
Three notes on the plan representation and 1.
|
e4b9c97 to
da7bd70
Compare
da7bd70 to
e83aee9
Compare
e83aee9 to
4b37991
Compare
4b37991 to
0217e1a
Compare
0217e1a to
0b7a5d8
Compare
d245990 to
9a7ec1f
Compare
9a7ec1f to
dd626b0
Compare
|
@Andrewjeska, thanks! All three points are fixed.
This reply is from Claude. |
0371dfe to
53256f2
Compare
PlanSetup reads AWS and returns a SetupPlan. It writes nothing. The plan has one step each for the IAM roles, the agent space, the account association, the operator app, and the MCP server, and a line that describes each step. A role that does not exist gets created. A role that setup made gets updated. A role that setup did not make stays as it is. The plan creates a space, reuses it, or only connects to it. If two spaces have the name, the plan stops and asks for --agent-space-id. With --new-agent-space, the plan does not create a space with a name that a space in the region uses. If the operator app is off, the plan enables it. If it is on, the plan keeps its sign-in, unless AuthFlowSet is true. The plan reuses the MCP server, registers it, replaces its token, or asks for a token. Nothing calls PlanSetup yet. The next PR runs the plan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SetupPlan had a structured step and a text line for each part of the plan. A connect plan set the text to "No change" but kept other values in the steps, so the two could disagree. SetupPlan now holds only the steps, and Text describes them. MCPSkip is the step for a run without a token. --mcp-service-id must name an MCP server at the LaunchDarkly endpoint. For a server at another endpoint, setup stops and names --mcp-endpoint for a LaunchDarkly MCP server that the customer hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan line for a reused MCP server shows its name in AWS. Setup finds the server by its endpoint, so the name can differ from LaunchDarkly. A connect plan never creates a space, so --new-agent-space does not make a used name an error. Without a name, the connect error no longer has an empty gap where the name goes. An empty name matches no space. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan line for a sign-in change now says "from IAM to IdP", so a change to a sign-in that someone else set up is visible before setup asks to continue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: David Brackbill <77071769+davidbrackbill@users.noreply.github.com>
7121d9c to
ab6b870
Compare

Summary
This PR adds
PlanSetup, which decides every setup step before setup writes to AWS. It reads AWS and returns a plan for the IAM roles, the agent space, the account association, the operator app, and the MCP server. It writes nothing. Nothing calls it yet, andmain'sSetupstill runs. The next PR runs the plan.Requirements
Related issues
None.
Describe the solution you've provided
Setupwrote to AWS as it went. It created the IAM roles before it looked at the agent space. You could not see what it would change before it changed it.PlanSetupreads AWS and returns aSetupPlan. The plan has one step each for the IAM roles, the agent space, the account association, the operator app, and the MCP server.PlanSetupwrites nothing.No changefor the operator app, but its step kept the current sign-in.SetupPlanholds only the steps.Textdescribes them, so the printed plan always comes from the steps. In a connect plan, the app step keeps the current sign-in, because the run reports it, andTextsaysNo change.MCPSkipis the step for a run in which the user gave no token.SetupcalledEnableOperatorAppon every run with the defaultiamsign-in. On a reused space, this changed a sign-in that someone had set up.AuthFlowSetis true. The plan reads the app withappState.FindAgentSpacereused the first space with the name. With two spaces of the same name, the choice was not predictable.--agent-space-id. With--new-agent-space, the plan does not create a space with a name that a space in the region uses. A connect plan needs an existing space, so it stops if no space matches. A connect plan never creates a space, so--new-agent-spacedoes not make a used name an error there. An empty name matches no space.--mcp-service-idaccepted any registered MCP server, so setup could connect a server that is not a LaunchDarkly MCP server.--mcp-endpoint. Setup finds a LaunchDarkly MCP server by its endpoint everywhere else, because the name is the choice of the customer. For a server at another endpoint, the plan stops and names--mcp-endpointfor a LaunchDarkly MCP server that you host.Nothing calls
PlanSetupyet.main'sSetupstill runs. The next PR runs the plan. The plan is stricter thanSetup: it stops on two spaces with one name, and on--new-agent-spacewith a used name, whereSetuptakes the first space or creates a second one. The next PR replacesSetupwith the plan, so the printed plan matches what runs. The plan line for a reused MCP server shows the name of that server in AWS. The plan line for a sign-in change names the current sign-in, for exampleChange the operator app sign-in from IAM to IdP. The tests inplan_test.gocheck each plan decision.Describe alternatives you've considered
None.
Additional context
Testing:
go test ./...andgolangci-lintpass on this branch.🤖 Generated with Claude Code
Note
Overview
Adds
PlanSetup, a read-only dry-run that inspects AWS and returns aSetupPlan(agent space, IAM roles, account association, operator app, MCP server) before any writes. Human-readable output comes fromSetupPlan.Text(), which is derived from the structured steps so connect vs full-provision plans stay consistent.Planning behavior is stricter and more conservative than today’s
Setup: duplicate agent space names require--agent-space-id; connect mode never creates spaces; operator app sign-in is kept on reused spaces unlessAuthFlowSet(explicit--auth-flow);--mcp-service-idmust point at a LaunchDarkly MCP server at the expected (or--mcp-endpoint) URL, with replace flows naming affected spaces viaspacesWith.findMCPService/checkMCPServiceIDand lookup helpers support that validation.Adds
plan_test.goand extends test fakes (spaceLinksonListAssociations).Setupis unchanged and nothing in production callsPlanSetupyet—intended for a follow-up PR to execute the plan.Reviewed by Cursor Bugbot for commit 7121d9c. Bugbot is set up for automated code reviews on this repo. Configure here.