Skip to content

feat(projects): duplicate projects with source access checks and stable ordering - #561

Merged
imshashank merged 9 commits into
mainfrom
codex/fix-project-duplication
Nov 16, 2026
Merged

imshashank merged 9 commits into
mainfrom
codex/fix-project-duplication

Conversation

@imshashank

@imshashank imshashank commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Continues #528 and preserves its original contribution commits. Adds project duplication with optional issues, milestone and parent remapping, shifted dates, an API endpoint, and project settings/header dialogs.

The copy checks source-team access and rolls back the whole transaction when an issue is unreadable. It preserves manual issue order with fresh destination ranks, canonical Human and Agent assignees, and excludes team-scoped labels and reviewers when moving to another team. Issue creation uses the supplied transaction without confusing it with Agent authorization context; nested Agent writes retain attribution and rollback guarantees.

Current head: 5825fdf. Integrated actual main c71be0b. No schema or migration changes.

Validation:

  • Full local verification of the project-copy source candidate aa73408: 7,094 passed, 0 failed, 0 skipped; frozen source unchanged. Actual Bun and Node24.22.3 probes confirmed isolated loopback databases and app environment.
  • The subsequent current-main merge changes exactly the two notification query/test files from independently verified fix(notifications): avoid quadratic provider candidate scans #588. Both file blobs match actual main exactly; project-copy source/tests and lockfile remain unchanged.
  • Focused core project and Agent write suites: 102 passed. Frontend, API and shared suites: 92 passed.
  • Regressions demonstrated caller-transaction rollback, canonical assignment, source visibility, ordering and cross-team field filtering failures before their fixes.
  • Frozen install, all static checks, workspace types and normal commit/push hooks passed.
  • All six exact current-head CI jobs, CodeQL, links and helper workflows passed. No open inline review threads. Final preview/current-main guards and independent release review remain required.

Closes #207

@imshashank
imshashank requested a review from pulkitxm as a code owner November 4, 2026 06:41
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Noveum/orbit
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: c71be0b
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8d35eb5e-7640-46fd-a129-56f55cb1dc2c
Commits

Reviewing files that changed from the base of the PR and between c71be0b and 5825fdf.

Files selected for processing: 17

  • apps/web/src/app/(app)/projects/[slug]/layout.tsx
  • apps/web/src/app/api/projects/[id]/duplicate/route.ts
  • apps/web/src/features/projects/duplicate-project-dialog.tsx
  • apps/web/src/features/projects/project-settings-form.tsx
  • apps/web/tests/app/api/projects/duplicate.test.ts
  • apps/web/tests/features/projects/duplicate-project-dialog.test.tsx
  • apps/web/tests/features/projects/project-settings-form.test.tsx
  • packages/core/src/work/agent-issue-context.ts
  • packages/core/src/work/issue-service.ts
  • packages/core/src/work/milestone-service.ts
  • packages/core/src/work/project-service.ts
  • packages/core/tests/work/agent-issue-writes.test.ts
  • packages/core/tests/work/project-service.test.ts
  • packages/shared/src/utils/index.ts
  • packages/shared/src/validators/project.ts
  • packages/shared/tests/utils/utils.test.ts
  • packages/shared/tests/validators/validators.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copy link
Copy Markdown
Contributor Author

Integration review of 11455ef against current main 95430fb: the source access checks, transactional rollback and final-rank remapping are present. Two current-main adaptations are needed before this is ready.

  1. createIssue's third parameter on main is AgentIssueWriteContext, while duplicateProjectIssues currently passes its transaction as the third argument at project-service.ts:963. Resolve the issue-service conflict with explicit transaction support while retaining the current Actor authorization and assignment logic.
  2. duplicateIssueValues at project-service.ts:901 copies only legacy assigneeId. An Agent-assigned source Issue has assigneeAgentId set and legacy assigneeId null; this copy input loses that assignment. Preserve the canonical assignment through the shared policy, including target-team access checks, and add Human/Agent assignment regressions after integration.

If the layered-instructions schema lands first, include the previously prepared project guidance-copy repair as well. Fresh tests must cover the final integrated code, not just this branch's older issue writer.

@github-actions github-actions Bot added tests Test coverage and test infrastructure area: web The Next.js app and its UI labels Nov 16, 2026
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
orbit Ready Ready Preview Nov 16, 2026 6:59pm UTC

Request Review

@imshashank
imshashank merged commit 5a0d42e into main Nov 16, 2026
15 checks passed
@imshashank
imshashank deleted the codex/fix-project-duplication branch November 16, 2026 19:04

This branch was successfully deployed

1 active deployment
Preview — 5825fdf4 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: web The Next.js app and its UI tests Test coverage and test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate a project with optional issues and shifted dates

2 participants