Should fix
```
Traceback (most recent call last):
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/jobs/runners/__init__.py", line 244, in prepare_job
stderr_file=stderr_file,
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/jobs/runners/__init__.py", line 285, in build_command_line
stderr_file=stderr_file,
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/jobs/command_factory.py", line 79, in build_command
__handle_dependency_resolution(commands_builder, job_wrapper, remote_command_params)
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/jobs/command_factory.py", line 194, in __handle_dependency_resolution
if local_dependency_resolution and job_wrapper.dependency_shell_commands:
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/jobs/__init__.py", line 1012, in dependency_shell_commands
job_directory=self.working_directory
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/tools/__init__.py", line 1891, in build_dependency_shell_commands
tool_instance=self
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/tool_util/deps/__init__.py", line 184, in dependency_shell_commands
requirements_to_dependencies = self.requirements_to_dependencies(requirements, **kwds)
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/tool_util/deps/__init__.py", line 194, in requirements_to_dependencies
requirement_to_dependency = self._requirements_to_dependencies_dict(requirements, **kwds)
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/tool_util/deps/__init__.py", line 283, in _requirements_to_dependencies_dict
dependency = resolver.resolve(requirement, **kwds)
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/tool_util/deps/resolvers/galaxy_packages.py", line 79, in resolve
return self._find_dep_versioned(name, version, type=type, **kwds)
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/tool_util/deps/resolvers/tool_shed_packages.py", line 25, in _find_dep_versioned
path = self._get_package_installed_dependency_path(installed_tool_dependency, name, version)
File "/cvmfs/test.galaxyproject.org/galaxy/lib/galaxy/tool_util/deps/resolvers/tool_shed_packages.py", line 43, in _get_package_installed_dependency_path
tool_shed_repository = installed_tool_dependency.tool_shed_repository
File "/cvmfs/test.galaxyproject.org/venv/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py", line 480, in __get__
return self.impl.get(state, dict_)
File "/cvmfs/test.galaxyproject.org/venv/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py", line 931, in get
value = self.callable_(state, passive)
File "/cvmfs/test.galaxyproject.org/venv/lib/python3.6/site-packages/sqlalchemy/orm/strategies.py", line 836, in _load_for_state
% (orm_util.state_str(state), self.key)
sqlalchemy.orm.exc.DetachedInstanceError: Parent instance <ToolDependency at 0x7fd3e5e82160> is not bound to a Session; lazy load operation of attribute 'tool_shed_repository' cannot proceed (Background on this error at: http://sqlalche.me/e/14/bhk3)
```
Which I think broke in
https://github.com/galaxyproject/galaxy/pull/11737#discussion_r636354063.
Instead of hoping that we preload all attributes it seems more robust to
use a separate session for the cache that is not tied to a thread and
that will not be closed by flushes in other parts of the application.
- Replace `url_for` with `trans.url_builder` that will handle the url generation in both legacy and FastAPI modes.
- Set `group_role` as unique name of the `FastAPIGroupRoles.show` route.
- Change `role_id` path parameter name to `id` to match the legacy route.
For collections `planemo test` output for found file diff is `History item different than expected...` which is not really helpful.
This PR adds the collection name and element identifier to the output.
Essentially a follow up to https://github.com/galaxyproject/galaxy/pull/9771