Skip to content

Conversation

@unlimitechcloud
Copy link
Owner

Summary

  • add runtime-managed client/project/team hierarchy stored in site configs
  • expose REST handlers for managing clients, projects, teams, and workspace team bindings
  • add codersdk helpers to call the new client access endpoints

Testing

  • go test ./codersdk

https://chatgpt.com/codex/tasks/task_e_68f8f76bd4888327bf6acf6f4cca1aa9

Copilot AI review requested due to automatic review settings October 23, 2025 03:58
Copy link

Copilot AI 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 introduces a client access hierarchy management system that enables runtime-managed organization of clients, projects, and teams. The implementation stores this hierarchy in site configurations and provides REST API endpoints for managing these entities along with their relationships to workspaces.

Key changes:

  • Added data structures and SDK methods for client accounts, projects, and project teams
  • Implemented REST API handlers for CRUD operations on the client access hierarchy
  • Added workspace team assignment functionality to bind workspaces to teams with automatic ACL management

Reviewed Changes

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

File Description
codersdk/clientaccess.go Client SDK methods for interacting with the new client access API endpoints
coderd/coderd.go REST route definitions for clients, projects, teams, and workspace team bindings
coderd/clientaccess_state.go State management logic for persisting and retrieving the client access hierarchy from runtime config
coderd/clientaccess_handlers.go HTTP handlers implementing CRUD operations and workspace team assignment with ACL management
Comments suppressed due to low confidence (1)

coderd/clientaccess_handlers.go:1

  • Lines 246-248 check for 404 separately before checking for non-200 status codes on line 249. Since both conditions return the same error via ReadBodyAsError, the explicit 404 check is redundant. The 404 check can be removed and line 249 will handle all non-200 status codes uniformly.
package coderd

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

project.LeaderID = *req.LeaderID
}
if req.Name != nil {
for idx, existing := range client.Projects {
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

Undefined variable client. The variable returned from findProject is stored in an unused parameter position. You need to access it through the state: for idx, existing := range state.Clients[cIdx].Projects {

Suggested change
for idx, existing := range client.Projects {
for idx, existing := range state.Clients[cIdx].Projects {

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants