Skip to content

feat(sandbox): inherit account credentials#24

Merged
miclle merged 9 commits into
qiniu:mainfrom
miclle:feature/sandbox-credential-inheritance
Jul 10, 2026
Merged

feat(sandbox): inherit account credentials#24
miclle merged 9 commits into
qiniu:mainfrom
miclle:feature/sandbox-credential-inheritance

Conversation

@miclle

@miclle miclle commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add lightweight inherit/custom modes for Sandbox service preferences
  • allow GitHub installation preferences to inherit the signed-in account default Sandbox credentials
  • clear stale installation-scoped Sandbox API keys when switching to inherited credentials
  • update the account preferences UI with region selection, confirmation before key removal, and a direct inherit switch for organization settings

Validation

  • go test -tags development ./internal/server -count=1
  • go test ./internal/state -count=1
  • task ui-lint
  • task test

Allow GitHub installation sandbox preferences to inherit the signed-in account's default Sandbox service credentials while preserving custom credentials as an override.

Add atomic preference updates that clear stale scoped secrets when switching to inherited credentials, and update the user preferences UI to expose the lightweight inherit/custom flow.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces support for inheriting sandbox service preferences (e.g., from a parent account to a GitHub installation), updating the backend handlers, database store, and frontend UI to support an 'inherit' mode alongside the existing 'custom' mode. The code review feedback suggests removing an unused accountID parameter from the accountPreferencesResponse function signature and its call sites, as well as recording the SourceAccountID in the audit log when configuring the sandbox in inherit mode for better security monitoring.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread internal/server/server_user_handlers.go
Comment thread internal/server/server_user_handlers.go Outdated
Comment thread internal/server/server_user_handlers.go
Comment thread internal/server/server_user_handlers.go
Comment thread internal/server/server_user_handlers.go Outdated
@miclle miclle marked this pull request as ready for review July 9, 2026 11:53

@fennoai fennoai 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.

Review found one authorization issue in the inherited sandbox credential path.

Comment thread internal/server/server_sandbox_service.go
@miclle

This comment has been minimized.

@gemini-code-assist

Copy link
Copy Markdown

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@miclle

This comment has been minimized.

@miclle

This comment has been minimized.

@fennoai

fennoai Bot commented Jul 9, 2026

Copy link
Copy Markdown

An internal error occurred. Please try again later.

View job run

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces support for inheriting sandbox service configurations from a parent account for GitHub installations. It updates the backend API handlers, database store, and tests to support "inherit" and "custom" modes, allowing installations to either use their own sandbox credentials or inherit them from the parent account. On the frontend, the UI is updated to allow users to toggle inheritance, select a sandbox region from a predefined list, and confirm API key removal via a dialog. A review comment identifies an issue in the frontend where custom API URLs not matching the predefined regions are cleared on load, and suggests falling back to the original value to prevent validation failures.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ui/src/components/user-dashboard.tsx Outdated

@fennoai fennoai 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.

I found one regression in the updated Sandbox preferences UI.

Comment thread ui/src/components/user-dashboard.tsx Outdated
@miclle

This comment has been minimized.

@miclle

This comment has been minimized.

@fennoai

fennoai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Complete

Submitted a non-blocking PR review with 1 inline finding.

Verification

  • go test -tags development ./internal/server -count=1 passed
  • go test ./internal/state -count=1 passed
  • task ui-lint could not run because task is not installed in this environment

View job run

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a sandbox preference inheritance feature, allowing GitHub installation scopes to inherit sandbox service settings (API URL and API Key) from their parent accounts. It updates the backend handlers, database store, and frontend UI to support this new "inherit" mode, which includes a region selection dropdown and a toggle for using account default credentials. The reviewer identified a critical usability issue in the frontend where replacing the custom API URL text input with a region dropdown prevents users from entering or switching back to custom endpoints. They suggested always rendering the "Custom endpoint" option and conditionally displaying a text input field when it is selected.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ui/src/components/user-dashboard.tsx

@fennoai fennoai 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.

Review found one functional issue in the account preferences UI.

Verification run:

  • go test -tags development ./internal/server -count=1 passed
  • go test ./internal/state -count=1 passed
  • task ui-lint could not run because task is not installed in this environment

Comment thread ui/src/components/user-dashboard.tsx
@miclle

This comment has been minimized.

@miclle

This comment has been minimized.

@fennoai

fennoai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Complete

Submitted a non-blocking PR review with 1 inline finding.

Verification

  • go test -tags development ./internal/server -count=1 passed
  • go test ./internal/state -count=1 passed
  • task ui-lint was not run because task is not installed in this environment

View job run

@miclle

This comment has been minimized.

@miclle

This comment has been minimized.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the ability for GitHub installations to inherit sandbox service preferences and credentials from their parent account. It updates the backend database store, API handlers, and tests to support this 'inherit' mode (including deleting custom secrets when switching to inherit mode). Additionally, the frontend UI is updated to allow users to toggle this inheritance, select predefined sandbox regions, and confirm API key removal via a dialog. There are no review comments, so no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@fennoai fennoai 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.

Review found one remaining functional issue in the Sandbox preferences UI.

