-
Notifications
You must be signed in to change notification settings - Fork 619
[Dashboard] Add error handling and refactor vault account rotation #7592
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
[Dashboard] Add error handling and refactor vault account rotation #7592
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
WalkthroughThe changes refactor and clarify the logic for creating and rotating vault service accounts and their access tokens. A new dedicated function for rotating vault accounts is introduced, and error handling is improved throughout. Imports and usages are updated to use the new rotation function where appropriate, and the account creation function is simplified to always create new accounts. Additional UI components related to vault account creation and transaction testing are refactored or removed, and minor UI adjustments are made in related components. Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant Hooks
participant VaultClient
UI->>Hooks: rotateSecretKeyClient()
Hooks->>VaultClient: rotateVaultAccountAndAccessToken({project, secretKey, secretHash})
VaultClient->>VaultClient: Check for engineCloud service with encryptedAdminKey
alt If found
VaultClient->>VaultClient: rotateServiceAccount(rotationCode)
VaultClient->>VaultClient: createAndEncryptVaultAccessTokens(newAdminKey, newRotationCode)
VaultClient-->>Hooks: {adminKey, managementToken, walletToken}
else No engineCloud/encryptedAdminKey
VaultClient-->>Hooks: Error
end
Hooks-->>UI: Result or Error
sequenceDiagram
participant UI
participant VaultClient
UI->>VaultClient: createVaultAccountAndAccessToken({project, secretKey, secretHash})
VaultClient->>VaultClient: createServiceAccount()
VaultClient->>VaultClient: createAndEncryptVaultAccessTokens(adminKey, rotationCode)
VaultClient-->>UI: {adminKey, managementToken, walletToken}
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (8)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used📓 Path-based instructions (2)`**/*.{ts,tsx}`: Write idiomatic TypeScript with explicit function declarations ...
📄 Source: CodeRabbit Inference Engine (CLAUDE.md) List of files the instruction was applied to:
`apps/{dashboard,playground-web}/**/*.{tsx,ts}`: Import UI primitives from `@/co...
📄 Source: CodeRabbit Inference Engine (CLAUDE.md) List of files the instruction was applied to:
🧠 Learnings (5)📓 Common learningsapps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/vault/components/create-vault-account.client.tsx (11)apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/try-it-out.tsx (19)apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/analytics/send-test-tx.client.tsx (21)apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (9)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
🔇 Additional comments (9)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7592 +/- ##
=======================================
Coverage 56.46% 56.46%
=======================================
Files 906 906
Lines 58072 58072
Branches 4222 4222
=======================================
Hits 32790 32790
Misses 25174 25174
Partials 108 108
🚀 New features to boost your workflow:
|
size-limit report 📦
|
b22381e to
f77e0c9
Compare

PR-Codex overview
This PR focuses on refactoring the vault account management functionality, including error handling improvements and the addition of a modal for sending test transactions. It also replaces the creation function for vault accounts with a rotation function.
Detailed summary
create-vault-account.client.tsx.create-project-modal/index.tsx.createVaultAccountAndAccessTokenwithrotateVaultAccountAndAccessTokeninrotate-admin-key.client.tsx.CreateVaultAccountStepcomponent and its usage inftux.client.tsx.vault.client.ts.rotateVaultAccountAndAccessTokenfunction invault.client.ts.SendTestTransactionto use a modal for sending test transactions.SendTestTransactionModalcomponent for better user interaction.try-it-out.tsx.Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Removed