+
Skip to content

Validation of meta.yaml in cross-org repos #3680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
### General

- don't read param expressions with spaces as params ([#3674](https://github.com/nf-core/tools/pull/3674))
- Validation of meta.yaml in cross-org repos ([#3680](https://github.com/nf-core/tools/pull/3680))

## [v3.3.2 - Tungsten Tamarin Patch 2](https://github.com/nf-core/tools/releases/tag/3.3.2) - [2025-07-08]

Expand Down
2 changes: 1 addition & 1 deletion nf_core/modules/lint/meta_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def meta_yml(module_lint_object: ComponentLint, module: NFCoreComponent, allow_m
# Confirm that the meta.yml file is valid according to the JSON schema
valid_meta_yml = False
try:
with open(Path(module_lint_object.modules_repo.local_repo_dir, "modules/meta-schema.json")) as fh:
with open(Path(module.base_dir, "modules/meta-schema.json")) as fh:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure we should change this. module_lint_object.modules_repo.local_repo_dir is checking the cloned modules repository, which should be the one that is being used.
I think what should be changed is the repo that we are cloning to the cache. I was trying to make some test with the test modules repo but there seems to be an error, my suggestion would be to fix that repo until it is useable and then we can figure out the best way to adapt it.

schema = json.load(fh)
validators.validate(instance=meta_yaml, schema=schema)
module.passed.append(("meta_yml_valid", "Module `meta.yml` is valid", module.meta_yml))
Expand Down
4 changes: 2 additions & 2 deletions nf_core/subworkflows/lint/meta_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def meta_yml(subworkflow_lint_object, subworkflow, allow_missing: bool = False):
# Confirm that the meta.yml file is valid according to the JSON schema
valid_meta_yml = True
try:
with open(Path(subworkflow_lint_object.modules_repo.local_repo_dir, "subworkflows/yaml-schema.json")) as fh:
with open(Path(subworkflow.base_dir, "subworkflows/yaml-schema.json")) as fh:
schema = json.load(fh)
jsonschema.validators.validate(instance=meta_yaml, schema=schema)
subworkflow.passed.append(("meta_yml_valid", "Subworkflow `meta.yml` is valid", subworkflow.meta_yml))
Expand Down Expand Up @@ -115,7 +115,7 @@ def meta_yml(subworkflow_lint_object, subworkflow, allow_missing: bool = False):
# join included modules and included subworkflows in a single list
included_components_names = [component["name"] for component in included_components]
if "components" in meta_yaml:
meta_components = [x for x in meta_yaml["components"]]
meta_components = [x if isinstance(x, str) else list(x)[0] for x in meta_yaml["components"]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change looks good 🙂

for component in set(included_components_names):
if component in meta_components:
subworkflow.passed.append(
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载