Skip to content

Feature/73135 handle moving work packages with sprint association to a different project#22401

Open
EinLama wants to merge 5 commits intodevfrom
feature/73135-handle-moving-work-packages-with-sprint-association-to-a-different-project
Open

Feature/73135 handle moving work packages with sprint association to a different project#22401
EinLama wants to merge 5 commits intodevfrom
feature/73135-handle-moving-work-packages-with-sprint-association-to-a-different-project

Conversation

@EinLama
Copy link
Contributor

@EinLama EinLama commented Mar 18, 2026

Ticket

https://community.openproject.org/wp/73135

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

Copy link
Contributor

@ulferts ulferts left a comment

Choose a reason for hiding this comment

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

Straight forward and clean, @EinLama .

It is only for a permission limitation that that this cannot be merged.

require "spec_helper"

RSpec.describe WorkPackages::UpdateService, "sprint preservation on project change", type: :model do
shared_let(:user) { create(:admin) }
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't use an admin here. The permissions play a role in whether the change is possible or not. At least with the implementation being what it currently is. The sprint property is guarded by a permission. If the user lacks the permission in the moved to project, the contract will fail.

Failing can be prevented by wrapping the nil-ing with a

model.change_by_system do
  model.sprint = nil
end

But it would be good to have the specs to catch the lack of this wrapping.

Sidenote: version is also guarded by specific permission. The change should have also be wrapped. But on the other hand, this behaviour will disappear after 17.3.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good find. Working on fixing this. After basing on dev, the previously existing specs broke, working on fixing that. But I will first finish reviewing #22393, so this will be on hold a bit. Pushed my broken WIP state.

@EinLama EinLama force-pushed the feature/73135-handle-moving-work-packages-with-sprint-association-to-a-different-project branch from 1d28e72 to b3b0001 Compare March 23, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants