apache / apache/buildstream

Support multiple elements in checkout and source-checkout

Open
#771 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
140
Forks
45
Avg merge
1d 3h
Merged PRs (30d)
6

Description

[See original issue on GitLab](https://gitlab.com/BuildStream/buildstream/-/issues/771)
In GitLab by [[Gitlab user @cs-shadow]](https://gitlab.com/cs-shadow) on Nov 19, 2018, 16:05

## Background

As pointed out in https://gitlab.com/BuildStream/buildstream/merge_requests/820#note_111756025, it might make sense to support multiple elements in the newly added `source-chechout` command. Similarly, it would also make sense to support multiple elements in the `checkout` command as well.

### Possible solutions

The current format for both these commands is `bst COMMAND ELEMENT DIRECTORY`. Depending on how we choose to do it, it may or may not be an API break. I am sure there are other options, but I can see the following two options at present:

1. `bst COMMAND ELEMENT [ELEMENT..] --dir DIRECTORY`
1. `bst COMMAND ELEMENT DIRECTORY [-e ELEMENT DIRECTORY...]`

The first option will be similar to how `workspace open` will soon handle multiple elements, see !897. But, for it to work properly, we may first need to add an option for configuring default location for checking out elements. Alternatively, we can support `--directory` for multiple elements by creating directories named after each element and checking it out under that subdirectory. (This is similar to how `source-checkout` currently handles dependencies.

EDIT: The consensus seems to be in favor of this option.

~~The second option option avoids breaking the API but is more clunky IMO. That said, it is similar to how multiple elements are planned to be handled in `bst shell`, see !909.~~

## Task description

[//]: # (Short summary of the action to be executed)

* [ ] Support multiple elements in `bst checkout`/`bst artifact checkout`
* [ ] Support multiple elements in `bst source checkout`

## Acceptance Criteria

It is possible to checkout multiple elements (or sources in case of `source-checkout`) using a single `bst` invocation.

## Update

The `--directory` options are now part of the `bst source checkout` and `bst artifact checkout` commands already.

This is to be handled by simply allowing multiple elements to be specified in `bst source checkout` and `bst artifact checkout`, and much like with issue #422, will not cause CLI api breakage by doing so.

As such we will not be considering this as blocker for the 2.0 milestone.

Contributor guide

Open the contributing guide

Research direction

Read the implementations of `bst artifact checkout` and `bst source checkout`, including their argument parsing and existing `--directory` handling. Verify how multiple elements or sources should be mapped to checkout locations, then exercise both commands with more than one element to confirm the acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.