Skip to content

[WEB-9925] feat: rating work item properties - #90

Open
chiraghm4 wants to merge 2 commits into
mainfrom
feat/web-9925-rating-property
Open

chiraghm4 wants to merge 2 commits into
mainfrom
feat/web-9925-rating-property

Conversation

@chiraghm4

@chiraghm4 chiraghm4 commented Nov 27, 2026 •

Copy link
Copy Markdown

What

  • Was: every property model rejected property_type: "RATING". Listing or retrieving properties, or a work item type's properties, raised ValidationError in any workspace that had a rating property. A v1 rating value of 4 read back as 4.0.
  • Now: RATING parses on v1 (PropertyType, PropertyTypeEnum) and on v2 (both WorkItemPropertyType Literals), and a rating value stays an int.

Merge order

⚠️ Merge after makeplane/plane-ee#10929, the server-side rating property support. The change only widens what the SDK accepts, so it's safe against older servers.

Where to look

  • plane/models/enums.py, plane/models/v2/work_item_properties.py, plane/models/v2/work_item_types.py: the new enum and Literal member.
  • plane/models/work_item_properties.py: WorkItemPropertyValueDetail.value gains int, and the CreateWorkItemPropertyValue docstring documents ratings (integer 1–5, cleared with DELETE).

No change needed for writes (CreateWorkItemPropertyValue.value already takes int), v2 custom_fields (dict[str, object]), the type schema's minimum/maximum, or the generated constants.

Proof

  • New offline tests:
    • a v1 RATING row parses
    • a v1 rating value stays int, and a decimal stays float
    • both v2 property models parse RATING
    • CreateWorkItemProperty(property_type="RATING") serializes
  • pytest tests/v2 passes; the offline tests in tests/unit/test_work_item_properties.py pass. The live suites are skipped (no env).
  • ruff, black and mypy report no new findings. Their existing findings on main are unchanged: black on enums.py and the unit test file, 3 ruff errors in the unit test file, 56 mypy errors.

Not in this PR (follow-ups)

  • Property-type sets lag the api_v2 golden (WorkItemPropertyTypeEnum has 14 types). v1 lacks EXTERNAL_DROPDOWN/SLIDER; both v2 WorkItemPropertyType Literals lack CASCADING/EXTERNAL_DROPDOWN/SLIDER. One property of a missing type makes the whole list page fail with ValidationError. This is already the case today for external dropdown properties on v1.
  • Duplicated v2 Literals. WorkItemPropertyType/WorkItemPropertyRelationType are defined in both plane/models/v2/work_item_properties.py and plane/models/v2/work_item_types.py. Generating them from the golden in scripts/generate_v2_constants.py would close both items above.
  • Customer refusal test. tests/unit/test_customers.py parametrizes only FORMULA/CASCADING. Adding RATING would pin the customer set against drift (the CustomerPropertyType docstring is updated in this PR).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for rating properties, with values from 1 to 5.
    • Rating values are preserved as integers, while decimal values remain decimals.
    • Clearing a rating uses DELETE; 0 does not clear it.

Plane added a RATING work item property type (makeplane/plane-ee#10929). The
SDK's property models rejected it, so listing or retrieving properties, or a
work item type's properties, raised ValidationError in any workspace with one.

- Add RATING to the v1 PropertyType enum and PropertyTypeEnum Literal, and to
  both v2 WorkItemPropertyType Literals.
- WorkItemPropertyValueDetail.value accepts int, so a rating of 4 no longer
  reads back as 4.0.
- Document the rating value (integer 1-5, cleared with DELETE) on
  CreateWorkItemPropertyValue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The SDK now accepts RATING as a work item property type across its enum and v2 models. Property value details also permit integers, and tests cover rating parsing, serialization, and numeric value preservation.

Changes: Rating Property Support

Layer / File(s) Summary
Rating property type declarations
plane/models/enums.py, plane/models/v2/work_item_properties.py, plane/models/v2/work_item_types.py, tests/unit/test_work_item_properties.py, tests/v2/test_work_item_properties_resource.py
The enum and v2 property type declarations accept RATING. Tests cover parsing and serialized output.
Integer property values
plane/models/work_item_properties.py, tests/unit/test_work_item_properties.py
WorkItemPropertyValueDetail.value permits integers. Its documentation specifies ratings from 1 to 5 and says to clear a rating with DELETE rather than 0. Tests check preservation of integer and float values.

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

Change: Feature

Possibly related PRs

  • makeplane/plane-python-sdk#89: Adds typed DECIMAL settings and display_format discrimination in the property models. Its tests depend on the RATING property type added here.

Suggested reviewers: dheeru0198, prashant-surya

Merge Risk: Minimal · up to 13196

The SDK now accepts RATING work item properties and keeps integer rating values as integers. The change only widens accepted input and is low risk. The author notes it should merge after the related server-side support.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the feature the PR adds: RATING support for work item properties. The changeset adds RATING to the v1 and v2 property type definitions, preserves integer rating values, and documents r…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the feature the PR adds: RATING support for work item properties. The changeset adds RATING to the v1 and v2 property type definitions, preserves integer rating values, and documents rating usage. The title's scope matches the main change and omits only minor details such as the documentation update.

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: 476a49e0-2445-4c25-b0b3-795206e68738
Commits

Reviewing files that changed from the base of the PR and between 89b5a8a and 1319610.

Files selected for processing: 6

  • plane/models/enums.py
  • plane/models/v2/work_item_properties.py
  • plane/models/v2/work_item_types.py
  • plane/models/work_item_properties.py
  • tests/unit/test_work_item_properties.py
  • tests/v2/test_work_item_properties_resource.py

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

@makeplane

makeplane Bot commented Nov 27, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@dheeru0198 dheeru0198 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checked against the server: rating values come back as integers, so the int in the value type is needed. Merge after makeplane/plane-ee#10929.

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.

2 participants