Commit Graph
153 Commits
Author SHA1 Message Date
mvdbeek 64e74b8b48 Tighten TRS url check
Fixes
https://sentry.galaxyproject.org/share/issue/5b8d495edd6545278d4d93d0ed69ac3a/:
```
Message
Uncaught exception in exposed API method:
Stack Trace

Newest

gaierror: [Errno -2] Name or service not known
  File "urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "urllib3/util/connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f8e35406450>: Failed to establish a new connection: [Errno -2] Name or service not known
  File "urllib3/connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
  File "urllib3/connectionpool.py", line 416, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "urllib3/connection.py", line 244, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "http/client.py", line 1286, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "http/client.py", line 1332, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "http/client.py", line 1281, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "http/client.py", line 1041, in _send_output
    self.send(msg)
  File "http/client.py", line 979, in send
    self.connect()
  File "urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
  File "urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
MaxRetryError: HTTPConnectionPool(host='https', port=80): Max retries exceeded with url: //training.galaxyproject.org/training-material//api/ga4gh/trs/v2/tools/variant-analysis-microbial-variants/versions/microbial_variant_calling/GALAXY/descriptor (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8e35406450>: Failed to establish a new connection: [Errno -2] Name or service not known'))
  File "requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "urllib3/connectionpool.py", line 799, in urlopen
    retries = retries.increment(
  File "urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
ConnectionError: HTTPConnectionPool(host='https', port=80): Max retries exceeded with url: //training.galaxyproject.org/training-material//api/ga4gh/trs/v2/tools/variant-analysis-microbial-variants/versions/microbial_variant_calling/GALAXY/descriptor (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8e35406450>: Failed to establish a new connection: [Errno -2] Name or service not known'))
  File "galaxy/web/framework/decorators.py", line 346, in decorator
    rval = func(self, trans, *args, **kwargs)
  File "galaxy/webapps/galaxy/api/workflows.py", line 261, in create
    archive_data = server.get_version_descriptor(trs_tool_id, trs_version_id)
  File "galaxy/workflow/trs_proxy.py", line 115, in get_version_descriptor
    return self._get(trs_api_url)["content"]
  File "galaxy/workflow/trs_proxy.py", line 126, in _get
    response = requests.get(url, params=params, timeout=DEFAULT_SOCKET_TIMEOUT)
  File "galaxy/util/requests.py", line 29, in wrapper
    rval = f(*args, **kwargs)
  File "requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
```
which happened for https://usegalaxy.org/workflows/trs_import?run_form=true&trs_url=http%3A%2F%2Flocalhost%3A4000%2F%2Ftraining-material%2F%2Fapi%2Fga4gh%2Ftrs%2Fv2%2Ftools%2Fvariant-analysis-microbial-variants%2Fversions%2Fmicrobial_variant_calling"
2024-09-18 10:31:23 +02:00
mvdbeek a2fdcb3c72 Merge branch 'release_24.0' into release_24.1 2024-06-08 15:54:19 +02:00
mvdbeek c6930fff72 Merge branch 'release_23.2' into release_24.0 2024-06-08 15:53:41 +02:00
mvdbeek dff6307e91 Allow DCE as outer input to to_cwl 2024-06-07 17:29:07 +02:00
John Davis ee47b93cc0 Fix type error in workflow unit test 2024-04-08 09:55:35 -04:00
mvdbeek 03f01da108 Merge branch 'release_23.2' into dev 2024-01-15 12:09:43 +01:00
mvdbeek a2cb91487a Merge branch 'release_23.1' into release_23.2 2024-01-15 12:05:09 +01:00
mvdbeek 01502917f7 Fix `to_cwl` for nested collections
Fixes
```
TypeError
Object of type DatasetCollection is not JSON serializable
```
seen when running https://github.com/galaxyproject/iwc/pull/315
2024-01-12 12:24:59 +01:00
mvdbeek 649895eb8d .dict() -> .model_dump() 2024-01-08 11:33:32 +01:00
John Chilton 7e515a6504 Fix workflow report to target right workflow version.
There was a past jmchilton todo in the code base about it. Directives that might target particular versions of a workflow (so workflow_display and workflow_image) now can take a workflow_version attribute and when these things are auto-populated for workflow invocations - they are populated with the right version for the invocation.
2023-11-17 13:09:09 -05:00
John Chilton 0d55fd0a84 Progress on workflow default files. 2023-11-01 16:08:28 -04:00
John Chilton dce53769bd Implement default locations for data and collection parameters.
Works for both files and collections. Workflow defaults override tool defaults.

