Skip to content

WIP: Deprecate `bst checkout` for `bst artifact checkout`

James Ennis requested to merge jennis/deprecate_bst_checkout into master

Important note: This MR is on hold until we restructure how we currently deal with artifact refs.

Description

This MR aims to deprecate bst checkout and replace it with the new command bst artifact checkout. The following should be noted:

  • Most of the work here exists in !1008 (closed). This MR aims to split out the introduction of bst artifact checkout from !1008 (closed) and ensure that it is properly deprecated (deprecation has been added).
  • This MR is related to !1045 (merged), which is an MR to deprecate push/pull. Together, they should close #822 (closed).
  • Once this MR and !1045 (merged) have landed, it will be easier to concentrate on introducing the new artifact sub-commands introduced by !1008 (closed).

Acceptance Criteria

  1. Introduce new bst artifact checkout command that can handle artifact refs and element names
  2. Deprecate bst checkout
  3. Ensure that the test suite passes (for all element checkout's).
  4. Write tests for checking out artifacts.

Behaviour changes

As the name suggests, artifacts that exist within the artifact sub-command group should be able to deal with specific artifacts, not just the artifact of the element which corresponds to the project's state (as is the case now).

Thus, this MR allows for bst artifact checkout to take two types of argument(s), element names (e.g. 'hello.bst') and artifact refs (e.g. 'autotools/hello/$KEY') - as stored in the CAS cache.

It should be noted that the new bst artifact checkout command will not support all the options of bst checkout for artifact ref name arguments, but can still be used as a replacement for bst checkout when passed element names.

I.e. When we specify an element name, this still checks out the project state artifact of the specified element along with its runtime deps (by default). The only difference is that we must now specify the LOCATION with the --directory option (whereas, previously, it was a positional argument).

It is also important to note that:

  • --deps is not allowed when specifying an artifact ref, as our artifacts do not contain the necessary metadata to determine the correct dependency artifacts.
  • We can checkout multiple artifacts to a directory.
    • E.g. bst artifact checkout --directory here autotools/hello/$KEY autotools/base-alpine/$KEY

This MR will partially solve #822 (closed). This MR will partially solve #773 (closed)

Edited by James Ennis

Merge request reports