iterative / gto

🏷️ Git Tag Ops. Turn your Git repository into Artifact Registry or Model Registry.
https://dvc.org/doc/gto
Apache License 2.0
140 stars 16 forks source link

`show` versions registered in specified git ref #335

Closed aguschin closed 1 year ago

aguschin commented 1 year ago

close https://github.com/iterative/gto/issues/312

Implements https://github.com/iterative/gto/issues/312#issuecomment-1378293368:

$ git clone https://github.com/iterative/example-gto
$ cd example-gto
$ gto show
╒══════════╤══════════╤════════╤═════════╤════════════╕
│ name     │ latest   │ #dev   │ #prod   │ #staging   │
╞══════════╪══════════╪════════╪═════════╪════════════╡
│ churn    │ v3.1.1   │ v3.1.1 │ v3.0.0  │ v3.1.0     │
│ cv-class │ v0.1.13  │ -      │ -       │ -          │
│ segment  │ v0.4.1   │ v0.4.1 │ -       │ -          │
╘══════════╧══════════╧════════╧═════════╧════════════╛
$ gto show nn:HEAD  # show versions for nn in HEAD
╒════════════╤═══════════╤═════════╤═════════════════════╤══════════════╕
│ artifact   │ version   │ stage   │ created_at          │ ref          │
╞════════════╪═══════════╪═════════╪═════════════════════╪══════════════╡
│ churn      │ v3.1.0    │ staging │ 2022-11-20 09:36:38 │ churn@v3.1.0 │
╘════════════╧═══════════╧═════════╧═════════════════════╧══════════════╛
$ gto show nn:HEAD --ref
churn@v3.1.0
$ gto show :HEAD  # show all artifacts that have versions/assignments in HEAD
╒════════════╤═══════════╤═════════╤═════════════════════╤══════════════╕
│ artifact   │ version   │ stage   │ created_at          │ ref          │
╞════════════╪═══════════╪═════════╪═════════════════════╪══════════════╡
│ churn      │ v3.1.0    │ staging │ 2022-11-20 09:36:38 │ churn@v3.1.0 │
╘════════════╧═══════════╧═════════╧═════════════════════╧══════════════╛
$ gto show @v3.1.0  # show all v3.1.0 versions for all artifacts
╒════════════╤═══════════╤═════════╤═════════════════════╤══════════════╕
│ artifact   │ version   │ stage   │ created_at          │ ref          │
╞════════════╪═══════════╪═════════╪═════════════════════╪══════════════╡
│ churn      │ v3.1.0    │ staging │ 2022-11-20 09:36:38 │ churn@v3.1.0 │
╘════════════╧═══════════╧═════════╧═════════════════════╧══════════════╛
$ gto show "#staging"  # show all versions in staging for all artifacts
╒════════════╤═══════════╤═════════╤═════════════════════╤══════════════╕
│ artifact   │ version   │ stage   │ created_at          │ ref          │
╞════════════╪═══════════╪═════════╪═════════════════════╪══════════════╡
│ churn      │ v3.1.0    │ staging │ 2022-11-20 09:36:38 │ churn@v3.1.0 │
╘════════════╧═══════════╧═════════╧═════════════════════╧══════════════╛
$ gto show --long  # alternative way to show the registry
╒════════════╤═══════════╤═════════╤═════════════════════╤══════════════╕
│ artifact   │ version   │ stage   │ created_at          │ ref          │
╞════════════╪═══════════╪═════════╪═════════════════════╪══════════════╡
│ churn      │ v3.1.1    │ dev     │ 2022-11-27 08:16:38 │ churn@v3.1.1 │
│ churn      │ v3.1.0    │ staging │ 2022-11-20 09:36:38 │ churn@v3.1.0 │
│ churn      │ v3.0.0    │ prod    │ 2022-11-15 18:29:58 │ churn@v3.0.0 │
│ cv-class   │ v0.1.13   │         │ 2022-11-18 02:03:18 │ cv-class@v0.1.13 │
│ cv-class   │ 793ff78   │         │ 2022-11-19 05:49:58 │ 793ff78          │
│ segment    │ v0.4.1    │ dev     │ 2022-11-16 22:16:38 │ segment@v0.4.1 │
│ segment    │ 793ff78   │         │ 2022-11-19 05:49:58 │ 793ff78        │
╘════════════╧═══════════╧═════════╧═════════════════════╧════════════════╛
aguschin commented 1 year ago

TODO:

aguschin commented 1 year ago

@bgalvao, Hi! Started implementing this, but couldn't finish in one go. I'll have a vacation this week, will get back to it on the next one!

bgalvao commented 1 year ago

@aguschin fair enough. Enjoy vacation!