Skip to content

Conversation

@dheeru0198
Copy link
Member

@dheeru0198 dheeru0198 commented Nov 28, 2025

Description

  • Added options directly on the CreateWorkItemProperty and WorkItemProperty models
  • Added testcases

Type of Change

  • Improvement (change that would cause existing functionality to not work as expected)

Note

Add inline option support to work item properties (create/response) and update tests to verify options appear in list/retrieve; bump version to 0.2.2.

  • Models:
    • Add options to WorkItemProperty and CreateWorkItemProperty to allow inline creation/return of OPTION choices.
  • Tests:
    • Update scripts and unit tests to create option properties with inline options and assert options are present in list/retrieve responses.
    • Simplify property value usage to CreateWorkItemPropertyValue(value=...) and verify retrieval across types (including multi-value options).
  • Packaging:
    • Bump plane-sdk version to 0.2.2.

Written by Cursor Bugbot for commit d0ce071. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • New Features

    • Inline option creation: define property options (including defaults) when creating work item properties.
    • Support for text attribute settings on properties and simplified property value assignment and retrieval flows.
  • Tests

    • Expanded automated tests to cover creation, listing, retrieval, updates, and deletion of option-bearing properties and inline options.
  • Chores

    • Project version bumped to 0.2.2.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Added optional inline options support to work item property models and updated tests to create and verify option-bearing properties with inline options at creation time. No control-flow or serialization changes beyond adding new optional fields.

Changes

