`artifact checkout` crashes when no arguments are supplied
Summary
When bst artifact checkout
is run without any arguments, it just throws a stack trace (rather embarrisingly).
Steps to reproduce
# From the root of this repository
$ cd doc/examples/first-project
$ bst artifact checkout
Traceback (most recent call last):
File "/home/kote/.venvs/bst/bin/bst", line 8, in <module>
sys.exit(cli())
File "/home/kote/.venvs/bst/lib64/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/kote/buildstream/buildstream/src/buildstream/_frontend/cli.py", line 238, in override_main
original_main(self, args=args, prog_name=prog_name, complete_var=None, standalone_mode=standalone_mode, **extra)
File "/home/kote/.venvs/bst/lib64/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/kote/.venvs/bst/lib64/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/kote/.venvs/bst/lib64/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/kote/.venvs/bst/lib64/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/kote/.venvs/bst/lib64/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/kote/.venvs/bst/lib64/python3.7/site-packages/click/decorators.py", line 27, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "/home/kote/buildstream/buildstream/src/buildstream/_frontend/cli.py", line 1239, in artifact_checkout
location = os.path.abspath(os.path.join(os.getcwd(), target))
File "/usr/lib64/python3.7/posixpath.py", line 94, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib64/python3.7/genericpath.py", line 149, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'
What is the current bug behavior?
A stack trace is shown.
What is the expected correct behavior?
BuildStream can either do nothing (similar to what happens when you do bst artifact delete
with no arguments) or an error is displayed that at least one element/artifact must be specified. I'd be leaning towards the latter option since that's symmetrical to what happens when you don't provide any options to bst source checkout
.