17 Commits
Author SHA1 Message Date
John Chilton a73355ea2e Merge pull request #24798 from mvdbeek/implement-reference-data-access-udt
Add reference_data input for YAML tools
2026-11-11 14:56:29 +01:00
mvdbeek f8b6ef0882 Add a user_accessible attribute to tool data tables
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.
2026-11-10 19:05:07 +01:00
John ChiltonandClaude Opus 5.5 15e19cddde Raise DataTableColumnMismatch from merge_tool_data_table
Replace the bare assert so every column conflict path raises the same
exception type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:41:14 -04:00
John ChiltonandClaude Opus 5.5 255fc893ac Halt startup with an actionable error for conflicting shed data tables
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>
2026-10-27 15:41:14 -04:00
John ChiltonandClaude Opus 5.5 8a81e018c2 Move tool data table source ordering into tool_util
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>
2026-10-25 14:58:56 -04:00
John ChiltonandClaude Opus 5.5 18869533bc Reject config_sources combined with config_filename
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>
2026-10-25 14:57:33 -04:00
mvdbeek 1d96e5cfaf Honor administrator-configured data table source order
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.
2026-10-23 16:31:17 +02:00
mvdbeek 5f105497ad Ignore data table entries with an already known value when merging tables
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.
2026-10-09 14:43:28 +02:00
mvdbeek 3ae3d952c3 Inject filesystem into ToolDataPathFiles for mock-free caching tests
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.
2026-07-02 17:28:52 +02:00
mvdbeek a98e16ce97 Use monkeypatch instead of multi-context-manager with in tool-data tests
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.
2026-07-01 22:11:08 +02:00
mvdbeek da2bf439b4 Reformat test with black (parenthesized with-statement) 2026-07-01 18:52:25 +02:00
mvdbeek 6b376a07b6 Add regression tests for per-load-pass tool-data walk
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).
2026-07-01 18:36:18 +02:00
Nate CoraorandClaude Opus 4.7 3e00f529ba Merge & dedup data table entries on shed install (no DM gate)
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>
2026-05-14 14:07:57 -04:00
Nate Coraor a5deee57ac Drop DataTableFileConflict; two tables may share a loc file
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.
2026-05-13 14:41:51 -04:00
Nate Coraor 94a027ca9c Add shared data table consistency check
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.
2026-05-12 17:01:08 -04:00
mvdbeek ac41a2bd44 More root and model fixes 2024-01-08 11:33:30 +01:00
John Chilton 5c04e71a58 Data manager bundles. 2022-12-20 10:35:17 -05:00