Skip to content

feat(web): pick reviewers when editing policies.cedar - #2165

Merged
benjamin-747 merged 3 commits into
gitmono-dev:mainfrom
benjamin-747:main
Aug 4, 2026
Merged

feat(web): pick reviewers when editing policies.cedar#2165
benjamin-747 merged 3 commits into
gitmono-dev:mainfrom
benjamin-747:main

Conversation

@benjamin-747

Copy link
Copy Markdown
Collaborator

Add a BlobEditor member multi-select that rewrites the matching path's to [...] list, mirroring MegaCedarAdminPicker without a new API.

@benjamin-747
benjamin-747 requested a review from genedna August 4, 2026 03:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cec3a906fb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +39 to +42
name === 'policies.cedar' ||
path.endsWith('/.cedar/policies.cedar') ||
path === '.cedar/policies.cedar' ||
path.endsWith('/policies.cedar')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict reviewer picker to .cedar policy files

When editing a policies.cedar that is not under a .cedar/ directory, such as project/policies.cedar, this condition still mounts the reviewer picker even though inferPathPatternFromFilePath falls back to the empty pattern and the backend only discovers .cedar/policies.cedar files. Selecting a reviewer in that case appends a global startsWith("") reviewer rule to an unrelated Cedar file, which can corrupt files the reviewer system will not read; limit the picker to .cedar/policies.cedar paths.

Useful? React with 👍 / 👎.

Add a BlobEditor member multi-select that rewrites the matching path's `to [...]` list, mirroring MegaCedarAdminPicker without a new API.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 887c492464

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

) : (
<div className='divide-y divide-gray-100'>
{members.map((member) => {
const cedarId = member.user.github_login || member.user.username

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Store reviewer policies with approvable usernames

When the selected member has a GitHub login that differs from their Campsite username, this writes the GitHub login into policies.cedar; those strings are later stored verbatim as mega_cl_reviewer.username, but the approval route calls reviewer_change_state(&link, &user.username, ...) using the Campsite username (mono/src/api/router/reviewer_router.rs:182-185). The resulting system-required reviewer can be assigned and shown in the CL, but that user cannot mark the review approved because the backend looks for a different username, so use the same API identity as the manual reviewer picker or update the approval lookup to handle GitHub logins.

Useful? React with 👍 / 👎.

@benjamin-747
benjamin-747 marked this pull request as draft August 4, 2026 03:30
@benjamin-747
benjamin-747 force-pushed the main branch 2 times, most recently from b9537d3 to c42958c Compare August 4, 2026 07:44
Replace username-keyed collaboration storage with Campsite public ids,
keep github_login for Cedar/display, and resolve CL UI members by id so
handles no longer render as opaque ids.
@benjamin-747
benjamin-747 marked this pull request as ready for review August 4, 2026 08:57
@benjamin-747
benjamin-747 added this pull request to the merge queue Aug 4, 2026
Merged via the queue into gitmono-dev:main with commit a8abbbc Aug 4, 2026
9 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fc974f241

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"reactions",
"item_assignees",
"mega_code_review_comment",
"access_token",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Populate github_login for migrated tokens

With the migration, existing access_token.username values are renamed into campsite_user_id, so legacy token rows enter this loop with campsite_user_id equal to the old handle. The earlier UPDATE access_token SET github_login ... WHERE campsite_user_id = '{id}' does not match those rows, and this generic update only changes campsite_user_id; after startup backfill they still have github_login = NULL. git_receive_pack_auth now rejects any access token whose LoginUser lacks github_login, so previously generated personal tokens stop being usable for pushes. Set github_login in the handle-matched access_token update, or do it after the id rewrite, before marking the backfill completed.

Useful? React with 👍 / 👎.

id: Set(generate_id()),
group_id: Set(group_id),
username: Set(username.clone()),
campsite_user_id: Set(username.clone()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Store group member ids from the admin picker

After this change, values passed in usernames are stored as campsite_user_id, but the admin add-members UI still passes member.user.username from moon/apps/web/components/AdminGroups/AddMembersDialog.tsx. For users whose Campsite public id differs from username, adding them through the UI writes the username into the id column; later permission lookups use collaboration_actor/find_group_ids_by_username with the real id, so the new group membership never grants access. Update the UI to send member.user.id or resolve legacy usernames here.

Useful? React with 👍 / 👎.

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