Add shed-tools validate subcommand#237
Open
jmchilton wants to merge 3 commits into
Open
Conversation
6328235 to
bc5b0b6
Compare
Drop the run-data-managers comment claiming Galaxy 26.0 requires a history to execute tools (it doesn't; the failure was a session without an associated history), and trim the verbose galaxy-app pin comment in dev-requirements. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
No-install, no-Galaxy validation of tools files / .yml.lock against a Tool Shed. Structural check reuses RepositoryInstallTargets/read_tools; shed check asserts each repo exists and every pinned changeset_revision is installable. --structural-only skips network for offline pre-commit. Closes #236. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
extra=forbid on RepositoryInstallTarget(s) so a typo'd key (e.g. revision vs revisions) fails structurally instead of silently passing with the pin unchecked. read_tools now rejects a non-mapping/empty YAML root with a clear error instead of a TypeError from **-splatting None; validate() catches it. Install path is unaffected (reads raw YAML, not the model). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bc5b0b6 to
21e87bb
Compare
Member
|
@arash77 this looks interesting. Can you please point John to the scripts that you have been cooking - removing the non-installable revisions etc? Maybe that is interesting for whatever @jmchilton is cooking here. |
Member
|
Sure! You can find the scripts for filtering out the non-installable tool revisions in this PR: usegalaxy-eu/usegalaxy-eu-tools#929 |
Member
|
Should we also allow/validate the top-level |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
shed-tools validatesubcommand: no-install, no-Galaxy validation of a tools file /.yml.lockagainst a Tool Shed. Closes #236.RepositoryInstallTargetspydantic model viaread_tools(same parsing as install).--structural-onlyskips all network access — suitable for offline pre-commit / CI on revision-pinned lock files.Hardening (second commit)
extra=forbidonRepositoryInstallTarget(s)so a typo'd key (e.g.revision:forrevisions:) fails structurally instead of silently passing with the pin unchecked — the failure mode the validator exists to catch. Safe: the install path reads raw YAML and does not use the model; the only model consumers arevalidate, the IDC generator (known keys only), and tests.read_toolsrejects a non-mapping / empty YAML root with a clear error instead of aTypeErrorfrom**-splattingNone.Tests
tests/test_shed_tools_validate.pyfakes the Tool Shed via monkeypatch (no network): structural-only good/bad, full good/bad-revision, missing file, no input, unknown-key rejection, empty/non-mapping root, query-once-per-repo. mypy clean.Comment cleanup (rolled in from #238)
Per @mvdbeek's review on #238, the first commit tidies two comments that landed with that merge: drops the run-data-managers comment wrongly claiming Galaxy 26.0 requires a history to execute tools (the real cause was a session without an associated history), and trims the verbose
galaxy-apppin comment indev-requirements.txt.🤖 Generated with Claude Code