Skip to content

Conversation

@MontrealSergiy
Copy link
Contributor

No description provided.

Copy link
Member

@prioux prioux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes.

</div>
<% end %>

<% t.edit_cell(:inputs_readonly, :header => "Read only input files", :show_width => 2) do |f| %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Within the web page, let's not use the 'inputs_readonly' phrasing, it's super ugly. Let's show this as 'Does not modify its inputs files'

<% t.edit_cell(:inputs_readonly, :header => "Read only input files", :show_width => 2) do |f| %>
<%= f.check_box :inputs_readonly %>
<div class="wide_field_explanation">
Are you sure that input files are not mutated by any task? It will allow execution with data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next text:

Check this if the tool is known <strong>not to modify its input files</strong>. This will allow a user to launch the tool on files that are not marked as group-writable in the file manager.

@@ -0,0 +1,5 @@
class AddInputsReadonlyToToolConfig < ActiveRecord::Migration[5.0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add license header. Check other migration for examples.

@prioux
Copy link
Member

prioux commented Dec 8, 2020

I just realized that the Boutiques integrator is not checking that new flag.

Please adjust BrainPortal/liv/cbrain_task_generators/templates/portal.rb.erb so that it looks up that values. Look for readonly_input_files in the code:

./portal.rb.erb:103:      :readonly_input_files => <%=
./portal.rb.erb:120:    @_file_access ||= (self.class.properties[:readonly_input_files].present? ? :read : :write)

There is a complexity there. At line 103 the template sets a constant value in the CLASS based on what is found in the descriptor. We can't adjust that, because at the class level we have no way to find out the configuration at run time that is in the tool config.

But at line 120 is where the run-time code looks it up, so basically we need the code to check the property in in the tool config there. It will be tru if it's true EITHER in the descriptor, or in the tool config.

Copy link
Member

@prioux prioux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more change requested, see discussion panel.

@prioux
Copy link
Member

prioux commented Dec 8, 2020

Please fix the tests. Dozens of them fail now when trying to invoke inputs_readonly on nil.

@prioux prioux merged commit 79034d4 into aces:master Dec 15, 2020
@MontrealSergiy MontrealSergiy deleted the readonlyinput branch July 3, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow the admin to indicate that task can modify its input in a ToolConfig

2 participants