You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create a new graph when duplicating instead of renaming the original - #343
Duplicating a graph renamed the original instead of creating a copy. Graphs are content-addressed with one alias per definition, and Duplicate went through the Edit save path with force_rename=true, so saving an unchanged duplicate moved the original's name to <name>_copy.
NewGraph now sends only the Edit flow through validateAndEditGraph (force_rename=true); Duplicate and other flows use the create path (force_rename=false).
An unchanged duplicate now shows the backend's existing "definition already exists with name …" error and the original is untouched; a modified duplicate creates a new graph. Edit is unchanged.
This also stops Duplicate from force-renaming the original onto an existing <name>_copy.
DuplicateGraph.test.tsx: Duplicate posts force_rename: false; an unchanged duplicate stays on the page when creation fails; sequential steps run on a cleared request history. The test's previously ignored validateWithInvalidSuccess option is now forwarded, so that step asserts the validation alert instead of silently running the success path.
Existing EditGraph tests still assert force_rename: true.
Deployment on 3.0.8
These three PRs are intended to ship together on the 3.0.8 images (kumo-ui, kumo-backend-cpu, kumo-backend-gpu tag 3.0.8, built from 46c9c4e3):
Each PR's commits cherry-pick cleanly onto 46c9c4e3. When building the 3.0.8 images, regenerate ui/src/gen against the 3.0.8 backend rather than taking the copy PR's generated files; the 3.0.8 client then differs from its committed spec only by the copy endpoint additions. Only the copy PR changes the backend image.
Validated together on the 3.0.8 images with all three PRs applied (CPU single-host compose stack):
UI unit tests 1,239/1,239, type-check, lint (0 errors) and production build; backend copy tests 20/20.
Existing Playwright suite 21/21 on Chromium, Firefox and WebKit, plus jobs-list-controls (mutating).
Click-through Playwright checks of all three changes against S3-compatible and ADLS Gen2 connectors.
End-to-end on a copied ADLS connector: tables → graph → snapshot → train table → training → prediction table → batch prediction.
Hotfix Context
Not a P0 fix. See Deployment on 3.0.8 above.
Checklist
I listed all the breaking changes introduced by the PR (none)
I made sure to update examples and documentation with my changes (if necessary)
I have added and modified unit tests required to cover changes made by this PR.
Duplicate now uses the create path (force_rename=false), so saving an
unchanged definition returns the backend's already-exists error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewing files that changed from the base of the PR and between 5ccc5cf and c713251.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The graph save callback now uses validateAndEditGraph only for EDIT flows and routes other flow types to onCreateGraph. Duplicate graph creation passes graphFlowInfo directly to createGraph and uses its name for navigation. Tests cover unchanged duplicate submissions, invalid create responses, and create failures.
Merge Risk: Minimal · previous review 5ccc5
Duplicating a graph now uses the create path, so an unchanged duplicate shows the backend's name-conflict error instead of renaming the original. Edit behavior is unchanged. No actionable merge-blocking risk was identified in the UI change.
Security architecture risk: Minimal · up to 5ccc5
The change stops Duplicate from automatically renaming an existing graph. It reuses the existing creation endpoint and validation controls, and no introduced or worsened security, ownership, or failure-containment risk was established.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The changed operation remains scoped to graph definitions and aliases in the selected project. Both save paths reach the same server-side creation operation, and graph persistence continues to require that referenced tables belong to the graph's active project.
Security Findings and Attack Paths
observed — The change removes automatic forced rename from Duplicate but does not remove the server's existing force-rename capability. EDIT still requests that capability; it is not a newly granted privilege.
Trust Boundaries and Controls
observed — Browser-provided graph data still passes through the shared backend project-validation call, Custom SQL canonicalization, connector execution-authorization calls, and authenticated-principal requirement before graph persistence. Changing the UI flow does not select a different server control path.
Resilience and Maintainability Implications
observed — Graph and dependent-table writes occur within the existing write transaction, with exception cleanup handled by the database runtime. The UI guard prevents overlapping submissions only within one mounted component. Repeating an accepted same-fingerprint, same-alias request can still increment ref_count under pre-existing backend semantics; this PR does not introduce stronger idempotency.
Pre-merge checks: 3
Check name
Status
Explanation
Change Map Design Review
The change map comment (#343 (comment)) matches the code. I checked each claim against the repository. Necessity (confirmed). Before this PR…
Pr Size
The PR size check counts changed files and fails only above 40. The reviewed range (refs/coderabbit/pre-merge-check/base to head) contains 2 changed files, both modified (M): ui/src/pages/Graphs/NewGr…
Public Resource Access
The check applies only to external resource references (URLs, repository locations, package source locations) that this PR adds or modifies. The changed-file inventory shows two modified files: `ui/sr…
Full details: Change Map Design Review
Explanation
The change map comment (#343 (comment)) matches the code. I checked each claim against the repository. Necessity (confirmed). Before this PR, onFinishClick sent every non-CREATE flow to validateAndEditGraph. That path calls useCreateGraph with isEdit=true, and the hook sends force_rename: isEdit (ui/src/hooks/graph/newGraph.ts:100). Duplicate therefore sent force_rename=true. The backend then moved the alias of the existing definition, which is the rename the map describes. The fix is needed. Design (sound). In NewGraph.tsx, only FlowType.EDIT now calls validateAndEditGraph. Other flows call onCreateGraph, which sends force_rename=false. Edit keeps force_rename=true. editGraph drops the Duplicate name sync and the copied object. Each change is a routing or cleanup change in one file. The change belongs in the UI layer, because the backend already protects the existing behavior. Existing behavior kept (confirmed).statedb/db/services.pysave_graph_definition (lines 670–676) raises GraphDefinitionAlreadyExists(GRAPH_RENAME_MESSAGE) when the same fingerprint already has a different alias and force_rename is false. It raises before any upsert, so the original stays unchanged. create_full_graph_v2 (lines 377–388) also rejects an alias that another graph already uses. The map's "create still rejects duplicate definitions and names" is accurate. Stopping condition (matches code). An unchanged duplicate reaches the backend guard and returns the error. A changed duplicate has a new fingerprint and creates a new graph. Uncertain design questions (not proven defects): 1. The observed failure says Duplicate should create a copy. After this change, an unchanged Duplicate creates no copy and shows an error. The map states this as the stopping condition, but its "Why" column does not explain the trade-off. The backend rule (one alias per definition) causes it. The map should say that unchanged duplicates are rejected by design, not fixed. Whether product wants a different outcome cannot be decided from the code. 2. The routing change also moves FlowType.AS_TEMPLATE from the Edit path to the create path. The table says only "other flows". I found no graph UI code that sets AS_TEMPLATE; its only use is in ui/src/utils/tables.ts. The map should state this. 3. The "click-through checks" in Verification come from the PR author and are not in the repository. They cannot be checked here. Suggested correction (refinement, not a blocker): Add one sentence to the map. Say that an unchanged Duplicate now fails with the backend GRAPH_RENAME_MESSAGE by design. Say that AS_TEMPLATE shares the create path and has no graph caller.
Full details: Pr Size
Explanation
The PR size check counts changed files and fails only above 40. The reviewed range (refs/coderabbit/pre-merge-check/base to head) contains 2 changed files, both modified (M): ui/src/pages/Graphs/NewGraph/NewGraph.tsx and ui/src/pages/Graphs/tests/DuplicateGraph.test.tsx. This is well under the threshold of 40, so the check passes. Line counts were ignored as instructed.
Full details: Public Resource Access
Explanation
The check applies only to external resource references (URLs, repository locations, package source locations) that this PR adds or modifies. The changed-file inventory shows two modified files: ui/src/pages/Graphs/NewGraph/NewGraph.tsx and ui/src/pages/Graphs/__tests__/DuplicateGraph.test.tsx. I searched every added line of the patch for http(s)://, git@, ssh://, github.com, GitLab/Bitbucket hosts, npm/PyPI/registry references, object-store URIs, and archive file extensions. No matches were found. The added lines contain only TypeScript logic and test code: graphFlowInfo passed to createGraph, the FlowType.EDIT branch, force_rename: false, and new test cases. The PR description contains URLs, including a change-map comment link and PR references, but the description is not changed code, and the check does not cover it. No external resource reference is added or modified, so there is nothing to verify and no inaccessible reference to report.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
I approve this PR. Duplicate now uses the create path with force_rename=false, and Edit keeps force_rename=true. I traced the backend. For an unchanged copy, save_graph_definition raises "This graph definition already exists with name ...", so the original keeps its name. A changed copy creates a new graph. CI passes.
Note for the Santander reply: an unchanged duplicate shows this error and does not create a second graph. The backend identifies a graph by its definition, so the customer must change the copy before they save it.
Release note: see my comment on #342 about the image tag.
No linked issue.
## Summary
Adds project archiving to the UI using the existing `POST
/v0/projects/{project_id}/archive` endpoint.
- **Project Settings:** an "Archive project" section with a confirmation
dialog, shown only to the project owner or an administrator (matching
the backend's owner-or-admin rule) and never for the Default project or
an already archived project. Confirmation is guarded against double
submits.
- **After archiving:** selects the Default project and Default group and
opens its models page, through a shared `openProject` helper that the
project picker now also uses.
- **Project picker:** hides archived projects, since list endpoints
still return them.
- `DEFAULT_PROJECT_ID` and `DEFAULT_GROUP_ID` are added to
`utils/Constants`, mirroring `kumoapi`.
Change map: [change map
comment](#344 (comment))
## Testing Done
- `ProjectSettings.test.tsx`: archive and return to Default
project/group; cancel; failure; owner, admin, and non-owner visibility;
no action for Default or archived projects; project list cache refresh;
double confirmation sends one request (fails without the guard).
- `ProjectList.test.tsx`: archived projects hidden, including when
stored as the selected project.
## Deployment on 3.0.8
These three PRs are intended to ship together on the **3.0.8 images**
(`kumo-ui`, `kumo-backend-cpu`, `kumo-backend-gpu` tag `3.0.8`, built
from `46c9c4e3`):
- #342 — copy a connector into another project (backend + UI)
- #343 — graph Duplicate no longer renames the original (UI only)
- #344 — archive projects from Project Settings (UI only)
Each PR's commits cherry-pick cleanly onto `46c9c4e3`. When building the
3.0.8 images, regenerate `ui/src/gen` against the 3.0.8 backend rather
than taking the copy PR's generated files; the 3.0.8 client then differs
from its committed spec only by the copy endpoint additions. Only the
copy PR changes the backend image.
Validated together on the 3.0.8 images with all three PRs applied (CPU
single-host compose stack):
- UI unit tests 1,239/1,239, type-check, lint (0 errors) and production
build; backend copy tests 20/20.
- Existing Playwright suite 21/21 on Chromium, Firefox and WebKit, plus
`jobs-list-controls` (mutating).
- Click-through Playwright checks of all three changes against
S3-compatible and ADLS Gen2 connectors.
- End-to-end on a copied ADLS connector: tables → graph → snapshot →
train table → training → prediction table → batch prediction.
## Hotfix Context
Not a P0 fix. See *Deployment on 3.0.8* above.
## Checklist
- [x] I listed all the **breaking changes** introduced by the PR (none)
- [x] I made sure to **update examples and documentation** with my
changes (if necessary)
- [x] I have added and modified unit tests required to cover changes
made by this PR.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
No linked issue.
## Summary
Adds a way to copy a project connector into another project.
- **API:** `POST
/v0/projects/{project_id}/connectors/{connector_id}/copy` with
`CopyConnectorArgs {target_project_id, name?, description?}`. The driver
reads the source with `get_for_project`, then recreates its config and
identity reference through the existing `create_project_connector` path,
so target visibility, active project/group, identity-to-group binding,
and provider validation are unchanged.
- **Errors:** same project → 400; missing/upload source, archived or
invisible target → 404; identity not bound to the target group → 403; a
connector with the same name already in the target → 409 "already
exists"; failed target validation → 422. Copying from an archived source
project is allowed.
- **UI:** "Copy to project" in the connector overview menu opens a
dialog (target picker of other active projects, editable name). Errors
show inline; success links to the target project. Submit is guarded
against double activation.
- **Generated client:** regenerated with `make generate-ui-client-code`,
keeping only the copy endpoint additions. Unrelated drift that
regeneration also picks up from `main`
(`GraphSnapshotResponse.timestamp_precision` and a
`TrainingTableGenerationPlan` description) is left out of this PR.
Change map: [change map
comment](#342 (comment))
## Testing Done
- `test/rest/routers/test_connector_copy.py`: driver and route tests,
including error mapping and same-project/name-conflict rejection.
- `test/statedb/db/test_identity_services.py`: copy tests against the
real `ConnectorService` (identity not bound to target group,
archived/invisible target, upload connector, archived source, repeated
copy, differently configured name clash).
- UI: dialog, hook, and connector list tests; the double-submit test
fails without the guard.
## Deployment on 3.0.8
These three PRs are intended to ship together on the **3.0.8 images**
(`kumo-ui`, `kumo-backend-cpu`, `kumo-backend-gpu` tag `3.0.8`, built
from `46c9c4e3`):
- #342 — copy a connector into another project (backend + UI)
- #343 — graph Duplicate no longer renames the original (UI only)
- #344 — archive projects from Project Settings (UI only)
Each PR's commits cherry-pick cleanly onto `46c9c4e3`. When building the
3.0.8 images, regenerate `ui/src/gen` against the 3.0.8 backend rather
than taking the copy PR's generated files; the 3.0.8 client then differs
from its committed spec only by the copy endpoint additions. Only the
copy PR changes the backend image.
Validated together on the 3.0.8 images with all three PRs applied (CPU
single-host compose stack):
- UI unit tests 1,239/1,239, type-check, lint (0 errors) and production
build; backend copy tests 20/20.
- Existing Playwright suite 21/21 on Chromium, Firefox and WebKit, plus
`jobs-list-controls` (mutating).
- Click-through Playwright checks of all three changes against
S3-compatible and ADLS Gen2 connectors.
- End-to-end on a copied ADLS connector: tables → graph → snapshot →
train table → training → prediction table → batch prediction.
## Hotfix Context
Not a P0 fix. See *Deployment on 3.0.8* above.
## Checklist
- [x] I listed all the **breaking changes** introduced by the PR (none;
new endpoint and schema are additive)
- [x] I made sure to **update examples and documentation** with my
changes (if necessary)
- [x] I have added and modified unit tests required to cover changes
made by this PR.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <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
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.
No linked issue.
Summary
Duplicating a graph renamed the original instead of creating a copy. Graphs are content-addressed with one alias per definition, and Duplicate went through the Edit save path with
force_rename=true, so saving an unchanged duplicate moved the original's name to<name>_copy.NewGraphnow sends only the Edit flow throughvalidateAndEditGraph(force_rename=true); Duplicate and other flows use the create path (force_rename=false).<name>_copy.Change map: change map comment
Testing Done
DuplicateGraph.test.tsx: Duplicate postsforce_rename: false; an unchanged duplicate stays on the page when creation fails; sequential steps run on a cleared request history. The test's previously ignoredvalidateWithInvalidSuccessoption is now forwarded, so that step asserts the validation alert instead of silently running the success path.EditGraphtests still assertforce_rename: true.Deployment on 3.0.8
These three PRs are intended to ship together on the 3.0.8 images (
kumo-ui,kumo-backend-cpu,kumo-backend-gputag3.0.8, built from46c9c4e3):Each PR's commits cherry-pick cleanly onto
46c9c4e3. When building the 3.0.8 images, regenerateui/src/genagainst the 3.0.8 backend rather than taking the copy PR's generated files; the 3.0.8 client then differs from its committed spec only by the copy endpoint additions. Only the copy PR changes the backend image.Validated together on the 3.0.8 images with all three PRs applied (CPU single-host compose stack):
jobs-list-controls(mutating).Hotfix Context
Not a P0 fix. See Deployment on 3.0.8 above.
Checklist
🤖 Generated with Claude Code