Skip to content

Migrate sidecar client to V3 API#364

Open
danmux wants to merge 1 commit into
mainfrom
dm-claude/v3-sidecar-api
Open

Migrate sidecar client to V3 API#364
danmux wants to merge 1 commit into
mainfrom
dm-claude/v3-sidecar-api

Conversation

@danmux
Copy link
Copy Markdown
Contributor

@danmux danmux commented May 26, 2026

Summary

  • Switch all sidecar endpoints from /api/v2/sidecar/ to /api/v3/sidecar/
  • Resource-creation requests (create sidecar, create snapshot) send V3 data envelopes; scoped actions (exec, add-key) stay flat
  • Responses decoded from V3 envelope using pre-initialized typed pointers
  • Add GetCommand method
  • Update fakes and all tests

🤖 Generated with Claude Code

Switch all sidecar endpoints from /api/v2/sidecar/ to /api/v3/sidecar/.
Resource-creation requests (create sidecar, create snapshot) now send
V3 data envelopes; scoped actions (exec, add-key) stay flat. Responses
decoded from V3 envelope using pre-initialized typed pointers. Add
GetCommand method. Update fakes and all tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@z00b z00b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like ListSnapshots is still on /v2/


id := c.Param("id")
for _, s := range f.Snapshots {
c.JSON(http.StatusOK, gin.H{
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.

claude tells me that moving this c.JSON outside of the if s.ID == id clause changes the intent.

}
})

t.Run("omits all param by default", func(t *testing.T) {
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 name is not quite accurate now?

return &Sidecar{
ID: env.Data.ID,
Name: attrs.Name,
OrgID: refs.Org.ID,
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.

do we not want the image value in here as well?

sc.OrgID = id
}
}
}
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.

image ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants