5
11
Fork
You've already forked tomato
1

Remove implicit task creation on site creation #63

Merged
edwardloveall merged 2 commits from el-no-auto-site-task into main 2025年12月11日 19:19:56 +01:00

When creating a site in a test (or the app), it automatically created a site alongside. This happened even if the factory also specified a task. This created extra tasks in tests which I had to work around in the past, and made tests where the exact tasks were important difficult.

Now, each "siteable" factory (donor, recipient, hub) all create a task (or two in the case of hubs), and a plain site does not. This involved:

  • Removing tasks: [] from site creation (the workaround I used to use
    to prevent extra tasks)
  • Specifying a specific type of site (donor, recipient, hub)
  • Explicitly build tasks in the places that relied on the implicit task
    building

And the app now has a SiteService; this takes care of creating a site and it's related tasks so each caller that needs to create a site doesn't have to remember all the steps.

When creating a site in a test (or the app), it automatically created a site alongside. This happened even if the factory also specified a task. This created extra tasks in tests which I had to work around in the past, and made tests where the exact tasks were important difficult. Now, each "siteable" factory (donor, recipient, hub) all create a task (or two in the case of hubs), and a plain site does not. This involved: - Removing `tasks: []` from site creation (the workaround I used to use to prevent extra tasks) - Specifying a specific type of site (donor, recipient, hub) - Explicitly build tasks in the places that relied on the implicit task building And the app now has a `SiteService`; this takes care of creating a site and it's related tasks so each caller that needs to create a site doesn't have to remember all the steps.
When creating a site in a test, it automatically created a site
alongside. This happened even if the factory also specified a task.
This created extra tasks in tests which I had to work around in the
past, and made tests where the exact tasks were important difficult.
Now, each "siteable" factory (donor, recipient, hub) all create a task
(or two in the case of hubs), and a plain site does not. This involved:
- Removing `tasks: []` from site creation (the workaround I used to use
to prevent extra tasks)
- Specifying a specific type of site (donor, recipient, hub)
- Explicitly build tasks in the places that relied on the implicit task
building
Create SiteService
Some checks failed
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Failed
cc6b5e3b9f
This takes care of creating a site and it's related tasks so each
caller that needs to create a site doesn't have to remember all the
steps.
edwardloveall changed title from (削除) el-no-auto-site-task (削除ここまで) to Stop automatically creating a task when creating a site 2025年12月11日 17:43:46 +01:00
edwardloveall changed title from (削除) Stop automatically creating a task when creating a site (削除ここまで) to Remove implicit task creation on site creation 2025年12月11日 17:44:38 +01:00
edwardloveall deleted branch el-no-auto-site-task 2025年12月11日 19:19:56 +01:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rootable/tomato!63
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-no-auto-site-task"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?