Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix!: use devcontainer ID when rebuilding a devcontainer#18604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DanielleMaywood merged 2 commits intomainfromdanielle/container-rebuild
Jun 26, 2025

Conversation

DanielleMaywood
Copy link
Contributor

This PR replaces the use of thecontainer ID with thedevcontainer ID. This is a breaking change. This allows rebuilding a devcontainer when there is no valid container ID.

This PR replaces the use of the **container** ID with the**devcontainer** ID. This is a breaking change. This allows rebuilding adevcontainer when there is no valid container ID.
@DanielleMaywoodDanielleMaywood marked this pull request as ready for reviewJune 26, 2025 09:59
@github-actionsgithub-actionsbot added the release/breakingThis label is applied to PRs to detect breaking changes as part of the release process labelJun 26, 2025
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR changes API endpoints and internal references to use the devcontainer ID rather than the container ID. Key changes include updating URL paths, parameter names, and related error messages in both the API and its documentation.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
site/src/modules/resources/AgentDevcontainerCard.tsxUpdated the endpoint URL to use devcontainer.id
docs/reference/api/agents.mdUpdated the API documentation and parameter names
codersdk/workspacesdk/agentconn.goChanged function signature and URL path for recreating devcontainers
codersdk/workspaceagents.goRefactored the workspace agent recreate method to use devcontainerID
coderd/workspaceagents_test.goUpdated tests to align with the new devcontainer ID usage
coderd/workspaceagents.go, coderd/coderd.go, coderd/apidoc/swagger.json, coderd/apidoc/docs.goModified routing, error messages, and API docs for consistency
agent/agentcontainers/api_test.go, agent/agentcontainers/api.goAdjusted API routes and tests to reflect the devcontainer changes

return
var workspaceFolder string
for _, dc := range api.knownDevcontainers {
if dc.ID.String() == devcontainerID {
Copy link
Preview

CopilotAIJun 26, 2025

Choose a reason for hiding this comment

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

Consider refactoring the 'knownDevcontainers' map to be keyed by the devcontainer ID instead of the workspaceFolder. This change can improve lookup clarity and avoid potential key collisions when multiple devcontainers share the same workspace folder.

Copilot uses AI. Check for mistakes.

@DanielleMaywoodDanielleMaywood requested review frommafredri andjohnstcn and removed request formafredriJune 26, 2025 10:02
@johnstcnjohnstcn requested a review frommafredriJune 26, 2025 10:12
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Except for the minor nit, this looks good to me. A bit more invasive than I imagined but we should be OK and good to get this changed before GA 👍🏻

if dc.ID.String() == devcontainerID {
workspaceFolder = dc.WorkspaceFolder
break
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: This could be simplified by storingdc from the for-loop rather than doing two lookups first ID then workspace folder (which we already know).

DanielleMaywood reacted with thumbs up emoji
@@ -494,8 +494,8 @@ func (api *API) Routes() http.Handler {
r.Get("/", api.handleList)
// TODO(mafredri): Simplify this route as the previous /devcontainers
// /-route was dropped. We can drop the /devcontainers prefix here too.
r.Route("/devcontainers", func(r chi.Router) {
r.Post("/container/{container}/recreate", api.handleDevcontainerRecreate)
r.Route("/devcontainers/{devcontainer}", func(r chi.Router) {
Copy link
Member

Choose a reason for hiding this comment

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

This dawned on me just now, but we could takeworkspaceFolder here instead, which will allow starting any non-started devcontainer even if it doesn't exist. 😅 We can table this for now though as implementing it would be preemptive and more thought behind it would be good.

johnstcn reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Oooh that could be good to add in the future.

@@ -626,7 +638,7 @@ func TestAPI(t *testing.T) {

fori:=rangett.wantStatus {
// Simulate HTTP request to the recreate endpoint.
req:=httptest.NewRequest(http.MethodPost,"/devcontainers/container/"+tt.containerID+"/recreate",nil).
req:=httptest.NewRequest(http.MethodPost,"/devcontainers/"+tt.devcontainerID+"/recreate",nil).
Copy link
Member

Choose a reason for hiding this comment

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

This is a much more sensible URL 😍

@DanielleMaywoodDanielleMaywood merged commitf2d229e intomainJun 26, 2025
39 checks passed
@DanielleMaywoodDanielleMaywood deleted the danielle/container-rebuild branchJune 26, 2025 10:42
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 26, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

Copilot code reviewCopilotCopilot left review comments

@mafredrimafredrimafredri approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@DanielleMaywoodDanielleMaywood

Labels
release/breakingThis label is applied to PRs to detect breaking changes as part of the release process
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@DanielleMaywood@mafredri@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp