Skip to content

Commit

Permalink
fix: Drop container error to warning
Browse files Browse the repository at this point in the history
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 nf-core/modules#3693 and nf-core#2393
  • Loading branch information
adamrtalbot committed Aug 15, 2023
1 parent 9d63f93 commit 67a84e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
)
Expand Down

0 comments on commit 67a84e6

Please sign in to comment.