Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Op#57902]: Refactor shared logic for Multi-project activation #16765

Draft
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

akabiru
Copy link
Member

@akabiru akabiru commented Sep 20, 2024

Ticket

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

What are you trying to accomplish?

  • Introduce a base bulk create service for:
    • CustomFields::CustomFieldProjects::BulkCreateService
    • ProjectCustomFieldProjectMappings::BulkCreateService
    • ::Storages::ProjectStorages::BulkCreateService
  • Introduce shared test examples for bulk create services
  • Introduce shared feature examples for multi-project activation
  • Consider extraction of project attributes into own controller

@akabiru akabiru changed the title [Op#57902]: DRY up shared logic for Multi-project activation [Op#57902]: Refactor shared logic for Multi-project activation Sep 20, 2024
@akabiru akabiru self-assigned this Sep 23, 2024
@akabiru akabiru force-pushed the code-maintenance/57902-dry-up-shared-logic-for-multi-project-activation branch from d8d4bb3 to 4f94f66 Compare September 30, 2024 15:47
akabiru and others added 15 commits October 4, 2024 16:33
DRY up common logic in:

  - `CustomFields::CustomFieldProjects::BulkCreateService`
  - `ProjectCustomFieldProjectMappings::BulkCreateService`
  - `::Storages::ProjectStorages::BulkCreateService`
Not sur about this one, but tests pass.
Actually, I think the params parameter should be on the set attributes service call.
We want to filter out id, created_at, updated_at because they would be nil. Compacting the hash is enough to remove them.
As we use it later to broadcast project storages created, it feels odd
to give it to the projects mapper and then read it from it later. It
feels more natural to keep it inside the service. It decouples the logic
a little bit more.
@akabiru akabiru force-pushed the code-maintenance/57902-dry-up-shared-logic-for-multi-project-activation branch from bc6b304 to 3e3f2e4 Compare October 4, 2024 13:37
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