New version announcement mixed up with regular command output
Checklist
-
I'm using the latest version of the extension (Run glab --version
)- Extension version: 1.25.0 - it does not make sense to use the latest version - read below
-
Operating System and version: Gentoo Linux (it has no version - just rolling release distro)
Summary
When new glab
version is released, then an announcement for the new version is added to regular glab
command output.
When the output is json string, then this announcement breaks the json syntax and the output cannot be parsed.
That's the reason why I cannot reproduce this issue on the latest glab version - the latest version will "fix" the issue, but only till newer version is released.
Steps to reproduce
Use some older (not the latest one) version of glab.
glab api projects/34675721/repository/commits/78f29f4486a596ff0b6940c152c7d591d9135ab1 |cat
What is the current bug behavior?
The json response followed by new version announcement is displayed:
{"id":"78f29f4486a596ff0b6940c152c7d591d9135ab1","short_id":"78f29f44","created_at":"2023-02-07T15:18:24.000+00:00","parent_ids":["f06dbb6eb22739f31e88aed727b8ed63d4f6b85a","175b5cfc6229d3520e90e098d40aa025610230a6"],"title":"Merge branch '1209-extract-issuable-view-package' into 'main'","message":"Merge branch '1209-extract-issuable-view-package' into 'main'\n\nrefactor(issue/view): extract issuable/view package\n\nSee merge request https://gitlab.com/gitlab-org/cli/-/merge_requests/1163\n\nMerged-by: Tomas Vik \u003ctvik@gitlab.com\u003e\nApproved-by: Halil Coban \u003chcoban@gitlab.com\u003e\nReviewed-by: Tomas Vik \u003ctvik@gitlab.com\u003e\nCo-authored-by: Vitali Tatarintev \u003cvtatarintev@gitlab.com\u003e","author_name":"Tomas Vik","author_email":"tvik@gitlab.com","authored_date":"2023-02-07T15:18:24.000+00:00","committer_name":"Tomas Vik","committer_email":"tvik@gitlab.com","committed_date":"2023-02-07T15:18:24.000+00:00","trailers":{},"web_url":"https://gitlab.com/gitlab-org/cli/-/commit/78f29f4486a596ff0b6940c152c7d591d9135ab1","stats":{"additions":520,"deletions":677,"total":1197},"status":"running","project_id":34675721,"last_pipeline":{"id":770071108,"iid":933,"project_id":34675721,"sha":"78f29f4486a596ff0b6940c152c7d591d9135ab1","ref":"main","status":"running","source":"push","created_at":"2023-02-07T15:18:26.685Z","updated_at":"2023-02-07T15:18:27.662Z","web_url":"https://gitlab.com/gitlab-org/cli/-/pipelines/770071108"}}A new version of glab has been released: 1.25.0 → v1.25.3
https://gitlab.com/gitlab-org/cli/-/releases/v1.25.3
What is the expected correct behavior?
New version announcement should not be appended, when the output contains valid json OR announcement should be printed to STDERR so we can easily split the expected output (json) and unwanted output (new version announcement):
glab api projects/34675721/repository/commits/78f29f4486a596ff0b6940c152c7d591d9135ab1 2>/dev/null |cat
Relevant logs and/or screenshots
$ glab api projects/34675721/repository/commits/78f29f4486a596ff0b6940c152c7d591d9135ab1 2>/dev/null |cat
{"id":"78f29f4486a596ff0b6940c152c7d591d9135ab1","short_id":"78f29f44","created_at":"2023-02-07T15:18:24.000+00:00","parent_ids":["f06dbb6eb22739f31e88aed727b8ed63d4f6b85a","175b5cfc6229d3520e90e098d40aa025610230a6"],"title":"Merge branch '1209-extract-issuable-view-package' into 'main'","message":"Merge branch '1209-extract-issuable-view-package' into 'main'\n\nrefactor(issue/view): extract issuable/view package\n\nSee merge request https://gitlab.com/gitlab-org/cli/-/merge_requests/1163\n\nMerged-by: Tomas Vik \u003ctvik@gitlab.com\u003e\nApproved-by: Halil Coban \u003chcoban@gitlab.com\u003e\nReviewed-by: Tomas Vik \u003ctvik@gitlab.com\u003e\nCo-authored-by: Vitali Tatarintev \u003cvtatarintev@gitlab.com\u003e","author_name":"Tomas Vik","author_email":"tvik@gitlab.com","authored_date":"2023-02-07T15:18:24.000+00:00","committer_name":"Tomas Vik","committer_email":"tvik@gitlab.com","committed_date":"2023-02-07T15:18:24.000+00:00","trailers":{},"web_url":"https://gitlab.com/gitlab-org/cli/-/commit/78f29f4486a596ff0b6940c152c7d591d9135ab1","stats":{"additions":520,"deletions":677,"total":1197},"status":"running","project_id":34675721,"last_pipeline":{"id":770071108,"iid":933,"project_id":34675721,"sha":"78f29f4486a596ff0b6940c152c7d591d9135ab1","ref":"main","status":"running","source":"push","created_at":"2023-02-07T15:18:26.685Z","updated_at":"2023-02-07T15:18:27.662Z","web_url":"https://gitlab.com/gitlab-org/cli/-/pipelines/770071108"}}A new version of glab has been released: 1.25.0 → v1.25.3
https://gitlab.com/gitlab-org/cli/-/releases/v1.25.3
$