Skip to content

[WEB-10178] fix: scope intake duplicate_to to the project - #10324

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10178-intake-duplicate-scope
Nov 16, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10178-intake-duplicate-scope

Conversation

@pablohashescobar

@pablohashescobar pablohashescobar commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Description

duplicate_to on the intake serializers (web API and public API) was a plain foreign key with no scope check, and the response echoes the referenced work item's details. An intake item could be pointed at a work item in another project or workspace.

Both serializers now have a validate_duplicate_to that rejects a work item outside the intake item's own project.

The web app's duplicate picker already searches the same project only.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

  • New plane/tests/contract/app/test_intake_duplicate_to_scope_app.py and plane/tests/contract/api/test_intake_duplicate_to_scope.py: a duplicate_to from another project or another workspace returns 400 on each surface; a same-project value still works. 6 passed; the four out-of-scope cases fail without the fix.

References

  • WEB-10178

Created with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Intake issues now reject duplicate targets from a different project or workspace, with a validation error.
    • Duplicate targets within the same project continue to be accepted and saved.

Both the web and the public API intake serializers now reject a duplicate_to work item that does not belong to the intake item's project.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 23:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Both intake serializers now reject duplicate targets from a different project. Contract tests cover cross-project rejection and same-project acceptance.

Changes: Intake duplicate target scope

Layer / File(s) Summary
Project-scoped duplicate target validation
apps/api/plane/api/serializers/intake.py, apps/api/plane/app/serializers/intake.py, apps/api/plane/tests/contract/api/test_intake_duplicate_to_scope.py, apps/api/plane/tests/contract/app/test_intake_duplicate_to_scope_app.py
Both serializers reject a duplicate target from a different project. Contract tests verify that targets from another project or workspace receive HTTP 400 and are not saved, while same-project targets receive HTTP 200 and are saved.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: sriramveeraghanta

Merge Risk: Minimal · up to ad012

This change restricts intake duplicate targets to the same project on both API surfaces. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description explains the problem: duplicate_to was a plain foreign key with no project scope check, so an intake item could reference a work item in another project or workspace. It states that bo…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the main change: intake duplicate_to validation is scoped to the work item's project. The raw summary shows both intake serializers now reject a duplicate_to target from another projec…
Full details: Description check

Explanation

The description explains the problem: duplicate_to was a plain foreign key with no project scope check, so an intake item could reference a work item in another project or workspace. It states that both serializers now have a validate_duplicate_to that rejects out-of-project work items. It selects a Bug fix type and lists the new contract test files with their outcomes. It keeps the template's section headings. Gaps: the Screenshots placeholder comment is left unchanged, which is acceptable for a backend-only fix. The References section links only WEB-10178 without a full link. Overall the description is mostly complete.

Full details: Title check

Explanation

The title names the main change: intake duplicate_to validation is scoped to the work item's project. The raw summary shows both intake serializers now reject a duplicate_to target from another project, and the contract tests cover that case. The title is specific and matches the changeset, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9f4d9724-a1f3-464b-9a01-c027f63916d6
Commits

Reviewing files that changed from the base of the PR and between 290383d and ad01276.

Files selected for processing: 4

  • apps/api/plane/api/serializers/intake.py
  • apps/api/plane/app/serializers/intake.py
  • apps/api/plane/tests/contract/api/test_intake_duplicate_to_scope.py
  • apps/api/plane/tests/contract/app/test_intake_duplicate_to_scope_app.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@makeplane

makeplane Bot commented Nov 15, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@pablohashescobar pablohashescobar changed the title [WEB-10178] fix(security): scope intake duplicate_to to the project [WEB-10178] fix: scope intake duplicate_to to the project Nov 16, 2026
@sriramveeraghanta
sriramveeraghanta merged commit b0bb025 into preview Nov 16, 2026
19 of 21 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/web-10178-intake-duplicate-scope branch November 16, 2026 10:24
Pawel-Kranzberg pushed a commit to klazwi/pi-plane that referenced this pull request Nov 18, 2026
…10324)

Both the web and the public API intake serializers now reject a duplicate_to work item that does not belong to the intake item's project.

(cherry picked from commit b0bb025)
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.

3 participants