TODO:

- Unit test case to ensure this only works for non-default, non-multi data parameters.
- Implement XSD once syntax is finalized.
2023-11-01 11:52:44 -04:00
John Chilton f1c2dde09f Protocol to try to break up app for cleaner tool shed install typing. 2023-09-26 13:46:53 -04:00
mvdbeek eb8a49d805 Drop delayed_tool_init config setting 2023-08-26 10:08:13 +02:00
mvdbeek 5cbc192c31 Merge branch 'release_23.1' into dev 2023-08-23 17:14:39 +02:00
mvdbeek 6d067f47b5 Merge branch 'release_23.0' into release_23.1 2023-08-23 17:09:50 +02:00
mvdbeek c001ce0dcc Fix conditional step evaluation with datasets in repeats
For instance when this is the step state:

```
{
    queries: [
        {
            __index__: 0,
            inputs2: ["<galaxy.model.HistoryDatasetAssociation(141277566) at 0x7fc2099417f0>"]
        }
    ],
when: False
}
```

as seen in https://sentry.galaxyproject.org/share/issue/995445a10402461aa80328db5ceba491/
2023-08-22 18:14:25 +02:00
mvdbeek edeaf26720 Drop delayed_tool_init config setting 2023-08-17 11:44:29 +02:00
John Davis e54a2ec897 Fix SA2.0 syntax (query->select) in unit tests
Includes multiple upgrades to syntax.
Ref: https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#migration-orm-usage
2023-07-21 13:04:22 -04:00
John Davis f8d28c2bf6 Wrap session.flush in test.unit.workflows 2023-06-09 13:05:26 -04:00
Nicola Soranzo 30f60493c3 Format Python code with black 23.1.0
with manual fixes to 3 files to make them compatible with black 22.12.0 .

We need to keep black pinned at `<23` until we vendorise `packaging`, since
the new version of black depends on `packaging >=22.0` which is the version
where `LegacyVersion` (which we use for tool lineages) was removed.
2023-02-01 23:51:03 +00:00
John Chilton 788b231cd2 Merge remote-tracking branch 'origin/dev' into trs-url-import 2022-12-13 10:11:57 -05:00
Nicola Soranzo 85a92be30a Merge pull request #15177 from jmchilton/fixup_refactoring_types
Fixup types surrounding workflow refactoring testing.
2022-12-13 10:48:41 +00:00
John ChiltonandNicola Soranzo 3cc3938ebb Update test/unit/workflows/test_refactor_models.py
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2022-12-12 19:34:57 -05:00
John Chilton ca8fc29436 Small tweaks to test_refactor_models. 2022-12-12 18:22:06 -05:00
John Chilton 59044511f5 Merge branch 'fixup_refactoring_types' into trs-url-import 2022-12-12 10:20:27 -05:00
John Chilton 0180bf67a1 Fixup types surrounding workflow refactoring testing. 2022-12-12 10:18:20 -05:00
John Chilton 1efec9f8ba Address some of the new mypy notes about unchecked annotations. 2022-12-11 23:28:12 -05:00
Finn Bacall 96e69879a0 use is None instead of == None 2022-12-05 13:02:59 +00:00
Finn Bacall c5bc5aa857 Fix formatting issues
`make format`
`make client-format`
2022-12-05 13:02:59 +00:00
Finn Bacall 02d829ddb3 Match tool IDs with slashes, and unquote them. 2022-12-05 13:02:59 +00:00
Finn Bacall 4bf41470b5 Unit tests for TrsProxy changes 2022-12-05 13:02:59 +00:00
Finn Bacall 159cade2d1 Allow workflows to be imported directly from TRS URLs
...without prior knowledge of the TRS server

