diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30ac864..96735a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,11 +2,15 @@ name: Build on: push: - branches: [ master ] + branches: + - master + - v1 tags: - 'v[0-9]+.[0-9]+.[0-9]+*' pull_request: - branches: [ master ] + branches: + - master + - v1 jobs: build: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c911db5..d88fb44 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,9 @@ name: Test on: push: - branches: [ master ] + branches: + - master + - v1 paths: - '.github/workflows/test.yml' - '**.py' diff --git a/README.md b/README.md index 107aff7..90e32ff 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ cd git clone https://github.com/FNNDSC/miniChRIS-docker.git cd miniChRIS-docker ./minichris.sh -docker compose --profile hasura up -d +docker compose --profile pacs --profile hasura up -d ``` ### Testing @@ -57,6 +57,7 @@ First, run [miniChRIS-docker](https://github.com/FNNDSC/miniChRIS-docker) to get then run pytest and _SERIE_ using Docker Compose: ```shell +docker compose --profile test build docker compose run --use-aliases test ``` diff --git a/docker-compose.yml b/docker-compose.yml index 0701262..052387e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,8 @@ services: - ./src:/app:ro ports: - 8888:8000 + environment: + CHRIS_URL: http://chris:8000/api/v1/ networks: minichris-local: aliases: diff --git a/src/serie/actions.py b/src/serie/actions.py index b7d7cae..ba38031 100644 --- a/src/serie/actions.py +++ b/src/serie/actions.py @@ -158,7 +158,16 @@ def _expand_variables(template: str, series: DicomSeriesFilePair) -> str: """ Expand the value of variables in ``template`` using field values from ``series``. """ - return template.format(**series.to_dict()) + return _sanitize_feed_name(template.format(**series.to_dict())) + + +def _sanitize_feed_name(name: str) -> str: + """ + Sanitize the feed name to be allowed by CUBE's undocumented limitations. + """ + # slash not allowed. https://github.com/FNNDSC/ChRIS_ultron_backEnd/issues/523 + sanitized = name.replace('/', '-') + return sanitized[:200] # truncate to 200 characters length class InvalidRunnablesError(Exception):