Repository navigation
Conversation
The configfile links every input image into ./input under its element identifier. Identifiers are free text, so a name containing a quote broke out of the single-quoted ln argument, and a '/' pointed the link into a directory that does not exist. Build the link name with $safe_element_identifier (element_identifier_macros.xml, added to this directory): characters other than word characters, '-' and '.' become '_'. Ordinary names are unchanged; "my image (1)" now becomes "my_image__1_", which also shows in the output names derived from it. Version 3.1.9+galaxy2.
The tar input path was the only unquoted value in the configfile. Dataset paths are generated by Galaxy, so this is for consistency; no behaviour change.
Different identifiers can give the same cleaned name ("a b", "a_b", "a(b"
all become "a_b"). The configfile runs its ln lines without '&&', so a
second link with the same name failed silently and that image was left out
of the analysis. The same happened before for identical names.
Add $safe_element_identifiers to element_identifier_macros.xml (token
@SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a
list of element identifiers (or strings) and adds _2, _3, ... to a name that
is already taken. The first name keeps its plain form, so inputs without
clashes are unchanged. Use it for the image links.
The configfile links every input image into ./input under its element identifier. Identifiers are free text, so a name containing a quote broke out of the single-quoted ln argument, and a '/' pointed the link into a directory that does not exist. Build the link name with $safe_element_identifier (element_identifier_macros.xml, added to this directory): characters other than word characters, '-' and '.' become '_'. Ordinary names are unchanged; "my image (1)" now becomes "my_image__1_", which also shows in the output names derived from it. Version 4.2.8+galaxy1.
The tar input path was the only unquoted value in the configfile. Dataset paths are generated by Galaxy, so this is for consistency; no behaviour change.
Different identifiers can give the same cleaned name ("a b", "a_b", "a(b"
all become "a_b"). The configfile runs its ln lines without '&&', so a
second link with the same name failed silently and that image was left out
of the analysis. The same happened before for identical names.
Add $safe_element_identifiers to element_identifier_macros.xml (token
@SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a
list of element identifiers (or strings) and adds _2, _3, ... to a name that
is already taken. The first name keeps its plain form, so inputs without
clashes are unchanged. Use it for the image links.
The report title is filled in with sed, and both element identifiers were written into the single-quoted sed program. A quote ended the sed argument, and '/', '&' or '\' changed or broke the substitution. Write the identifiers through $safe_element_identifier (element_identifier_macros.xml, added to this directory), which leaves only word characters, '-' and '.'. Ordinary names are unchanged; "my file (1).txt" appears in the title as "my_file__1_.txt". Version 3.12+galaxy1.
The target sequence was written unquoted. Its sanitizer keeps '|' and spaces (needed for headers like "sp|P12345|NAME"), so a '|' was read by the shell as a pipe instead of being passed to gfastats. Split the value on whitespace, as the shell did before, and pass each word single-quoted. Also fix the validator: it was not anchored (Galaxy applies it with re.match, so only a prefix was checked), and ':-_' was a character range that also allowed ';<=>?@[\]^'. It now allows exactly what the sanitizer keeps: ^[0-9A-Za-z:_| -]*$. Version 1.3.11+galaxy3.
These two dataset paths were the only unquoted file arguments. Galaxy generates them, so this is for consistency; no behaviour change.
Both inputs were linked as "1.<identifier>.<ext>" / "2.<identifier>.<ext>" inside double quotes, so a '$', backtick or '"' in an identifier was expanded by the shell, and a trailing '\' merged it with the next word. Build both names once with $safe_element_identifier (element_identifier_macros.xml, added to this directory) and pass them single-quoted to ln and magick. Ordinary names are unchanged. The version suffix is shared by the directory, so this also re-versions imagemagick_image_convert and imagemagick_image_montage to 7.1.2-2+galaxy2.
Same problem as in compare: every input was linked and passed to magick as "<identifier>.<ext>" (optionally with an index prefix) inside double quotes, and the input links were not quoted at all. Use $safe_element_identifier for the names and single-quote them everywhere. The labels (-label "%t") show the cleaned name, so "Mirror Donald" is now labelled "Mirror_Donald".
Without index prefixes, two inputs with the same cleaned name (identical names, or e.g. "Mirror Donald" and "Mirror_Donald") made the second ln fail and the job stopped. Add $safe_element_identifiers to element_identifier_macros.xml (token @SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a list of element identifiers (or strings) and adds _2, _3, ... to a name that is already taken. The first name keeps its plain form, so inputs without clashes are unchanged. Use it for the montage inputs; the label then shows e.g. "Mirror_Donald_2". New test: the same image twice with labels and no indexes.
The tool turns parameter sanitizing off, because the default sanitizer
would rewrite characters SMARTS needs ('[', ']', '@', '#', ...). The
pattern was therefore written raw into a single-quoted shell argument, so
a quote in it ended the argument.
Add an anchored validator that allows the SMARTS character set without
whitespace or quotes and not starting with '-', so the value can no longer
be read as an obgrep option.
Version 3.1.1+galaxy3.
The dataset path and its extension were unquoted in the call to multi_obgrep.py. Both come from Galaxy, so this is for consistency; no behaviour change.
The find pattern was pasted into the awk program as /<pattern>/ and the
replacement as "<replacement>". A '/' in the pattern or a '"' in the
replacement ended that literal: the program broke, or the rest of the
value was run as awk code.
Pass the find pattern through the environment and use it as a dynamic
regex (ENVIRON["FIND_PATTERN_<n>"]); this has the same meaning as /.../.
Pass the replacement with -v, which processes escape sequences exactly like
a "..." literal, so \1 and & keep working. Checked against the old
program on patterns with \., \t, \\, {m,n} and backreferences:
the outputs are identical. New test with '/' and '"' in the patterns.
The version suffix is shared by all text_processing tools, so all of them
move to 9.11+galaxy1.
With the "reference genome and intervals" input, the target file is bgzipped to "<identifier>.gz" and the genome is copied to "<identifier>", and both names were passed to bgzip, tabix, cp and the script (partly in double quotes). A quote, '$' or backtick in an identifier changed the command. Build both names once with $safe_element_identifier (element_identifier_macros.xml, added to this directory), keeping the .gz suffix, and single-quote them everywhere. @Version@ is the directory's only version token, so all sklearn tools move to 1.0.12.1.
Same bgzip/tabix/--targets pattern as keras_train_and_eval: use the cleaned identifier and keep it single-quoted.
Same bgzip/tabix/--targets pattern as keras_train_and_eval: use the cleaned identifier and keep it single-quoted.
The Python configfile put the target file's element identifier inside a '...' string, so a quote in it ended the string and the rest ran as Python. Write the cleaned name with json.dumps instead, and single-quote the script path on the command line.
The assay names (main layer, extra omics layers, cox plot omics name) are text parameters, but the template used their raw value (bypassing the sanitizer) with only spaces replaced, and wrote them unquoted into file names, ln and script arguments, and the comma-separated layer lists. Clean them with $safe_element_identifier (element_identifier_macros.xml, added to this directory) and single-quote every path and list built from them. Spaces still become '_' as before, so "b ar" is still "b_ar"; other characters outside [A-Za-z0-9_.-] now also become '_', including ',', which used to split a name into two layers. The version suffix is shared, so flexynesis_infer, flexynesis_utils, flexynesis_plot and flexynesis_cbioportal_import move to 1.1.14+galaxy1 as well.
Same as in flexynesis: clean the main and extra assay names and quote the paths built from them.
The X, labels, omics and mutation inputs were linked as "inputs/<identifier>.<ext>", and the same names went into script arguments and, inside '...' strings, into the Python configfile. A quote ended the shell argument or the Python string. Build each path once from the cleaned identifier, single-quote it in the command, and write it into the configfile with json.dumps.
The data_column values were pasted into the Python configfile as "$param-2". Write them as int(...) so the configfile only ever contains a number there. No behaviour change.
Two omics inputs with the same cleaned name made the second ln fail and the job stopped. Add $safe_element_identifiers to element_identifier_macros.xml (token @SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a list of element identifiers (or strings) and adds _2, _3, ... to a name that is already taken. The first name keeps its plain form, so inputs without clashes are unchanged. Use it for the omics files.
Reads and genomes are linked under their element identifier, with only whitespace replaced, and the names were passed to sylph sketch unquoted (group inputs as one space-separated string). Any shell character in an identifier was run by the shell. Build the names with $safe_element_identifier (element_identifier_macros.xml, added to this directory), collect group inputs in a list and single-quote every name. sylph writes these names into its output, so "my sample (1)" now appears as "my_sample__1_.fastq", and a run of spaces gives one '_' per space instead of one in total. Version 0.8.1+galaxy2 for both tools.
Two reads or genomes in a group with the same cleaned name made the second ln fail and the job stopped. Add $safe_element_identifiers to element_identifier_macros.xml (token @SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a list of element identifiers (or strings) and adds _2, _3, ... to a name that is already taken. The first name keeps its plain form, so inputs without clashes are unchanged. Use it on the identifiers without their .fastq(.gz) or .fasta(.gz) extension and add the extension back afterwards, so sylph still recognises the format.
…rectory Output paths were built as os.path.join(out_dir, name) without checking the name. The base name of a record split keeps '/' through Galaxy's sanitizer, and in a column split the name comes from the dataset itself. So: - a base name like "cl1 FASTA (1/2)" failed with FileNotFoundError, because "cl1 FASTA (1" is not a directory; - a base name or a column value with "../" or a leading "/" created or appended to files outside the output directory. Replace '/', '\' and NUL with '_', and a leading '.' as well, in both the base name and the column-derived names. Names without these characters are unchanged. New test with base name "../cl1 (1/2)". Version 0.5.4.
…cide After cleaning, column values such as "a/b" and "a_b" map to the same file name, so their rows would be merged into one output. Give each distinct name its own file: later names that are already taken get _2, _3, ... before the extension. New test with "a/b", "a_b" and "/tmp/x" ids.
875d37c to
1bb3fca
Compare
The ob_grep change gives the repository a new revision, and the shed linter requires every tool in it to have a version above the latest installable one. Bump the Galaxy suffix of each other tool by one.
A test with expect_failure="true" may not declare outputs, and the linter rejects it (TestsOutputFailing). The output was never compared because the job is expected to fail.
convert.xml hardcodes its suffix instead of using @VERSION_SUFFIX@, so the macro bump did not reach it and the shed linter reports a version equal to the latest installable revision.
The cellprofiler tool change gives the repository a new revision, and the shed linter requires every tool in it to have a version above the latest installable one. Bump the Galaxy suffix of each other tool by one.
display_data_on_image offered PathName twice in the measurement category select, with two matching when blocks, so the tool defined the same parameter name twice. Remove the second option and its when block; the choices the user sees are otherwise unchanged.
export_to_spreadsheet (output_file_location), save_images (subfolder_in_output) and the Split tests of color_to_gray (name_output_image) set values for inputs the tools do not have. The templates write fixed values for these settings, so the parameters were ignored and the expected pipelines do not change.
The tests of tile, starting_modules, image_math and measure_image_quality set parameters at the top level that the tools define inside a section or conditional. Legacy test handling matched them by name; nesting them as the inputs are declared lets the tests validate on current tool profiles. The tested values are unchanged.
remote_repository_url named the parent tools/ directory for both cellprofiler repositories. Point it at tools/cellprofiler and tools/cellprofiler_v4, and add the homepage_url and long_description that cellprofiler was missing, taken from cellprofiler_v4.
Tool Review:
|
What
Several wrappers put collection element identifiers or text parameters straight into the command line, a
sedreplacement, an awk program or a Python configfile. Names with quotes, spaces,
$, backticks or similar characterscould break the job or change the command. This PR cleans these values, or passes them as data, and keeps them quoted.
Ordinary names behave as before.
The commits are atomic: each one fixes one thing in one tool directory, and its message says what it fixes. The first
commit for a directory carries the version bump.
The helper
element_identifier_macros.xml(the same file as in tools-iuc) defines@SAFE_ELEMENT_IDENTIFIER@, a Cheetah function$safe_element_identifier(...): every character other than word characters,-and.becomes_, a leading-or.becomes_, and an empty name becomes_. It is copied into each tool directory that uses it, imported, and thetoken is expanded once at the top of each command/configfile:
For several inputs that end up in one directory, the file also has
@SAFE_ELEMENT_IDENTIFIERS@, which defines$safe_element_identifiers(items). It cleans a list of element identifiers (or strings) the same way and adds_2,_3, ... to a name that is already taken, so identifiers that clean to the same name stay distinct:cellprofiler, montage, flexynesis_utils and sylph use it. The copies of the file in diff and sklearn only need the
single-name function and are unchanged.
Tools
-v) instead of program textjson.dumpsjson.dumps/,\and a leading.become_); fixes jobs failing on names likecl1 FASTA (1/2)Behaviour changes users may notice
_,-and.are cleaned where they become file names, e.g.my sample (1).fastq→my_sample__1_.fastq. This shows up in:job.feature_logs.<name>) and the split_data collection element names;Mirror Donald→Mirror_Donald);_per space (previously one_for the whole run)._2,_3, ... (cellprofiler, montagewithout indexes, flexynesis_utils split_data, sylph groups, split_file_to_collection by column). Before, cellprofiler dropped
the image and split_file_to_collection merged the rows; the others failed the job.
/in the find pattern and"in the replacement now work literally. Patterns without thembehave exactly as before (same regex and backreference semantics).
-, is now rejected in the form.Tests
planemo lintis clean for every changed tool.planemo test(conda) passes for:/and"in the patterns);/in the base name and in the id column).refseq_and_intervalbranch, and the environment is very large.