_stream.py: Ability to pull missing buildtrees outside of pull/build
Description
#494 has criteria which expects the buildstream scheduler to be able, as an example, to attempt to pull a missing artifact buildtree dir if the given content/config in which the bst push was initiated would allow it.
!786 (merged) Added the default behaviour of not downloading (with the ability to override) artifact buildtrees by default when directly spawning element pull jobs (element.py to artifactcache.py) via stream.py's construction of scheduler pull queues. As it stands the only two bst commands that utilise said pull queues are bst pull and build. These queues also provide the functionality to download the missing buildtree into an existing build artifact.
Other commands should be able to use the scheduler to create pullqueues for the missing builtree artifacts, when the given logic determines that the commands behaviour will be attempting to use/require a buildtree.
Changes proposed in this merge request:
- Add helper function _buildtree_pull_required() to ascertain what elements/element will require a buildtree artifact to be present given the current config and semantics
- Utilise this is bst push, also to be added to bst shell --build once #740 (closed) is available.
- Add to the pullbuildtrees integration test to assert the push behaviour
This merge request, when approved, will close: #774 (closed)