Lets an admin mark a table as readable by user-defined tools. Tables
are closed by default. Opening a table in any config keeps it open when
configs merge, and the attribute is dropped from Tool Shed supplied
configs, which are later reloaded as local, so a repository can't open
a table for itself.
A repository install could write a table to shed_tool_data_table_conf.xml
whose columns conflict with an already registered table of the same name.
Loading it at startup hit a bare assertion in merge_tool_data_table and
Galaxy failed to start with no hint at the cause. Check consistency while
loading and raise DataTableColumnMismatch naming the file and installing
repository; at startup, re-raise as a ConfigurationError telling the admin
which <table> to remove from the shed config.
Fixes#24328.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pure config -> ToolDataTableConfigSource list transform; testing it directly
replaces exercising it only through a Mock app.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two load modes don't compose: tables loaded from config_filename sit
outside config_sources and a full reload_tables() silently drops them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read sources in configured order at startup and after persistent registration or reload. Preserve table references, invalidate versions, and refresh peer processes and watchers.
Retain distinct rows sharing a value so tool filters can run before first-match lookup, incorporating the minimal prerequisite from #24323. Document the existing configuration settings and cover ordering, aliases, missing defaults, registration, reloads, and applications without watchers.
Entries for the same value loaded from another tool data table config (e.g.
a mounted reference data repository such as IDC next to local data) are now
skipped when tables are merged, logging an error if the entry differs from
the registered one and a warning if it is identical.
Selected dynamic option values also resolve to a single entry, so duplicate
values no longer produce comma separated paths in tool command lines.
Route the two filesystem operations ToolDataPathFiles performs (os.walk in
update_files, os.path.exists in exists/update_files) through an injectable
ToolDataFilesystem protocol, defaulting to a real _OsFilesystem so all callers
are unaffected. ToolDataTableManager threads an optional filesystem argument to
its ToolDataPathFiles.
Rework the walk-count regression tests to drive this seam with a counting
CountingFilesystem instead of monkeypatching ToolDataPathFiles, per review
feedback preferring an actual implementation over mocking. The tests still
assert one walk per config-load pass, one per reload pass, and zero walks for
exists() outside a pass.
The parenthesized multi-context-manager with-statement (black's preferred
form) is parsed as a single tuple context manager on Python 3.8, which the
tool_util package still targets, raising AttributeError: __enter__. Switch
the walk-counting tests to the pytest monkeypatch fixture, which needs no
with-statement and is both 3.8-compatible and stable under black.
Assert that the tool-data tree is walked once per load pass (config load
and reload) regardless of how many tables trigger exists() checks, and that
exists() outside a load pass never walks (falls back to os.path.exists).
Replace the non-Data-Manager skip with a uniform install path: every
repo's tables get registered. First install copies the .loc.sample to
tool_data_path and writes the <table> entry without a
<tool_shed_repository> sub-element; subsequent installs of the same
table append unique rows from their .loc.sample to the shared loc file,
prefixed by a comment_char attribution line. get_filename_for_source
falls back to a no-repo_info filename so DMs on legacy installs keep
matching their existing <tool_shed_repository>-tagged files.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Galaxy ships picard_indexes and srma_indexes pointing at the same loc
file, so the cross-table file-path check raised on every startup.
Keep only the same-name column-mismatch protection and update the
production-shed test to expect no per-revision tool_data_table_conf.xml
for non-DM repos.
Adds DataTableColumnMismatch and DataTableFileConflict, raised by
ToolDataTableManager.assert_data_table_consistency. Wired into
load_from_config_file so the invariant also fires at server startup.
Refs galaxyproject/galaxy#21448.