feat(projects): add Clone Project feature in General settings - #8
Open
suda wants to merge 2 commits into
Open
Conversation
- Rebase onto fix/dark-mode-css-theme-inline - Add cascade projects clone CLI command - Catch PostgreSQL 23505 unique constraint violation in clone mutation and surface as BAD_REQUEST with an actionable message instead of INTERNAL_SERVER_ERROR - Add test coverage for the duplicate ID error path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
cloneProjectrepository function that copies project settings, integrations, credentials (re-encrypted with new project ID as AAD), agent configs, and trigger configs in one DB transactionprojects.clonetRPC mutation with ownership verification and slug validationCloneProjectDialogcomponent following the same pattern asproject-form-dialog.tsxKey design decisions:
repofield is intentionally NOT copied due to the unique DB constraint — UI copy clarifies the user must configure it post-clonereEncryptCredential(value, sourceId, newId)— handles both plaintext and encrypted values with no special casingnewId) surfaces naturally via the DB unique constraint error shown in the dialogTest plan
cloneProjectrepository function — verifies all 5 record groups (project, integrations, credentials, agentConfigs, triggerConfigs), throws on missing source, skips inserts for empty related tablesprojects.clonetRPC mutation — verifies ownership check, correct args passed, slug validation, unauthenticated rejectionwebhooks.test.ts(6 tests neededgitlabOnly: false) andcredential-scoping.test.ts(2 tests neededGITHUB_TOKEN_IMPLEMENTERandGITLAB_TOKEN_IMPLEMENTERenv var clearing)Card: https://trello.com/c/TC7BZD6a/15-many-projects-might-use-almost-exactly-the-same-configuration-of-scm-pm-integrations-engine-or-agents-please-add-an-option-in-pr
🤖 Generated with Claude Code