Cohort / File(s) Summary
Model Enhancements
plane/models/work_item_properties.py
Added optional options field to WorkItemProperty and CreateWorkItemProperty (types: `list[WorkItemPropertyOption]
Integration Tests — property values
tests/scripts/test_property_values.py
Create properties with inline options instead of separate option-creation calls; verify option counts and contents in list and retrieve responses; added verbose checks and prints.
Integration Tests — work item types & properties
tests/scripts/test_work_item_types_and_properties.py
Use inline options for Priority (4 options, one default) and apply TextAttributeSettings for Severity; simplify property value creation payloads; verify inline options via list/retrieve and adjust property value retrievals to target individual properties.
Unit Tests
tests/unit/test_work_item_properties.py
Added/updated unit tests to create/list/retrieve/update/delete properties with inline options, asserting option presence, counts, names, defaults, and cleanup flows.
Project Metadata
pyproject.toml
Bumped project version from 0.2.1 to 0.2.2.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect plane/models/work_item_properties.py for correct typing, defaulting, and (de)serialization behavior of new options and settings fields.
  • Verify tests: ensure they correctly assert presence/counts of inline options and that creation API supports inline options (no regression in existing flows).
  • Check version bump in pyproject.toml is intentional and consistent with release process.

Possibly related PRs

Poem

🐰 I tucked options into properties tight,
Inline they sparkle, ready at first light.
Tests hop around, counting each one,
Creation now bundles — oh what fun! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding support for passing options during property creation in the custom properties API.
Docstring Coverage ✅ Passed Docstring coverage is 88.24% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1ef5f2 and d0ce071.

📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@makeplane
Copy link

makeplane bot commented Nov 28, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
plane/models/work_item_properties.py (1)

72-72: Consider validating options field based on property_type.

While the inline options support is functional, consider extending the existing validate_settings_and_relation_type validator (lines 82-112) to ensure options are only provided for PropertyType.OPTION properties. This would provide clearer client-side validation and better developer experience.

Example validation logic to add in the validator:

         # RELATION properties require relation_type
         if prop_type == PropertyType.RELATION:
             if relation_type is None:
                 raise ValueError("relation_type is required for RELATION properties")
+
+        # OPTIONS should only be provided for OPTION properties
+        if self.options is not None and prop_type != PropertyType.OPTION:
+            raise ValueError("options can only be provided for OPTION properties")

         return self
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c28a0b7 and f1ef5f2.

📒 Files selected for processing (4)
  • plane/models/work_item_properties.py (2 hunks)
  • tests/scripts/test_property_values.py (1 hunks)
  • tests/scripts/test_work_item_types_and_properties.py (4 hunks)
  • tests/unit/test_work_item_properties.py (8 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
tests/scripts/test_property_values.py (3)
plane/models/work_item_properties.py (2)
  • CreateWorkItemProperty (55-112)
  • CreateWorkItemPropertyOption (207-218)
plane/models/enums.py (1)
  • PropertyType (53-64)
tests/scripts/test_work_item_types_and_properties.py (2)
  • print_success (46-48)
  • print_step (39-43)
tests/scripts/test_work_item_types_and_properties.py (3)
tests/scripts/test_property_values.py (2)
  • print_success (51-53)
  • print_step (44-48)
plane/models/work_item_properties.py (3)
  • CreateWorkItemProperty (55-112)
  • CreateWorkItemPropertyOption (207-218)
  • CreateWorkItemPropertyValue (260-288)
plane/models/enums.py (1)
  • PropertyType (53-64)
tests/unit/test_work_item_properties.py (2)
plane/models/work_item_properties.py (3)
  • CreateWorkItemProperty (55-112)
  • CreateWorkItemPropertyOption (207-218)
  • UpdateWorkItemProperty (115-179)
plane/models/enums.py (1)
  • PropertyType (53-64)
🪛 Ruff (0.14.6)
tests/scripts/test_work_item_types_and_properties.py

32-32: Unused noqa directive (non-enabled: E402)

Remove unused noqa directive

(RUF100)

tests/unit/test_work_item_properties.py

112-113: try-except-pass detected, consider logging the exception

(S110)


112-112: Do not catch blind exception: Exception

(BLE001)


266-267: try-except-pass detected, consider logging the exception

(S110)


266-266: Do not catch blind exception: Exception

(BLE001)


613-614: try-except-pass detected, consider logging the exception

(S110)


613-613: Do not catch blind exception: Exception

(BLE001)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (15)
plane/models/work_item_properties.py (1)

44-44: LGTM! Inline options support added to response model.

The optional options field allows work item properties to include their associated options in API responses, enabling inline option creation and retrieval.

tests/unit/test_work_item_properties.py (4)

8-12: LGTM! Necessary imports for inline options testing.

The additional imports enable the new test scenarios for creating properties with inline options.


61-113: LGTM! Comprehensive test for inline options in list responses.

The test thoroughly validates that properties created with inline options include those options in the list API response, with appropriate cleanup logic.


220-267: LGTM! Validates inline options in retrieve responses.

The test confirms that retrieving a property includes its inline options and validates both option count and names, including testing the is_default parameter.


570-614: LGTM! Dedicated test for inline options creation.

The test validates that OPTION properties can be created with inline options and that those options are immediately available in the creation response, covering 4 options with one marked as default.

tests/scripts/test_property_values.py (4)

218-240: LGTM! Status property now uses inline options.

The Status property creation has been successfully updated to define 5 options inline, demonstrating the new feature. The success message appropriately logs the inline option count.


242-268: LGTM! Multi-value property with inline options.

The Tags property demonstrates inline options working correctly with multi-value properties (is_multi=True), creating 6 options inline.


270-282: LGTM! Verification of inline options.

The verification step confirms that inline options are immediately accessible from the created property responses, eliminating the need for separate option creation API calls.


284-309: LGTM! Validates options in list and retrieve responses.

The validation confirms that inline options are consistently included in both list and retrieve API responses, with correct option counts for both single-value (5 options) and multi-value (6 options) properties.

tests/scripts/test_work_item_types_and_properties.py (6)

32-34: Import added for TextAttributeSettings usage.

The import is necessary for line 168 where TextAttributeSettings is used. Note: Static analysis detected an unused noqa directive that could be removed for cleanup.


168-168: LGTM! TextAttributeSettings correctly applied to TEXT property.

The settings parameter is properly configured for the TEXT property type, satisfying the model's validation requirements.


176-215: LGTM! Priority property with 4 inline options.

The Priority property demonstrates inline option creation with proper structure, including setting Medium as the default option. The success message appropriately logs the inline option count.


245-274: LGTM! Comprehensive verification of inline options in list/retrieve.

The verification steps thoroughly validate that inline options for the Priority property are accessible immediately after creation and are consistently included in list and retrieve responses.


294-320: LGTM! Simplified property value creation syntax.

The property value creation has been streamlined to use CreateWorkItemPropertyValue(value=...) directly, which is cleaner and more idiomatic. The response handling correctly accesses the .value attribute.


327-348: LGTM! Individual property value retrieval for clearer verification.

The updated approach retrieves and prints each property value individually, providing clearer validation and more informative test output.

@Prashant-Surya Prashant-Surya merged commit da384d3 into main Nov 29, 2025
1 of 2 checks passed
@Prashant-Surya Prashant-Surya deleted the feat-property-options branch November 29, 2025 09:59
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