Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sort by Timestamp default, add option to choose sort #244

Merged
merged 6 commits into from
Sep 5, 2022

Conversation

aguschin
Copy link
Contributor

@aguschin aguschin commented Sep 1, 2022

close #132

Done

Added --sort option to show (Order assignments by timestamp or semver [default: timestamp])

$ gto show --sort timestamp
$ gto show --sort semver
$ gto show bug
╒════════════╤═══════════╤═════════╤═════════════════════╤════════════╕
│ artifact   │ version   │ stage   │ created_at          │ ref        │
╞════════════╪═══════════╪═════════╪═════════════════════╪════════════╡
│ bug        │ v0.0.3    │ dev     │ 2022-07-25 18:03:34 │ bug@v0.0.3 │
│ bug        │ v0.0.2    │ prod    │ 2022-07-04 15:27:12 │ bug@v0.0.2 │
│ bug        │ v0.0.1    │         │ 2022-07-04 15:27:05 │ bug@v0.0.1 │
╘════════════╧═══════════╧═════════╧═════════════════════╧════════════╛
$ gto show bug@greatest
╒════════════╤═══════════╤═════════╤═════════════════════╤════════════╕
│ artifact   │ version   │ stage   │ created_at          │ ref        │
╞════════════╪═══════════╪═════════╪═════════════════════╪════════════╡
│ bug        │ v0.0.3    │ dev     │ 2022-07-25 18:03:34 │ bug@v0.0.3 │
╘════════════╧═══════════╧═════════╧═════════════════════╧════════════╛
$ gto show bug#prod
╒════════════╤═══════════╤═════════╤═════════════════════╤════════════╕
│ artifact   │ version   │ stage   │ created_at          │ ref        │
╞════════════╪═══════════╪═════════╪═════════════════════╪════════════╡
│ bug        │ v0.0.2    │ prod    │ 2022-07-04 15:27:12 │ bug@v0.0.2 │
╘════════════╧═══════════╧═════════╧═════════════════════╧════════════╛
$ gto show bug#prod --name
v0.0.2

Side note

  • $ gto show model#dev is equivalent of $ gto latest model dev,
  • the same is true for $ gto show model#dev --sort semver and $ gto greatest model dev.

To keep CLI experience more simple and consize I deprecated $ gto latest and $ gto which and didn't introduce $ gto greatest.

@aguschin aguschin self-assigned this Sep 1, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2022

Codecov Report

Base: 80.91% // Head: 81.48% // Increases project coverage by +0.57% 🎉

Coverage data is based on head (552098c) compared to base (691ca4b).
Patch coverage: 91.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #244      +/-   ##
==========================================
+ Coverage   80.91%   81.48%   +0.57%     
==========================================
  Files          16       16              
  Lines        1886     1896      +10     
==========================================
+ Hits         1526     1545      +19     
+ Misses        360      351       -9     
Impacted Files Coverage Δ
gto/config.py 95.78% <ø> (ø)
gto/cli.py 69.43% <85.71%> (-0.13%) ⬇️
gto/api.py 90.90% <100.00%> (+12.64%) ⬆️
gto/base.py 85.71% <100.00%> (+0.32%) ⬆️
gto/constants.py 100.00% <100.00%> (ø)
gto/_version.py 36.36% <0.00%> (-45.46%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@aguschin aguschin merged commit 4576fa0 into main Sep 5, 2022
@aguschin aguschin deleted the feature/latest-and-greatest branch September 5, 2022 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest: by SemVer or by timestamp?
2 participants