From 67a84e6e4f5bbe21ee36204e39f2a9f67487c0dd Mon Sep 17 00:00:00 2001 From: Adam Talbot Date: Mon, 14 Aug 2023 14:39:26 +0100 Subject: [PATCH] fix: Drop container error to warning Changes: - Container registries do not have a consistent API, so calling them for container presence doesn't seem to work on GHCR or NVCR. - This drops the error to a warning so we don't fail tests. Relates to https://github.com/nf-core/modules/issues/3693 and https://github.com/nf-core/tools/issues/2393 --- CHANGELOG.md | 4 ++++ nf_core/modules/lint/main_nf.py | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf5a0627ab..07e3bd4b3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,11 @@ - Add module MULTIQC to modules.config ([#2377](https://github.com/nf-core/tools/pull/2377)) - Update the Code of Conduct ([#2381](https://github.com/nf-core/tools/pull/2381)) - Save template information to `.nf-core.yml` and deprecate argument `--template-yaml` for `nf-core sync` ([#2388](https://github.com/nf-core/tools/pull/2388) and [#2389](https://github.com/nf-core/tools/pull/2389)) +<<<<<<< HEAD - Remove fixed Ubuntu test and added to standard testing matrix +======= +- Reduce container finding error to warning since the registries are not consistent. +>>>>>>> 4e7fd2f3 (fix: Drop container error to warning) ### Download diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index 617e53c069..deb47b5799 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -346,8 +346,9 @@ def check_process_section(self, lines, registry, fix_version, progress_bar): if url is None: continue try: + container_url = "https://" + urlunparse(url) if not url.scheme == "https" else urlunparse(url) response = requests.head( - "https://" + urlunparse(url) if not url.scheme == "https" else urlunparse(url), + container_url, stream=True, allow_redirects=True, ) @@ -360,10 +361,10 @@ def check_process_section(self, lines, registry, fix_version, progress_bar): self.failed.append(("container_links", "Unable to connect to container URL", self.main_nf)) continue if not response.ok: - self.failed.append( + self.warned.append( ( "container_links", - f"Unable to connect to {response.url}, status code: {response.status_code}", + f"Unable to connect to container registry, code: {response.status_code}, url: {response.url}", self.main_nf, ) )