Skip to content

Commit 4d863eb

Browse files
author
Sergio Schvezov
authored
cli: remove spaces from progressive metrics (#3335)
This allows for easier column parsing. Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
1 parent 71eabdc commit 4d863eb

4 files changed

Lines changed: 15 additions & 13 deletions

File tree

snapcraft/cli/_channel_map.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,13 @@ def _get_channel_lines_for_channel( # noqa: C901
144144
revision=progressive_revision,
145145
channel_info=channel_info,
146146
hint=current_tick,
147-
progress_string=f"{current_percentage_fmt} {_HINTS.PROGRESSING_TO} {percentage:.0f}%",
147+
progress_string=f"{current_percentage_fmt}{_HINTS.PROGRESSING_TO}{percentage:.0f}%",
148148
)
149149
# Setup progress for the actually released revision, this needs to be
150150
# calculated. But only show it if the channel is open.
151-
progress_string = f"{remaining_percentage_fmt} {_HINTS.PROGRESSING_TO} {100 - percentage:.0f}%"
151+
progress_string = (
152+
f"{remaining_percentage_fmt}{_HINTS.PROGRESSING_TO}{100 - percentage:.0f}%"
153+
)
152154
else:
153155
progress_string = _HINTS.NO_PROGRESS
154156

specifications/progressive-releases.org

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ $ snapcraft status candycane
4343
Track Arch Channel Version Revision Progress
4444
latest all stable - - -
4545
candidate - - -
46-
beta 0.6 8 2320%
47-
10 13 7180%
46+
beta 0.6 8 2320%
47+
10 13 7180%
4848
edge ↑ ↑ -
4949
#+END_SRC
5050

@@ -57,8 +57,8 @@ Track Arch Channel Version Revision Progress
5757
latest all stable - - -
5858
candidate - - -
5959
beta 10 13 -
60-
edge ↑ ↑ 5540%
61-
11 15 4460%
60+
edge ↑ ↑ 5540%
61+
11 15 4460%
6262
#+END_SRC
6363

6464
** Executing a Release

tests/unit/commands/test_release.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_progressive_release(self):
9191
2.1 amd64 stable - - -
9292
candidate - - -
9393
beta - - -
94-
10 19 510%
94+
10 19 510%
9595
edge ↑ ↑ -
9696
The '2.1/beta' channel is now open.
9797
"""
@@ -209,7 +209,7 @@ def test_progressive_release_with_branch(self):
209209
*EXPERIMENTAL* progressive releases in use.
210210
Track Arch Channel Version Revision Progress Expires at
211211
2.1 amd64 stable - - -
212-
stable/hotfix1 10hotfix 20 ?80% 2020-02-03T20:58:37Z
212+
stable/hotfix1 10hotfix 20 ?80% 2020-02-03T20:58:37Z
213213
candidate - - -
214214
beta 10 19 -
215215
edge ↑ ↑ -
@@ -251,7 +251,7 @@ def test_progressive_release_with_null_current_percentage(self):
251251
2.1 amd64 stable - - -
252252
candidate - - -
253253
beta - - -
254-
10 19 ?10%
254+
10 19 ?10%
255255
edge ↑ ↑ -
256256
The '2.1/beta' channel is now open.
257257
"""

tests/unit/commands/test_status.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def test_progressive_status(self):
141141
Track Arch Channel Version Revision Progress
142142
2.1 amd64 stable - - -
143143
candidate - - -
144-
beta 10 19 9390%
145-
11 20 710%
144+
beta 10 19 9390%
145+
11 20 710%
146146
edge ↑ ↑ -
147147
"""
148148
)
@@ -265,7 +265,7 @@ def test_progressive_status_including_branch(self):
265265
*EXPERIMENTAL* progressive releases in use.
266266
Track Arch Channel Version Revision Progress Expires at
267267
2.1 amd64 stable - - -
268-
stable/hotfix1 10hotfix 20 1220% 2020-02-03T20:58:37Z
268+
stable/hotfix1 10hotfix 20 1220% 2020-02-03T20:58:37Z
269269
candidate - - -
270270
beta 10 19 -
271271
edge ↑ ↑ -
@@ -293,7 +293,7 @@ def test_progressive_status_with_null_current_percentage(self):
293293
2.1 amd64 stable - - -
294294
candidate - - -
295295
beta - - -
296-
10 19 ?10%
296+
10 19 ?10%
297297
edge ↑ ↑ -
298298
"""
299299
)

0 commit comments

Comments
 (0)