Skip to content

[FND-109] Changing the active type variant in a project - #24540

Open
dfriquet wants to merge 4 commits into
devfrom
feature/fnd-109-changing-the-active-type-variant-in-a-project
Open

[FND-109] Changing the active type variant in a project#24540
dfriquet wants to merge 4 commits into
devfrom
feature/fnd-109-changing-the-active-type-variant-in-a-project

Conversation

@dfriquet

@dfriquet dfriquet commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Ticket

https://community.openproject.org/wp/FND-109

What are you trying to accomplish?

  • Adds a Switch variant action to each row of Project settings → Work packages → Types, moving the project from one member of a type family to another and re-typing its work packages.
  • Tidies the row while there: the active variant now reads Variant: <name> instead of a Label chip, and the "In roadmap" indicator is dropped.

Out of scope and tracked separately: the impact preview (FND-188) and background execution for large re-typings (FND-187).

Screenshots

Screenshot of row action Screenshot of modal dialog and open select

What approach did you choose and why?

  • Projects::Types::Switch, an ActiveModel form object, owns the choice (project, source, target) and its validation. SwitchesController builds one per action and hands it to a component or the service, keeping the controller thin.
  • The select is preselected on the variant in use, so the field can never be empty; applying it unchanged gets its own unchanged error instead.
  • The dialog is a shell plus a streamable form component. Validation errors repaint the form component alone — replacing the dialog would swap out the <dialog> node and close it.
  • Switching needs edit_work_packages alongside manage_types. Re-typing runs through WorkPackages::UpdateService as the acting user, which is what keeps each journal entry attributed to the person rather than to System.

Merge checklist

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

@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./spec/features/projects/create_spec.rb[1:12:3: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 #24540, linked for reference only):

- `rspec ./spec/features/projects/create_spec.rb[1:12:3:1]`

Treat this as a standalone task, unrelated to PR #24540. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #24540 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 @dfriquet 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 @dfriquet, and request a review from @dfriquet.
On every commit, set @dfriquet 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.

Switching re-types the project's work packages as the acting user, so it
requires edit_work_packages on top of manage_types.
@dfriquet
dfriquet force-pushed the feature/fnd-109-changing-the-active-type-variant-in-a-project branch from 58c8378 to 711fc31 Compare August 3, 2026 06:52
@dfriquet
dfriquet marked this pull request as ready for review August 3, 2026 06:54
@github-actions

github-actions Bot commented Aug 3, 2026

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

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploying openproject with PullPreview

Field Value
Latest commit ee77ba4
Job deploy
Status ✅ Deploy successful
Preview URL https://pr-24540-fnd-109-changin-ip-178-105-219-134.my.opf.run:443

View logs

A formatter can render a change as nothing, which left the header announcing an author and a time above an empty entry.
Every member of a family answers the root's name, so the change read "Type changed from Task to Task". How to word it instead is still open, so the change stays journaled and only its rendering waits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants