Skip to content

Issue::update(): allow to unset fixed_version_id (fixes #466)#467

Merged
Art4 merged 3 commits intokbsali:v2.xfrom
martinvonwittich:466-issue-update-fixed_version_id
Apr 2, 2026
Merged

Issue::update(): allow to unset fixed_version_id (fixes #466)#467
Art4 merged 3 commits intokbsali:v2.xfrom
martinvonwittich:466-issue-update-fixed_version_id

Conversation

@martinvonwittich
Copy link
Copy Markdown
Contributor

@martinvonwittich martinvonwittich commented Mar 17, 2026

See #466 for details.

Summary by CodeRabbit

  • New Features

    • You can now unassign a fixed version from an issue by clearing the version field when updating an issue; updates will send an explicit empty value to remove the fixed version.
  • Tests

    • Added tests covering assigning a fixed version and unassigning it (empty value) to ensure the update payloads and handling behave as expected.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bbe9632e-f270-43a2-a27e-3eb02f500831

📥 Commits

Reviewing files that changed from the base of the PR and between ec21c00 and 125de43.

📒 Files selected for processing (1)
  • tests/Unit/Api/Issue/UpdateTest.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/Unit/Api/Issue/UpdateTest.php

📝 Walkthrough

Walkthrough

Preserves empty-string fixed_version_id in Issue::update sanitized params so an empty value is sent in the PUT /issues/{id}.xml payload, enabling unassignment of an issue's fixed version (mirrors existing assigned_to_id behavior).

Changes

Cohort / File(s) Summary
Issue API payload sanitation
src/Redmine/Api/Issue.php
When fixed_version_id is present and is an empty string, keep it as '' in sanitized params so the constructed XML contains an empty <fixed_version_id></fixed_version_id> enabling unassignment on update.
Issue update tests
tests/Unit/Api/Issue/UpdateTest.php
Add data-provider cases: assign numeric fixed_version_id and unassign via empty string; update expected XML request bodies and 204 response assertions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Poem

🐇 I hop through XML, nibbling a strand,
Empty tags left tidy by my hand,
Versions released, no longer chained,
Small change, big cheer — the bug is drained! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: allowing the unset of fixed_version_id in Issue::update(), which is directly supported by the code changes shown in the summary.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.72%. Comparing base (39188d8) to head (125de43).
⚠️ Report is 4 commits behind head on v2.x.

Additional details and impacted files
@@            Coverage Diff            @@
##               v2.x     #467   +/-   ##
=========================================
  Coverage     98.72%   98.72%           
- Complexity      781      783    +2     
=========================================
  Files            29       29           
  Lines          2273     2275    +2     
=========================================
+ Hits           2244     2246    +2     
  Misses           29       29           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Art4 Art4 added the bug label Mar 17, 2026
Copy link
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/Unit/Api/Issue/UpdateTest.php`:
- Around line 129-144: The test data array contains a duplicate key 'test
unassign user from issue' which overwrites the earlier case for assigned_to_id;
rename this key to a unique, accurate name (e.g. 'test unassign version from
issue' or similar) in the data provider inside UpdateTest so the original
assigned_to_id test is not lost and the case clearly reflects that
fixed_version_id is being unset; update any related descriptive strings in the
same test method if they reference the old name to keep messages consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3ce2a29f-deb5-4bc5-8c58-b65d67983933

📥 Commits

Reviewing files that changed from the base of the PR and between e7a1f5e and ec21c00.

📒 Files selected for processing (1)
  • tests/Unit/Api/Issue/UpdateTest.php

@Art4
Copy link
Copy Markdown
Collaborator

Art4 commented Mar 18, 2026

Thank you very much for your contribution. This looks very good. 👍

I will run some e2e tests later and adjust the behat tests if needed and will release a hotfix release.

@Art4 Art4 added this to the v2.9.1 milestone Apr 2, 2026
@Art4 Art4 merged commit a4b6d6d into kbsali:v2.x Apr 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants