diff --git a/CHANGELOG.md b/CHANGELOG.md index 61ba31f6f7..23178e3f3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/nf_core/pydantic_models.py b/nf_core/pydantic_models.py index ffdcebc0fb..ed3aa73a2a 100644 --- a/nf_core/pydantic_models.py +++ b/nf_core/pydantic_models.py @@ -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) diff --git a/tests/test_utils.py b/tests/test_utils.py index aaf6e157bd..9baf5eb43b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -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