Skip to content
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

dev -> main for 3.1.0 #3336

Merged
merged 35 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e9cde59
set default_branch to master for now
mashehu Dec 10, 2024
7110fff
update changelog
mashehu Dec 10, 2024
47054ad
Merge branch 'dev' into set-default-branch-to-master
mashehu Dec 10, 2024
a791707
Merge pull request #3335 from mashehu/set-default-branch-to-master
mashehu Dec 10, 2024
de00162
set git defaultBranch to master in sync action
mashehu Dec 10, 2024
60ae1af
update changelog
mashehu Dec 10, 2024
5ee2d52
use nextflow.config to set defaultBranch
mashehu Dec 10, 2024
0e7c870
Merge pull request #3337 from mashehu/fix-init-branch-in-sync-action
mashehu Dec 10, 2024
666fc9f
fix path for nextflow.config grep
mashehu Dec 10, 2024
7a69b8c
Merge branch 'dev' of github.com:nf-core/tools into fix-sync-grep
mashehu Dec 10, 2024
15b044d
change working dir when setting defaultBranch
mashehu Dec 10, 2024
1a22106
fix Changelog
mashehu Dec 10, 2024
0b7fe50
Be more verbose in approval check action
mashehu Dec 10, 2024
f7ced6b
fix if clause
mashehu Dec 10, 2024
1748613
update changelog
mashehu Dec 10, 2024
fa4e074
add verbose mode to sync action
mashehu Dec 10, 2024
5c8937e
update changelog
mashehu Dec 10, 2024
bb3a252
Apply suggestions from code review
mirpedrol Dec 11, 2024
379bad0
add input debug for workflow_dispatch sync action
mirpedrol Dec 11, 2024
06db03f
Merge pull request #3339 from mashehu/add-verbose-mode-to-sync
mirpedrol Dec 11, 2024
6148983
go back to original directory after configuring git defaultBranch
mirpedrol Dec 11, 2024
a4965f3
Merge pull request #3342 from mirpedrol/sync-default-branch
mirpedrol Dec 11, 2024
df5b323
add more debugging on sync GHA
mirpedrol Dec 11, 2024
e8b6a9f
Merge pull request #3345 from mirpedrol/sync-default-branch
mirpedrol Dec 11, 2024
1de1034
echo message to sync GHA
mirpedrol Dec 11, 2024
3858e38
try exiting pipeline directory before saving defaultBranch
mirpedrol Dec 11, 2024
380be6c
cleanup debugging echo
mirpedrol Dec 11, 2024
be38c15
use same ref in checkout as triggered the workflow
mashehu Dec 11, 2024
1af4c61
Merge pull request #3347 from mashehu/specify-ref-in-sync-yml
mashehu Dec 12, 2024
e92f327
don't set up loggin level to error
mirpedrol Dec 12, 2024
d56b528
Merge pull request #3349 from mirpedrol/sync-debugging
mirpedrol Dec 12, 2024
8f00659
Revert "don't set up loggin level to error [no changelog]"
mashehu Dec 12, 2024
f77737d
Merge pull request #3350 from nf-core/revert-3349-sync-debugging
mashehu Dec 12, 2024
c2a9dee
Update nf_core/pipeline-template/.github/workflows/awsfulltest.yml
mirpedrol Dec 12, 2024
3c20e00
Merge pull request #3338 from mashehu/more-verbose-awsfulltest-checks
mirpedrol Dec 12, 2024
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
21 changes: 20 additions & 1 deletion .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -87,14 +91,29 @@ jobs:
with:
version: "latest-everything"

- name: Set Git default branch from nextflow.config and set git default branch to that or "master"

run: |
pushd nf-core/${{ matrix.pipeline }}
defaultBranch=$(grep -B5 -A5 "nextflowVersion" nextflow.config | grep "defaultBranch" | cut -d"=" -f2)
if [ -z "$defaultBranch" ]; then
defaultBranch="master"
fi
popd
echo "Default branch: $defaultBranch"
echo "defaultBranch=$defaultBranch" >> GITHUB_OUTPUT
git config --global init.defaultBranch $defaultBranch

- name: Run synchronisation
if: github.repository == 'nf-core/tools'
env:
GITHUB_AUTH_TOKEN: ${{ secrets.nf_core_bot_auth_token }}
run: |
git config --global user.email "[email protected]"
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 \
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
- Don't break gitpod.yml with template string ([#3332](https://github.com/nf-core/tools/pull/3332))
- rocrate: remove duplicated entries for name and version ([#3333](https://github.com/nf-core/tools/pull/3333))
- 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

Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipeline-template/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ validation {
https://doi.org/10.1038/s41587-020-0439-x

* Software dependencies
https://github.com/{{ name }}/blob/master/CITATIONS.md
https://github.com/{{ name }}/blob/{{ default_branch }}/CITATIONS.md
"""{% endif %}
}{% if is_nfcore %}
summary {
Expand Down
8 changes: 4 additions & 4 deletions nf_core/pipelines/create/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(
template_config: Optional[Union[CreateConfig, str, Path]] = None,
organisation: str = "nf-core",
from_config_file: bool = False,
default_branch: str = "main",
default_branch: str = "master",
is_interactive: bool = False,
) -> None:
if isinstance(template_config, CreateConfig):
Expand Down Expand Up @@ -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("*"))
Expand Down Expand Up @@ -431,8 +430,9 @@ def get_default_branch(self) -> None:
"""Gets the default branch name from the Git configuration."""
try:
self.default_branch = (
str(git.config.GitConfigParser().get_value("init", "defaultBranch")) or "main"
) # default to main
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"]:
Expand Down
Loading