-
Notifications
You must be signed in to change notification settings - Fork 193
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
init.defaultBranch=dev is not compatible with nf_core.create.git_init_pipeline #1688
Comments
Hi @SamStudio8, I am not able to reproduce this error, could you provide an example of the workflow that generated it? Thank you! |
Hi @mirpedrol , thanks for taking a look. My steps to reproduce this below:
Update: I'm able to reproduce this from today's dev HEAD at |
I'm sorry but still can't reproduce, I get other linting errors but the command runs fine.
I am wondering if it's related to the installation? I am using these versions: |
@mirpedrol Thanks for trying that out once more! As you were unable to reproduce my error, I tried another machine and found the command does indeed work fine as you had demonstrated. As I could still reliably reproduce the error on the first machine, I followed each step of the traceback to try and determine what was happening. I confirmed that as part of linting for Upon inspecting the temporary directory itself, I see that the repository has been created, and has two branches:
I've updated the title of this issue to correctly identify the real problem: "init.defaultBranch=dev is not compatible with nf_core.create.git_init_pipeline". Indeed, any part of I'm not sure to what degree
Thanks for your patience on this one! |
Thanks @SamStudio8 ! This is a good idea. Especially, given how long it has taken to finally figure this out. Be nice to catch this properly. |
|
Sorry @cjw85 I have some files using that data already. |
Yeah me too 👀 |
@cjw85 yes, but This is the first time this has come up in ~4 years and 100s of people running the command, so it's fairly far out in edge-case territory 😅 (kudos! 🙇🏻 ) |
I believe Sam is suggesting that |
Yup and I think it should at least fail gracefully in both cases 🙂 Just saying that I don't think that we need to change any behaviour. Not sure why |
I had thought initially that the error was related to the existence of a
I had the right code but the wrong root cause in my original issue above. The tools/nf_core/lint/files_unchanged.py Lines 135 to 138 in cc1ab61
I think in the case of nf-core lint you could actually pass no_git=True to PipelineCreate here, and skip making a git repository entirely, as the linter does not seem to require a git repository to compare the template files (but I haven't tried this). This could at least allow linting without checking the defaultBranch, and does not preclude merging #1705.
|
Thanks @SamStudio8 for all the testing and suggestions! |
For what it's worth, I wondered about this and discovered that |
Ahh nice, thanks for digging into this @SamStudio8 - much appreciated! |
I am closing this issue since it is fixed by #1705, thanks!! |
NOTE Updated report after diagnosis (see comment thread), original report appended to this description.
Description of the bug
Running
nf-core lint
ornf-core create
(v2.5.dev0) when git'sinit.defaultBranch
is set todev
will exit with aGitCommandError
traceback.Command used and terminal output
(Remember to change your
git config
back, or do this in a VM!)nf-core create
(ornf-core lint
in an existing workflow)System information
nf-core, version 2.5.dev0 (aff3286)
Description of the bug
Running
nf-core lint
(v2.5.dev0) on a workflow inside a git repository with an existingdev
branch yields aGitCommandError
. It appears thefile_unchanged
lint step leads to the attempted creation of a branch (see traceback below).Command used and terminal output
dev
branch (or create one)nf-core lint
Is it expected that the
file_unchanged
lint step leads to the attempted creation of a branch? See:tools/nf_core/lint/files_unchanged.py
Lines 135 to 138 in cc1ab61
tools/nf_core/create.py
Line 500 in cc1ab61
I'm wondering if the
CreatePipeline
call should be passingno_git=True
?System information
nf-core, version 2.5.dev0 (cc1ab61)
The text was updated successfully, but these errors were encountered: