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

[JENKINS-72343] Accept all 2xx and 3xx status codes to validate proxy in HTTP Proxy Configuration #8700

Merged

Conversation

lemeurherve
Copy link
Member

@lemeurherve lemeurherve commented Nov 18, 2023

The "Validate Proxy" button in "Manage > Plugins > Advanced settings > HTTP Proxy Configuration" currently accepts only HTTP_OK (200) as valid:

if (httpResponse.statusCode() == HttpURLConnection.HTTP_OK) {
return FormValidation.ok(Messages.ProxyConfiguration_Success());

image

This small PR allows accepting all status code below HTTP_BAD_REQUEST (400) as valid responses and add the status code in the response to the user:

image

See JENKINS-72343.

Testing done

Checked that it works by running Jenkins locally with mvn -pl war jetty:run.
Ran a build with tests locally with mvn -am -pl war,bom clean install.
There is no test for this client side functionality, I don't think one should be added.

Proposed changelog entries

  • JENKINS-72343, Accept all 2xx and 3xx status codes to validate proxy in HTTP Proxy Configuration

(Not sure it worth being mentioned in changelog)

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

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

Maintainer checklist

@lemeurherve lemeurherve changed the title Accept all 2xx and 3xx status codes to validate proxy in HTTP Proxy Configuration [JENKINS-72343] Accept all 2xx and 3xx status codes to validate proxy in HTTP Proxy Configuration Nov 18, 2023
@NotMyFault NotMyFault added the rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Nov 20, 2023
@NotMyFault NotMyFault requested a review from a team November 20, 2023 18:05
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

seems reasonable, could maybe add the status code now given it's accepting more than 200?

@lemeurherve
Copy link
Member Author

Added the status code in the response to the user:
image

@timja timja requested a review from a team November 23, 2023 16:11
Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

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

Thanks!


/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 Dec 4, 2023
@NotMyFault NotMyFault merged commit b8344b9 into jenkinsci:master Dec 5, 2023
17 checks passed
@lemeurherve lemeurherve deleted the validate-proxy-accept-2xx-3xx branch December 7, 2023 23:14
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants