jenkins-x-plugins / jx-gitops

a simple CLI tool for working with kubernetes resources files in a GitOps repository
Apache License 2.0
33 stars 50 forks source link

PR output goes to stderr #275

Open jobcespedes opened 3 years ago

jobcespedes commented 3 years ago

Hi,

version: 0.0.380

The output of jx gitops pr get is going to stderr. Shouldn't it be to stdout?

jstrachan commented 3 years ago

is the output an actual error? looks like its using info logging to stdout for valid input: https://github.com/jenkins-x/jx-gitops/blob/daf6dc4e88b0b9c15d5312b464c42c3aaf67c741/pkg/cmd/pr/get/get.go#L85

jobcespedes commented 3 years ago

I see no error in the output

Steps

  1. Save stdout to file
    jx gitops pr get --pr 1 > /tmp/stdout
    # output goes to screen and not to "/tmp/stdout"
    # "/tmp/stdout" is empty
  2. Save stderr to file
    jx gitops pr get --pr 1 2> /tmp/stderr
    # output goes to "/tmp/stderr" and no output in the screen

    head /tmp/stderr shows:

    about to run: git rev-parse --abbrev-ref HEAD in dir .
    develop
    Assignees:
    - Avatar: https://avatars2.githubusercontent.com/u/1559433?v=4
    Created: "0001-01-01T00:00:00Z"
    Email: ""
    ID: 1559433
    Link: https://github.com/jobcespedes
    Login: jobcespedes
    Name: ""
jobcespedes commented 3 years ago

One more thing to add, it happens also with:

It looks like something related to jx-cli, maybe? This is version: 3.0.626

jenkins-x-bot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle stale

jenkins-x-bot commented 3 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle rotten