Skip to content

bst-artifact-receive: CLI should not throw stacktrackes when repo argument is invalid

Summary

The CLI for bst-artifact-receive expects a repo argument, which is supposed to be a directory, but Click currently expects it to be just any string. This results in stack traces like the one below when the argument provided is not a directory:

$ ~/.local/bin/bst-artifact-receive --pull-url http://foo foobaz
Traceback (most recent call last):
  File "/root/.local/bin/bst-artifact-receive", line 8, in <module>
    sys.exit(receive_main())
  ...
  File "/src/buildstream/buildstream/_artifactcache/pushreceive.py", line 581, in __init__
    self.repo.open(None)
GLib.Error: g-io-error-quark: /src/buildstream/43fref: opendir(/src/buildstream/foobaz): No such file or directory (1)

Steps to reproduce

bst-artifact-receive --pull-url http://foo non-existent-directory

What is the current bug behavior?

Ugly stack trace.

What is the expected correct behavior?

More helpful error message.

Relevant logs and/or screenshots

Possible fixes

Other relevant information

  • BuildStream version affected: /milestone %"BuildStream_v1.1"

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information