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

Default CLI mode to -webSocket #7605

Merged
merged 4 commits into from Feb 14, 2023
Merged

Conversation

jglick
Copy link
Member

@jglick jglick commented Jan 25, 2023

#4369 introduced -webSocket transport, which was at the time considered experimental and so the default remained -http. Since then, as far as I know it has been stable (at least after #5455), so it seems appropriate to make it the default now rather than -http which relies on a hack (FullDuplexHttpService) to keep two HTTP connections open. Since both modes accept the same authentication option—namely, an API token—the change ought to be transparent for most users.

Testing done

Ran with various transport options, or none, plus -logger FINE to confirm the mode being used.

Proposed changelog entries

  • The default connection mode for the Java CLI client is now -webSocket. You can specify -http to continue to use the former default (for example because you are running Jenkins in a servlet container other than the recommended built-in Jetty, or because you are running an unusual reverse proxy which does not support WebSocket). You can also continue to specify -ssh to use SSH transport (for example because you prefer to authenticate with a private key rather than an API token), or use a native SSH client.

Proposed upgrade guidelines

If you use the Jenkins CLI but cannot make WebSocket connections to the Jenkins controller, you will now need to pass the -http or -ssh option if you were not already doing so.

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@@ -124,7 +124,6 @@ public static int _main(String[] _args) throws Exception {

boolean noKeyAuth = false;

// TODO perhaps allow mode to be defined by environment variable too (assuming $JENKINS_USER_ID can be used for -user)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4369 (comment)

If anything we could introduce something like

export JENKINS_CLI_OPTS="-http -s https://jenkins/ -auth admin:$(cat token)"

@NotMyFault NotMyFault added rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted upgrade-guide-needed This changes might be breaking in rare circumstances, an entry in the LTS upgrade guide is needed labels Jan 29, 2023
@NotMyFault NotMyFault requested a review from a team February 9, 2023 11:25
@NotMyFault
Copy link
Member

/label ready-for-merge


This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Feb 10, 2023
@NotMyFault NotMyFault merged commit 3ca2880 into jenkinsci:master Feb 14, 2023
@jglick jglick deleted the websocket-cli branch February 14, 2023 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted upgrade-guide-needed This changes might be breaking in rare circumstances, an entry in the LTS upgrade guide is needed
Projects
None yet
3 participants