Verification run:

  • go test -tags development ./internal/server -count=1 passed
  • go test ./internal/state -count=1 passed
  • task ui-lint was not run because task is not installed in this environment

Comment thread ui/src/components/user-dashboard.tsx
@fennoai

fennoai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Complete

No issues found in this review.

Verification

  • go test ./internal/state -count=1
  • go test -tags development ./internal/server -count=1

Notes

  • task ui-lint could not be run because task is not installed in this environment.
  • Direct bun run lint could not be run because bun is not installed in this environment.

Submitted PR review: #24 (review)

View job run

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces support for inheriting sandbox service preferences (such as API URL and API Key) from a parent account for GitHub installations. It updates the backend storage, handlers, and tests to support this inheritance mode (inherit vs custom), and updates the frontend UI to allow users to toggle inheritance, select pre-defined sandbox regions (or custom endpoints), and confirm API key removal. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@fennoai fennoai 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.

No issues found in this review.

Verification run:

  • go test ./internal/state -count=1
  • go test -tags development ./internal/server -count=1

Not run: task ui-lint because task is not installed in this environment; direct bun run lint was also unavailable because bun is not installed.

Preserve an organization's inherited credential owner unless another connected owner explicitly replaces it. Show the source in Preferences and reject inheritance from incomplete account defaults.
@miclle

This comment has been minimized.

@miclle

This comment has been minimized.

@fennoai

fennoai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Complete

Published one non-blocking PR review with 1 inline finding.

Verification run:

  • go test -tags development ./internal/server -count=1
  • go test ./internal/state -count=1
  • git diff --check origin/main...HEAD

Not completed locally:

  • UI lint/build: bun is not installed, and npm --prefix ui run lint failed because the local ESLint shim is unavailable/permissioned incorrectly (eslint: Permission denied).

View job run

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces sandbox credential inheritance for GitHub organization installations, allowing them to inherit sandbox preferences and API keys from their connected personal accounts. The backend has been updated with new database store methods, API handlers, and comprehensive tests to support transactional preference updates and secret deletion. On the frontend, the UI now supports toggling between custom and inherited credentials, selecting predefined sandbox regions, and managing confirmation dialogs for key removal or credential replacement. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@fennoai fennoai 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.

Review found one correctness issue in the inherited Sandbox preferences response.

Verification run:

  • go test -tags development ./internal/server -count=1
  • go test ./internal/state -count=1

UI lint/build was not runnable in this environment: bun is not installed, and the local npm path had no ui/node_modules/.bin/eslint shim (npm --prefix ui run lint failed with eslint: Permission denied).

Comment thread internal/server/server_user_handlers.go
Align the Preferences response with runtime installation-link validation. Mark disconnected credential sources unavailable while keeping the replacement action visible to other owners.
@miclle

This comment has been minimized.

@miclle

This comment has been minimized.

@fennoai

fennoai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Complete

No issues found in this review.

Verification

  • go test -tags development ./internal/server -count=1
  • go test ./internal/state -count=1
  • git diff --check origin/main...HEAD

Notes

View job run

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces support for inheriting sandbox service preferences from a personal account to a GitHub organization installation. It updates the backend to resolve inherited preferences, adds database methods to manage preferences and delete secrets upon inheritance, and updates the frontend UI to allow toggling inheritance and selecting pre-configured sandbox regions. The review feedback suggests returning early in accountPreferencesResponse when preferences are not found to avoid a redundant database query.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread internal/server/server_user_handlers.go

@fennoai fennoai 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.

No issues found in this review.

Verification run:

  • go test -tags development ./internal/server -count=1
  • go test ./internal/state -count=1
  • git diff --check origin/main...HEAD

Not run locally: UI lint/build, because this workspace does not have bun, task, or ui/node_modules installed.

Return the unconfigured Sandbox response immediately when no preference exists, avoiding a second query for the same missing record.
@miclle

This comment has been minimized.

@miclle

This comment has been minimized.

@fennoai

fennoai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Complete

No issues found in this review.

Verification

  • go test -tags development ./internal/server -count=1
  • go test ./internal/state -count=1
  • git diff --check origin/main...HEAD

Notes

View job run

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces sandbox preference inheritance, allowing GitHub organization installations to inherit sandbox credentials from their connected personal accounts. It updates the backend server and database store to support an 'inherit' mode, validate source account configurations, and atomically clean up custom secrets when inheritance is enabled. The UI is also updated with a new Region selector (supporting predefined regions and custom endpoints), a toggle to enable credential inheritance, and confirmation dialogs for key removal and credential replacement. No review comments were provided, so there is no additional feedback to address.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@fennoai fennoai 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.

No issues found in this review.

Verification run:

  • go test -tags development ./internal/server -count=1
  • go test ./internal/state -count=1
  • git diff --check origin/main...HEAD

Not run locally:

  • UI lint/build: npm --prefix ui run lint failed with eslint: Permission denied, and npm --prefix ui run build failed with tsc: Permission denied in this workspace.

@miclle miclle merged commit f308d85 into qiniu:main Jul 10, 2026
10 checks passed
@miclle miclle deleted the feature/sandbox-credential-inheritance branch July 10, 2026 07:09
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.

1 participant