Files
galaxy/test/unit/workflows
mvdbeek bc6d47963f Annotate trans parameters across the codebase
Type every function signature that took an untyped `trans`, using the
narrowest context each function actually needs: ProvidesAppContext,
ProvidesUserContext or ProvidesHistoryContext in manager and service
code, SessionRequestContext for FastAPI endpoints, and
GalaxyWebTransaction for legacy WSGI controllers. Lower-level packages
(model, security, datatypes, tool_util, util) use TYPE_CHECKING imports
with quoted annotations so no runtime cycle is introduced.

Annotating a previously untyped function turns on mypy body checking for
it, which surfaced several latent bugs, fixed here:

- webapps/base/controller.py passed three arguments to
  can_modify_library_item(), which accepts two.
- api/provenance.py BaseProvenanceController was missing
  SharableItemSecurityMixin, so security_check() did not exist on it.
- managers/users.py raised exceptions.Message, which does not exist, and
  is_admin() returned None rather than False.
- Unguarded toolbox.get_tool() results in tools, workflow modules and
  library upload now raise ToolMissingException instead of failing with
  AttributeError.
- FTP upload paths raised TypeError when no FTP directory was configured
  instead of reporting a request error.

Where an annotation exposed a gap in an interface, the interface is
fixed rather than suppressed: error_codes gained a PEP 562 __getattr__
for its JSON-loaded members, vault moved from StructuredApp to
MinimalManagerApp, dataset_matcher_factory is declared on
ProvidesHistoryContext, and the toolbox panel view methods accept both a
web transaction and a request context.
2026-07-20 15:04:45 +02:00
..
2026-06-25 15:12:05 +01:00
2022-02-03 07:42:20 -05:00