galaxyproject/galaxy#14636
2022-12-05 13:02:59 +00:00
mvdbeek accdea9b14 Always inject all modules, then compute runtime state 2022-10-29 22:11:03 +02:00
mvdbeek 66c143fc12 Inject modules & connections, then build runtime state for all steps
That means steps can reason about connections that otherwise wouldn't
have modules attached when building runtime inputs.
2022-10-28 17:05:51 +02:00
Nicola Soranzo c35d8f2a06 Replace `unittest.TestCase` with pytest-based partial re-implementation
Also:
- Rename `FooBarTestCase` test classes as `TestFooBar`. These were collected
  by pytest only because they were `unittest.TestCase` derived, but normally
  pytest collects only test classes whose name starts with `Test`, see
  https://docs.pytest.org/en/7.1.x/reference/reference.html#confval-python_classes
2022-09-27 03:34:58 +01:00
Marius van den Beek 955815ca11 Merge pull request #14688 from mvdbeek/dev
Merge 22.05 into dev
2022-09-26 15:19:53 +02:00
mvdbeek cbd38554f1 Merge branch 'release_22.05' into dev 2022-09-26 15:15:19 +02:00
John Chilton 550d29493f Merge pull request #14683 from mvdbeek/type_annotation_workflow_run
Add type hints for galaxy.workflow.{run, run_request}
2022-09-23 09:14:46 -04:00
mvdbeek 81b2f3e1e1 Add ModuleInjector, avoids test type mismatch 2022-09-23 10:19:02 +02:00
mvdbeek 48c654d1b2 Add type hint for galaxy.workflow.{run, run_request}
Trying out https://github.com/dropbox/pyannotate here.
It's still a lot of work even with pyannotate, but I think this fixes
some minor oddities, like assigning non-mapped attributes to
WorkflowInvocation instances.
2022-09-23 09:33:47 +02:00
Nicola Soranzo b5c7e2c86a Replace `self.assert* method calls with plain asserts in test/`
using https://github.com/pytest-dev/unittest2pytest with the following command:

```
unittest2pytest -f self_assert -w -n test/
```

(excluding ``self.assertRaises*`` method calls).
2022-09-21 23:50:05 +01:00
mvdbeek 64cb245ddd Fix running subworkflows with disconnected optional/default inputs 2022-09-21 19:31:41 +02:00
mvdbeek 8a8acc625f Fix refactor action dropping outputs on subworkflow connection
I thought it would be cleaner to make a distinction between the output
name and the output label when reasoning about a subworkflow step in
the context of a parent workflow
(https://github.com/galaxyproject/galaxy/pull/14473/commits/b0727be9e0b096a2dacacb767a1f4ac0fc3e6540#diff-a50bcc5c08ade11249449c4100ea8c286727df601b52a5b9588eb2a385d97da7R543),
in case we'd later want to do something with the label.

I don't think I thought about this correctly though,
and it breaks connections between steps that were made by referencing
the subworkflow's output name.

This wasn't necessary for the main goal of
https://github.com/galaxyproject/galaxy/pull/14473, so I'm partially
reverting that here.

Fixes https://github.com/galaxyproject/planemo/pull/1262#issuecomment-1223874571
2022-08-23 14:12:29 +02:00
mvdbeek b0727be9e0 Fix change_datatype not reflected in tool and workflow output terminals 2022-08-16 15:46:11 +02:00
John Chilton abb69b552c Implement API endpoints and tests for workflow sharing options. 2022-04-13 15:37:43 -04:00
John Chilton 427847bcc4 Fix up some import "issues". 2022-03-16 14:22:50 -04:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
John Chilton 7006e2a7e5 More unit test fixes. 2021-10-08 11:04:00 -04:00
John Chilton 8f9034a414 Typing fixes for various unit tests. 2021-10-05 13:22:41 -04:00