8000 fix(agent): fix script filtering for devcontainers by mafredri · Pull Request #18635 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix(agent): fix script filtering for devcontainers #18635

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2025

Conversation

mafredri
Copy link
Member

This was broken in #18630.

slog.F("config_path_param", configPath),
)
}

// Send logs via agent logging facilities.
logSourceID := api.devcontainerLogSourceIDs[dc.WorkspaceFolder]
Copy link
Member Author

Choose a reason for hiding this comment

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

Review: We were accessing this outside the mutex so I moved it just in case due to change in how we Init() the API which allows part of the API to be used before Init() is called with input that changes this map.

@mafredri mafredri force-pushed the mafredri/fix-agent-fix-devcontainer-script-filtering branch from 8402237 to 18bfab2 Compare June 27, 2025 13:31
@mafredri mafredri marked this pull request as ready for review June 27, 2025 13:33
agentcontainers.WithSubAgentClient(agentcontainers.NewSubAgentClientFromAPI(a.logger, aAPI)),
)

_, devcontainerScripts := agentcontainers.ExtractDevcontainerScripts(manifest.Devcontainers, manifest.Scripts)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason to call this function twice?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mainly I wanted to reduce variable scope to avoid similar issues as introduced in the previous PR. And make it clear that scripts from earlier shouldn't be used here. It's a lightweight call but I can revert it if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no issue with the duplication just wanted to ensure I knew the reason why, all good!

@mafredri mafredri merged commit 8ee2668 into main Jun 27, 2025
36 checks passed
@mafredri mafredri deleted the mafredri/fix-agent-fix-devcontainer-script-filtering branch June 27, 2025 13:59
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0