Resolve conditional dependencies from tool_shed.yml for the Tool Shed - #23213
Merged
jmchilton merged 1 commit intoJul 30, 2026
Merged
Conversation
common_startup.sh resolved only galaxy.yml, so a Tool Shed deployment installed nothing from conditional-requirements.txt. That is why the sentry-sdk>=2.63.0 pin never reached toolshed.test, which kept an older sentry-sdk and hit the FastAPI >= 0.137 wrapper-loop crash: sentry re-wraps dependant.call on every request there, and inspect.unwrap raises once the chain passes the recursion limit. Move the machinery and the app-agnostic checks into BaseConditionalDependencies so the Tool Shed evaluates the database driver and sentry-sdk checks against its own config section, and let run_tool_shed.sh select it with GALAXY_CONDITIONAL_DEPENDENCIES_APP. Galaxy-only checks stay on ConditionalDependencies, where check() keeps treating a missing check_<name> method as "not needed".
|
This PR was merged without a "kind/" label, please correct. |
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.
scripts/common_startup.shresolves the conditional dependency set fromgalaxy.ymlonly:run_tool_shed.shgoes through the same script, but never exportsGALAXY_CONFIG_FILE, andConditionalDependenciesreads thegalaxy:section besides. So on a Tool Shed host nothing inconditional-requirements.txtis ever installed or upgraded — those packages come from the deployment layer instead, outside the version bounds we declare here.Before:
After:
How this surfaced
toolshed.testreturned 500 on every/api/users/currentrequest:FastAPI >= 0.137 rebuilds the route handler per request (
APIRoute.handlecallsrequest_response(self.get_route_handler())for routes reached through an included router — which is all of ours). sentry-sdk's FastAPI integration replacesdependant.callwith afunctools.wraps-decorated wrapper for sync endpoints, so one__wrapped__layer accumulates per request, andinspect.unwrapraises once the chain passessys.getrecursionlimit()— roughly 987 requests, after which the endpoint stays broken until restart.wrapscopies__qualname__, which is why the message names the endpoint while the address differs each time.Fixed upstream in getsentry/sentry-python#6569, released in sentry-sdk 2.63.0, and pinned here in 5aabd48. That pin had no effect on the Tool Shed, for the reason above.
Changes
ConditionalDependenciesintoBaseConditionalDependencies— config loading,get_conditional_requirements,check, and the checks whose options every app schema defines (the three database drivers andsentry-sdk) — and the Galaxy subclass, which keeps everything driven by job conf, object stores, file sources, vault, OIDC and error reporters.ToolShedConditionalDependenciesonly setsconfig_section = "tool_shed"; Galaxy-only checks have nocheck_<name>method there andcheck()already treats that as "not needed", so there is no allowlist to keep in sync.optional()takes anappargument backed by anAPPSregistry of class plus config-file names.set_tool_shed_config_file_varincommon_startup_functions.sh, factored out of the snippetrun_tool_shed.shalready had;common_startup.shpicks the config file and app fromGALAXY_CONDITIONAL_DEPENDENCIES_APP, whichrun_tool_shed.shexports.galaxy-dependencies --app, so a playbook can drive the Tool Shed install directly.statsdstays Galaxy-only —statsd_hostis not in the Tool Shed schema, unlikesentry_dsnanddatabase_connection.Note this does not by itself repair a running Tool Shed: the upgrade only happens the next time
common_startup.shruns with wheel fetching enabled.Testing
Four cases added to
test/unit/app/dependencies/test_deps.py: thetool_shed:section is read, the same file read as Galaxy selects nothing, Galaxy-only dependencies are skipped while the database driver is selected, and an unknown app is rejected. The Galaxy path returns an unchanged set.