Skip to content

[COMMS-900] Adjust copying versions on project copy/work package duplicate#24298

Open
brunopagno wants to merge 4 commits into
devfrom
blp/impl/comms-900-copy-project
Open

[COMMS-900] Adjust copying versions on project copy/work package duplicate#24298
brunopagno wants to merge 4 commits into
devfrom
blp/impl/comms-900-copy-project

Conversation

@brunopagno

@brunopagno brunopagno commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Ticket

https://community.openproject.org/projects/MEET/work_packages/COMMS-900/activity

What are you trying to accomplish?

  • Adjust copying target_versions & observed in versions when copying work packages
  • Remove read from work_package.version when copying projects
  • Adjust work package forms so that they render the correct version when duplicating a work package (render unpersisted values)

Merge checklist

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

thykel and others added 3 commits July 16, 2026 08:58
Project copy no longer reads source_work_package.version_id; the legacy
override is derived from the first remapped target version so it keeps
agreeing with the target_versions set (contract validation) until the
column is dropped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copying only replicated the mirrored version_id column, so target
versions beyond the first and observed_in references were lost on
duplication. They are now passed explicitly as replacements; empty sets
are omitted so users without assign_versions can still copy versionless
work packages, and explicit overrides (project copy remapping) keep
winning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@brunopagno brunopagno self-assigned this Jul 16, 2026
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./modules/gitlab_integration/spec/features/work_package_gitlab_tab_spec.rb[1:2:1:1:3]
  • rspec ./modules/team_planner/spec/features/team_planner_overview_spec.rb[1:4:4:1]
🤖 Ask Copilot to investigate

Copy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer.

@copilot The following spec(s) are flaky in CI (first seen on PR #24298, linked for reference only):

- `rspec ./modules/gitlab_integration/spec/features/work_package_gitlab_tab_spec.rb[1:2:1:1:3]`
- `rspec ./modules/team_planner/spec/features/team_planner_overview_spec.rb[1:4:4:1]`

Treat this as a standalone task, unrelated to PR #24298. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #24298 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @brunopagno to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @brunopagno, and request a review from @brunopagno.
On every commit, set @brunopagno as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

@brunopagno
brunopagno force-pushed the blp/impl/comms-900-copy-project branch from f509ac2 to e9ce2f2 Compare July 16, 2026 08:30
@brunopagno
brunopagno requested a review from a team July 16, 2026 08:32
@brunopagno
brunopagno marked this pull request as ready for review July 16, 2026 08:32
@github-actions

Copy link
Copy Markdown

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

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