Skip to content
Draft
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# nf-core/tools: Changelog

## [unreleased]

### General

- Round-trip the `ci:` block in `.nf-core.yml` so centralised nf-core/actions CI config is not dropped by `sync`/`bump-version` ([#4453](https://github.com/nf-core/tools/pull/4453))

## [v4.1.0 - Marshalled Mamba](https://github.com/nf-core/tools/releases/tag/4.1.0) - [2026-07-29]

### General
Expand Down
7 changes: 7 additions & 0 deletions nf_core/pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ class NFCoreYamlConfig(BaseModel):
""" Disable updating specific modules/subworkflows (when repository_type is pipeline). See https://nf-co.re/docs/nf-core-tools/modules/update for more information. """
container_registry: list[str] | None = Field(default=None, alias="container-registry")
""" Additional container registry prefixes allowed when linting container directives. """
ci: dict[str, Any] | None = None
""" Configuration passed through to the centralised nf-core/actions CI workflows.
Deliberately a permissive dict rather than a typed model: nf-core/actions defines and
adds these keys independently (see src/actions/read-config/registry.ts in that repo). A
strict schema here would mean every new CI setting needs a tools release plus a template
sync before any pipeline could use it, reintroducing the coupling that centralising the
workflows removed. tools only needs to round-trip this block, not validate it. """

def __getitem__(self, item: str) -> Any:
return getattr(self, item)
Expand Down
16 changes: 16 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,19 @@ def test_get_wf_files(self, tmpdir):
files = nf_core.utils.get_wf_files(tmpdir)
files = sorted(str(Path(f).relative_to(tmpdir)) for f in files)
assert files == [".gitignore", "dir1/should-match-1", "should-match-2"]


@pytest.mark.parametrize("repository_type", ["pipeline", "modules"])
def test_nfcore_yml_ci_round_trip(repository_type):
"""The `ci:` block (consumed by nf-core/actions) must survive a model_dump() rewrite."""
from nf_core.pydantic_models import NFCoreYamlConfig

ci = {
"nf_test_version": "0.9.0",
"nextflow_versions": ["24.04.2", "latest-stable"],
"profiles": ["docker", "singularity"],
"max_shards": 5,
"some_future_key": "value nf-core/actions may add independently",
}
config = NFCoreYamlConfig(repository_type=repository_type, ci=ci)
assert config.model_dump()["ci"] == ci
Loading