-
Notifications
You must be signed in to change notification settings - Fork 202
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
Support output format for list option #448
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, can you check the test failure please?
How does this fix #227? |
With this changeset the following command can be used to generate a plugin file with the current set of effective plugins.
not sure if there is more to #227 that I'm missing or not aware of. |
ddd7b54
to
f86feb9
Compare
That issue is about generating a plugin list from an existing Jenkins home. Currently the CLI doesn't know anything about the Jenkins home only the war file, so if I run e.g. this:
I get:
|
While this PR looks great I don't think it fixes any of the linked issues. It does fix an issue where in edge cases something gets printed to stdout and breaks the file. e.g. a recent issue that fixed the single case: |
@timja this pull request works in at least one of the use cases that I believe was previously missing from the tool. I have a directory that contains plugin files but don't have a Example use case looks like this: $ git clone -b lts-with-plugins https://github.com/MarkEWaite/docker-lfs.git
$ cd docker-lfs/ref
$ wget https://home.markwaite.net/~mwaite/jenkins-plugin-manager-2.12.7-pre.jar
$ java -jar jenkins-plugin-manager-2.12.7-pre.jar -d plugins --jenkins-version 2.332.3 --list > plugins.txt
$ cat plugins.txt I thought that was the use case described by #227, but may have missed something in my understanding |
Oh cool! That worked, checking again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be documented in the README, especially that you need to redirect stderr to dev null
Is it worth adding an option to suppress stderr except on error? quiet? Can file as a separate issue.
Sorting the result would be great too (also could be a separate pull request)
Direct cli user messages to standard error rather than standard out. Standard out is reserved for primary output, which in cases like `--list --output yaml` would be the yaml formatted plugin list. This separation of output is consistent with general cli guidelines, https://clig.dev/#the-basics. Fixes: jenkinsci#377 jenkinsci#284 jenkinsci#227
f86feb9
to
d95423e
Compare
jenkinsci/plugin-installation-manager-tool#448 introduced a clean separation of output on stdout and messaged on stderr We will ignore the messages on stderr (they will be visible in the log) and only use stdout to store in plugins.txt and subsequently install.
jenkinsci/plugin-installation-manager-tool#448 introduced a clean separation of output on stdout and messages on stderr We will ignore the messages on stderr (they will be visible in the log) and use stdout to store in plugins.yaml and subsequently install. switching to plugins.yaml replacing plugins.txt
Direct cli user messages to standard error rather than standard out. Standard out
is reserved for primary output, which in cases like
--list --output yaml
wouldbe the yaml formatted plugin list. This separation of output is consistent with
general cli guidelines, https://clig.dev/#the-basics.
Fixes: #377
Fixes #284
Fixes #227