From fa4e07424bf60a42559f4fa756495d7f326eea3c Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 10 Dec 2024 17:17:02 +0100 Subject: [PATCH 1/4] add verbose mode to sync action --- .github/workflows/sync.yml | 6 +++++- nf_core/pipelines/create/create.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index c315fdb14..0e28ece8a 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -88,6 +88,7 @@ jobs: version: "latest-everything" - name: Set Git default branch from nextflow.config and set git default branch to that or "master" + run: | cd nf-core/${{ matrix.pipeline }} defaultBranch=$(grep -B5 -A5 "nextflowVersion" nextflow.config | grep "defaultBranch" | cut -d"=" -f2) @@ -95,6 +96,7 @@ jobs: defaultBranch="master" fi echo "Default branch: $defaultBranch" + echo "defaultBranch=$defaultBranch" >> GITHUB_OUTPUT git config --global init.defaultBranch $defaultBranch - name: Run synchronisation @@ -104,7 +106,9 @@ jobs: run: | git config --global user.email "core@nf-co.re" git config --global user.name "nf-core-bot" - nf-core --log-file sync_log_${{ matrix.pipeline }}.txt pipelines sync -d nf-core/${{ matrix.pipeline }} \ + nf-core --log-file sync_log_${{ matrix.pipeline }}.txt + ${{ github.event.inputs.debug == 'true' && '--verbose' || '' }} + pipelines sync -d nf-core/${{ matrix.pipeline }} \ --from-branch dev \ --pull-request \ --username nf-core-bot \ diff --git a/nf_core/pipelines/create/create.py b/nf_core/pipelines/create/create.py index ae5bea57d..0e2c683e6 100644 --- a/nf_core/pipelines/create/create.py +++ b/nf_core/pipelines/create/create.py @@ -298,7 +298,6 @@ def render_template(self) -> None: template_dir = Path(nf_core.__file__).parent / "pipeline-template" object_attrs = self.jinja_params object_attrs["nf_core_version"] = nf_core.__version__ - # Can't use glob.glob() as need recursive hidden dotfiles - https://stackoverflow.com/a/58126417/713980 template_files = list(Path(template_dir).glob("**/*")) template_files += list(Path(template_dir).glob("*")) @@ -433,6 +432,7 @@ def get_default_branch(self) -> None: self.default_branch = ( str(git.config.GitConfigParser().get_value("init", "defaultBranch")) or "master" ) # default to master + log.debug(f"Default branch name: {self.default_branch}") except configparser.Error: log.debug("Could not read init.defaultBranch") if self.default_branch in ["dev", "TEMPLATE"]: From 5c8937e38b406f5748ebf3ed936de9b1ed0ddaa6 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 10 Dec 2024 17:19:32 +0100 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e1140b65..c23bd9644 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ - rocrate: Update crate with version bump and handle new contributor field ([#3334](https://github.com/nf-core/tools/pull/3334)) - set default_branch to master for now ([#3335](https://github.com/nf-core/tools/issues/3335)) - Set git defaultBranch to master in sync action ([#3337](https://github.com/nf-core/tools/pull/3337)) +- Add verbose mode to sync action ([#3339](https://github.com/nf-core/tools/pull/3339)) ### Version updates From bb3a25294af0326cbbc81857f623bca50a12acc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Mir=20Pedrol?= Date: Wed, 11 Dec 2024 10:42:54 +0100 Subject: [PATCH 3/4] Apply suggestions from code review --- .github/workflows/sync.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 0e28ece8a..15ac0cb00 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -106,8 +106,8 @@ jobs: run: | git config --global user.email "core@nf-co.re" git config --global user.name "nf-core-bot" - nf-core --log-file sync_log_${{ matrix.pipeline }}.txt - ${{ github.event.inputs.debug == 'true' && '--verbose' || '' }} + nf-core --log-file sync_log_${{ matrix.pipeline }}.txt \ + ${{ github.event.inputs.debug == 'true' && '--verbose' || '' }} \ pipelines sync -d nf-core/${{ matrix.pipeline }} \ --from-branch dev \ --pull-request \ From 379bad0e97a6a1ec407cd9a0705cf5be06557873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Mir=20Pedrol?= Date: Wed, 11 Dec 2024 10:03:37 +0000 Subject: [PATCH 4/4] add input debug for workflow_dispatch sync action --- .github/workflows/sync.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 15ac0cb00..9a1158c3e 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -23,6 +23,10 @@ on: description: "Pipeline to sync" type: string default: "all" + debug: + description: "Enable debug/verbose mode (true or false)" + type: boolean + default: false # Cancel if a newer run is started concurrency: