Repository navigation
test(coderd): pin member counts and user details in chat and project ACL reads - #31014
Open
ibetitsmike wants to merge 1 commit into
Open
ibetitsmike wants to merge 1 commit into
ibetitsmike wants to merge 1 commit into
Conversation
…ACL reads The chat project ACL read path counts group members with one query per group, and no test checked the counts or the hydrated user fields. Pin both, and the chat ACL username, before these reads move onto the shared organization ACL resolvers.
ibetitsmike
added this pull request to stack #31017
October 19, 2026 13:53
This was referenced Oct 19, 2026
Collaborator
Author
|
@codex review
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
ibetitsmike
marked this pull request as ready for review
October 19, 2026 22:48
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds five assertions to
TestChatProjectSharingandTestChatACLSharingLifecycle. It is the test-first layer for the refactor above it, so it adds 8 test lines and removes none.Why it is needed: the next layers move the chat and chat project ACL reads onto the shared resolvers in
coderd/mcp_acl.go, which also replaces the per-group member count query of the project read with one batched query. No test checked a group's member count or any user field other than the ID in those reads, so a wrong count or a dropped username would still pass.The new assertions check that:
Everyonegroup with 3 members and a custom group with 1,Proof: the tests pass on
mainand on this branch. I ran 5 mutants of themainread code withgo test -overlay: report a zero member count, count the members of the wrong group, count system users, and return only the user ID in the project read and in the chat read. Each mutant fails these tests and passes the tests onmain.Validation:
go test ./coderd -run '^(TestChatProjectSharing|TestChatACLSharingLifecycle)$' -count=1passes, and the pre-commit hook passed (make gen, formatting, golangci-lint over every package, and the slim build).Stack
This stack moves the chat, chat project, and chat model ACL handlers onto the organization ACL helpers that MCP server configs and organization skills already share, and deletes their copies. ACL responses do not change.