Skip to content

Conversation

@prioux
Copy link
Member

@prioux prioux commented Dec 4, 2025

This PR adds some more validation late in the path to creating task arrays.

The "after_form" method is re-invoked on each task created for a task array. This re-triggers also all the special module codes that apply to after_form.

I've had to re-organize some controller code in TaskController:

  1. The method create_tasklist_from_initial_task() used to create the task array by calling "final_task_list" in the task model, and then save the tasks (while also parallelizing them etc).
  2. Now final_task_list() is called in create() separately, and the task list is passed as an argument to create_tasklist_from_initial_task() only after validation has succeeded.

TO TEST THIS:

a) my favorite way was to turn online a bourreau in my test environment but never actually start it. That way I could fill the task forms and click launch over and over and nothing was actually processed on the bourreau. Find your bourreur in the console, set its "online" to true. Don't even start it.

b) You will need a BoutiquesTask that has more than one file input, but only one mandatory, and that has validation tests on that file input. I used hippunfold in cbrain-plugins-neuro.

c) have several "BidsSubject" registered, along with normal files and FileCollections. Create a CbrainFileList with 3 BidsSubject, another one with 1 BidsSubject and a normal file, etc.

d) I have tested things by selecing in the file manager these combinations

  • 1 cbfilelist of 3 bids subjects
  • 1 cbfilelist of 1 bids and one file
  • 3 bidssubject
  • 3 bids subjects and 1 file (not assigned)
  • 3 bids subjects and 1 file that I assign to the "derivatives" file input

I tried things by assigning the bids subject field in the form, or not assigning anything.

In all possible combinations I found that the form reacted properly with messages about what was not correct. In the end I was only able to create tasks if my main input contained ONLY bids subjects named "sub-1".

@prioux prioux self-assigned this Dec 4, 2025
@prioux prioux added User Interface Priority: High Boutiques Boutiques integration Admin Features or bugs related to administrative features labels Dec 4, 2025
@prioux prioux linked an issue Dec 4, 2025 that may be closed by this pull request
@prioux prioux force-pushed the taskarray_validations branch from 8b3b089 to 9e1a0f9 Compare December 4, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Features or bugs related to administrative features Boutiques Boutiques integration Priority: High User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CBRAIN skips validation for single file tools

1 participant