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

--git-range fails on GitHub CI #2

Closed
grst opened this issue Feb 20, 2020 · 5 comments
Closed

--git-range fails on GitHub CI #2

grst opened this issue Feb 20, 2020 · 5 comments

Comments

@grst
Copy link
Owner

grst commented Feb 20, 2020

Hi @mbargull,

maybe you can help.
Your suggestion in actions/checkout#160 indeed works for git diff, but unfortunately not for the bioconda-utils --git-range parameter.

I tried

run: |
bioconda-utils lint tools config.yml --exclude missing_hash missing_tests --git-range origin/master HEAD

but it still fails with

AttributeError: 'NoneType' object has no attribute 'diff'

Any idea what could be the problem?

Thanks,
Gregor

Full log

Run bioconda-utils lint tools config.yml --exclude missing_hash missing_tests --git-range origin/master HEAD
2020-02-20T17:50:42.0574914Z �[36;1mbioconda-utils lint tools config.yml --exclude missing_hash missing_tests --git-range origin/master HEAD�[0m
2020-02-20T17:50:42.0611050Z shell: /bin/bash -l {0}
2020-02-20T17:50:42.0611146Z ##[endgroup]
2020-02-20T17:50:43.4015794Z 17:50:43 �[32mBIOCONDA INFO�[0m Considering total of 4 recipes (bwa-index, gatk-dict, fastqc, trim_galore).�[0m
2020-02-20T17:50:43.4016638Z 17:50:43 �[31mBIOCONDA ERROR�[0m No merge base found for HEAD and master�[0m
2020-02-20T17:50:43.4017425Z 17:50:43 �[31mBIOCONDA ERROR�[0m Dropping into debugger
2020-02-20T17:50:43.4017594Z Traceback (most recent call last):
2020-02-20T17:50:43.4017958Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 71, in wrapper
2020-02-20T17:50:43.4018075Z     func(*args, **kwargs)
2020-02-20T17:50:43.4018594Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 345, in do_lint
2020-02-20T17:50:43.4018701Z     recipes = get_recipes(config, recipe_folder, packages, git_range)
2020-02-20T17:50:43.4019089Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 168, in get_recipes
2020-02-20T17:50:43.4019201Z     changed_recipes = get_recipes_to_build(git_range, recipe_folder)
2020-02-20T17:50:43.4019567Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 152, in get_recipes_to_build
2020-02-20T17:50:43.4019682Z     return repo.get_recipes_to_build(ref, other)
2020-02-20T17:50:43.4020037Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/githandler.py", line 491, in get_recipes_to_build
2020-02-20T17:50:43.4020150Z     tobuild = set(self.get_changed_recipes(ref, other))
2020-02-20T17:50:43.4020621Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/githandler.py", line 433, in get_changed_recipes
2020-02-20T17:50:43.4020727Z     for path in self.list_changed_files(ref, other):
2020-02-20T17:50:43.4021053Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/githandler.py", line 329, in list_changed_files
2020-02-20T17:50:43.4021159Z     for diffobj in merge_base.diff(ref):
2020-02-20T17:50:43.4021430Z AttributeError: 'NoneType' object has no attribute 'diff'�[0m
2020-02-20T17:50:43.4043548Z Traceback (most recent call last):
2020-02-20T17:50:43.4044081Z   File "/usr/share/miniconda/envs/test/bin/bioconda-utils", line 8, in <module>
2020-02-20T17:50:43.4044185Z     sys.exit(main())
2020-02-20T17:50:43.4044562Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 947, in main
2020-02-20T17:50:43.4044683Z     bioconductor_skeleton, clean_cran_skeleton, autobump, bot
2020-02-20T17:50:43.4045114Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/argh/dispatching.py", line 328, in dispatch_commands
2020-02-20T17:50:43.4045223Z     dispatch(parser, *args, **kwargs)
2020-02-20T17:50:43.4045590Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/argh/dispatching.py", line 174, in dispatch
2020-02-20T17:50:43.4045709Z     for line in lines:
2020-02-20T17:50:43.4046078Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/argh/dispatching.py", line 277, in _execute_command
2020-02-20T17:50:43.4046191Z     for line in result:
2020-02-20T17:50:43.4046646Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/argh/dispatching.py", line 260, in _call
2020-02-20T17:50:43.4046755Z     result = function(*positional, **keywords)
2020-02-20T17:50:43.4047050Z   File "<boltons.funcutils.FunctionBuilder-3>", line 8, in do_lint
2020-02-20T17:50:43.4047495Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 130, in wrapper
2020-02-20T17:50:43.4047580Z     func(*args, **kwargs)
2020-02-20T17:50:43.4048090Z   File "<boltons.funcutils.FunctionBuilder-2>", line 8, in do_lint
2020-02-20T17:50:43.4048468Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 59, in wrapper
2020-02-20T17:50:43.4048687Z     func(*args, **kwargs)
2020-02-20T17:50:43.4048971Z   File "<boltons.funcutils.FunctionBuilder-1>", line 8, in do_lint
2020-02-20T17:50:43.4049295Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 71, in wrapper
2020-02-20T17:50:43.4049394Z     func(*args, **kwargs)
2020-02-20T17:50:43.4049708Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 345, in do_lint
2020-02-20T17:50:43.4049795Z     recipes = get_recipes(config, recipe_folder, packages, git_range)
2020-02-20T17:50:43.4050124Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 168, in get_recipes
2020-02-20T17:50:43.4050231Z     changed_recipes = get_recipes_to_build(git_range, recipe_folder)
2020-02-20T17:50:43.4050574Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/cli.py", line 152, in get_recipes_to_build
2020-02-20T17:50:43.4050684Z     return repo.get_recipes_to_build(ref, other)
2020-02-20T17:50:43.4051013Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/githandler.py", line 491, in get_recipes_to_build
2020-02-20T17:50:43.4051118Z     tobuild = set(self.get_changed_recipes(ref, other))
2020-02-20T17:50:43.4051458Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/githandler.py", line 433, in get_changed_recipes
2020-02-20T17:50:43.4051564Z     for path in self.list_changed_files(ref, other):
2020-02-20T17:50:43.4051885Z   File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/bioconda_utils/githandler.py", line 329, in list_changed_files
2020-02-20T17:50:43.4051990Z     for diffobj in merge_base.diff(ref):
2020-02-20T17:50:43.4052260Z AttributeError: 'NoneType' object has no attribute 'diff'
2020-02-20T17:50:43.5213914Z ##[error]Process completed with exit code 1.
@mbargull
Copy link

Ah, I vaguely remember something like this. Maybe try to git fetch origin master and use FETCH_HEAD instead of origin/master? Or, if that does not work, git fetch origin master:some_random_name and use some_random_name then.

@grst
Copy link
Owner Author

grst commented Feb 20, 2020

Hmm, neither of the following seems to work :/
Same error message as before.

git fetch origin master:latest_master && bioconda-utils lint tools config.yml --exclude missing_hash missing_tests --git-range latest_master HEAD
git fetch origin master && bioconda-utils lint tools config.yml --exclude missing_hash missing_tests --git-range FETCH_HEAD HEAD

@mbargull
Copy link

Oh, sorry, I didn't look at the context of what you were doing overall.
You are using actions/checkout@v2 which does a shallow checkout by default. Because of that, the history to determine the merge base is not there.
You'd want to set the fetch-depth parameter to some reasonable value (0 fetches everything).

@mbargull
Copy link

Maybe origin/master will work directly then, too.

@grst
Copy link
Owner Author

grst commented Feb 20, 2020

This did indeed do the trick :)
Thanks a lot for your help!

@grst grst closed this as completed Feb 20, 2020
grst pushed a commit that referenced this issue Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants