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

Move proxy configuration form out of pluginManager screens as it is not related #8693

Merged

Conversation

olamy
Copy link
Member

@olamy olamy commented Nov 15, 2023

Signed-off-by: Olivier Lamy [email protected]

See JENKINS-72326.

Testing done

Proposed changelog entries

  • Move the proxy configuration form to its own screen.

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

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

Maintainer checklist

@olamy olamy added the web-ui The PR includes WebUI changes which may need special expertise label Nov 15, 2023
@olamy olamy requested review from jtnord, timja and MarkEWaite November 15, 2023 02:40
@olamy olamy added the into-lts This PR is filed against an LTS branch label Nov 15, 2023
Copy link
Member

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

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

While it's a good idea to move the proxy configuration out of the plugin manager, what motivates it getting its own top-level ManagementLink? I would not expect that to be relevant regularly enough to justify the space it'll take up. Why not make it just another option in Configure System?

core/src/main/java/hudson/ProxyConfigurationManager.java Outdated Show resolved Hide resolved
core/src/main/java/hudson/ProxyConfigurationManager.java Outdated Show resolved Hide resolved
@NotMyFault NotMyFault added rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted and removed into-lts This PR is filed against an LTS branch labels Nov 15, 2023
@POST
public HttpResponse doProxyConfigure(StaplerRequest req) throws IOException, ServletException {
Jenkins jenkins = Jenkins.get();
jenkins.checkPermission(Jenkins.ADMINISTER);
Copy link
Member

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 Jenkins.MANAGE as changing a proxy should not allow escallation of permissions to Administer?

Copy link
Member Author

@olamy olamy Nov 15, 2023

Choose a reason for hiding this comment

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

this is a move of the current code. I didn't touch that. (

jenkins.checkPermission(Jenkins.ADMINISTER);
)
Should it be change?

Copy link
Member

Choose a reason for hiding this comment

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

Should it be change?

let's not do it here - can be done in a follow up as it may require some thought as to if it can be abused (I do not see a vector to escalate here - but at least it would require a security review)

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout title="${%Proxy Configuration}" permission="${app.SYSTEM_READ}">

Copy link
Member

Choose a reason for hiding this comment

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

does this not need to set readOnly mode so the fields show as disabled when the user misses the permission to change them?

Suggested change
<j:set var="readOnlyMode" value="${!app.hasPermission(app.MANAGE)}"/>

Copy link
Member Author

Choose a reason for hiding this comment

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

this mean modifying all config.groovy for ProxyConfiguration. This PR is only about moving the form not really changing how it works

@jtnord
Copy link
Member

jtnord commented Nov 15, 2023

Is there not something in the setup wizard that lets you setup a proxy if it detects you have no connection, does that not need some changes to call the changed API?

<div id="proxy-configuration">
<h1>${%HTTP Proxy Configuration}</h1>
<f:form method="post" action="/pluginManager/proxyConfigure" name="proxyConfigure">
<j:scope>
<j:set var="instance" value="${app.proxy}"/>
<j:set var="descriptor" value="${app.pluginManager.proxyDescriptor}"/>
<st:include from="${descriptor}" page="${descriptor.configPage}" />
</j:scope>
</f:form>
</div>

@NotMyFault NotMyFault requested a review from a team November 15, 2023 11:44
@NotMyFault NotMyFault added the needs-security-review Awaiting review by a security team member label Nov 15, 2023
@NotMyFault NotMyFault added the ath-successful This PR has successfully passed the full acceptance-test-harness suite label Nov 15, 2023
@olamy
Copy link
Member Author

olamy commented Nov 15, 2023

While it's a good idea to move the proxy configuration out of the plugin manager, what motivates it getting its own top-level ManagementLink? I would not expect that to be relevant regularly enough to justify the space it'll take up. Why not make it just another option in Configure System?

Because I find the new icon really cute!

Sounds a good idea to add another option in Configure System. I will change to this.

@olamy
Copy link
Member Author

olamy commented Nov 16, 2023

While it's a good idea to move the proxy configuration out of the plugin manager, what motivates it getting its own top-level ManagementLink? I would not expect that to be relevant regularly enough to justify the space it'll take up. Why not make it just another option in Configure System?

@daniel-beck
done with 37918b9

return true;
}

public static void saveProxyConfiguration(ProxyConfiguration pc) throws IOException {
Copy link
Member Author

@olamy olamy Nov 16, 2023

Choose a reason for hiding this comment

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

I wonder if this method should be move this to the class ProxyConfiguration.
I'm tempted but so no strong opinion really

@olamy
Copy link
Member Author

olamy commented Nov 16, 2023

Is there not something in the setup wizard that lets you setup a proxy if it detects you have no connection, does that not need some changes to call the changed API?

<div id="proxy-configuration">
<h1>${%HTTP Proxy Configuration}</h1>
<f:form method="post" action="/pluginManager/proxyConfigure" name="proxyConfigure">
<j:scope>
<j:set var="instance" value="${app.proxy}"/>
<j:set var="descriptor" value="${app.pluginManager.proxyDescriptor}"/>
<st:include from="${descriptor}" page="${descriptor.configPage}" />
</j:scope>
</f:form>
</div>

The same API will be still here.

@prakash13594
Copy link

Changes Updated Proceed

Copy link
Contributor

@mawinter69 mawinter69 left a comment

Choose a reason for hiding this comment

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

Do we know if this affects CasC? I know there is special handling for proxy here in CasC

Copy link
Contributor

Choose a reason for hiding this comment

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

How about naming this ProxyGlobalConfiguration?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is a class called ProxyConfiguration which already some contains some logic about this.
So the idea was to have a name similar.
Anywat naming it's like color or codestyle or wine. Everybody may have his own taste preferences.
why not another name but someone may not like it or prefer something different,
This will eventually turn into an endless loop and definitely a waste of time.

@Kevin-CB
Copy link
Contributor

Just to let you know, I will try to do a security review of this PR soonish

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.

Thanks for this PR.

Two questions (non-blocking):

  • The form is quite large, which was okay on it's own page but now on an instance with no plugins it takes up nearly a third of the system configuration page, is it worth hiding it behind a button like the administrative monitors?
  • (inline)

@olamy
Copy link
Member Author

olamy commented Nov 29, 2023

  • The form is quite large, which was okay on it's own page but now on an instance with no plugins it takes up nearly a third of the system configuration page, is it worth hiding it behind a button like the administrative monitors?

@timja

doesn't bother me too much compared to what you get when you have plenty of plugins installed :)

I'm not quite sure to follow " like the administrative monitors" where is the code for this?

@olamy olamy force-pushed the proxy-configuration-own-management-link branch from 0e6c77b to 310bd6a Compare November 29, 2023 01:45
@timja
Copy link
Member

timja commented Nov 29, 2023

  • The form is quite large, which was okay on it's own page but now on an instance with no plugins it takes up nearly a third of the system configuration page, is it worth hiding it behind a button like the administrative monitors?

@timja

doesn't bother me too much compared to what you get when you have plenty of plugins installed :)

I'm not quite sure to follow " like the administrative monitors" where is the code for this?

On the system configuration page:

image

image

@Kevin-CB Kevin-CB added security-approved @jenkinsci/core-security-review reviewed this PR for security issues and removed needs-security-review Awaiting review by a security team member labels Nov 29, 2023
Copy link
Contributor

@Kevin-CB Kevin-CB left a comment

Choose a reason for hiding this comment

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

Apologies for the delay. I've reviewed it and from a security standpoint, it looks fine.

@jtnord
Copy link
Member

jtnord commented Nov 29, 2023

While it's a good idea to move the proxy configuration out of the plugin manager, what motivates it getting its own top-level ManagementLink? I would not expect that to be relevant regularly enough to justify the space it'll take up. Why not make it just another option in Configure System?

the form is quite large, which was okay on it's own page but now on an instance with no plugins it takes up nearly a third of the system configuration page, is it worth hiding it behind a button like the administrative monitors?

the proxy is unusual as it does not configure Jenkins like the rest of the things in the System page, but really the JVM (it doesn't but its more a JVM thing than a Jenkins thing) which is why in my initial discussion with Olamy I suggested it was there.

You will likely need to configure the proxy to be able to other parts of the Jenkins config (like test connections etc). Whilst you can "apply" or do a 2 step "save" this could also be needed for some security realms hence I still believe this is better as a separate item.

And then we have the discoverability. if it has its own icon it is obvious - it was burried in the plugin section for a while, if we move it and hide it behind a button for users with a few of plugins installed will they easily be able to discover the new location?

I'm not going to die on this hill - but it seems like putting it into the the System page creates its own issues.

@timja
Copy link
Member

timja commented Nov 29, 2023

And then we have the discoverability. if it has its own icon it is obvious - it was burried in the plugin section for a while, if we move it and hide it behind a button for users with a few of plugins installed will they easily be able to discover the new location?

I would expect most users would ctrl+F proxy, whether or not it's behind a button I don't think matters much.


I don't think proxy configuration is important enough or distinct enough to get it's own page.
It's in the setup wizard anyway so should be setup in first time setup first.

@olamy
Copy link
Member Author

olamy commented Nov 30, 2023

@timja use some advanced done 8315dd5

Signed-off-by: Olivier Lamy <[email protected]>
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.

Thanks, re-tested looks good!

@timja timja requested a review from a team November 30, 2023 09:01
@daniel-beck
Copy link
Member

discoverability

I don't think this is any different from any other option in Configure System? The same argument can be made for every option there.

it was burried in the plugin section for a while, if we move it and hide it behind a button for users with a few of plugins installed will they easily be able to discover the new location?

Yes, if we do it like we did for the cloud config (leaving behind a placeholder, #4339 third screenshot).

You will likely need to configure the proxy to be able to other parts of the Jenkins config (like test connections etc).

This argument makes more sense to me. OTOH at least the form allows for it, while otherwise system config needs to be abandoned to set up the proxy first.

Note that

could also be needed for some security realms

is less relevant, security realms are on Configure Global Security, so separate from either. Unless you're saying admins changing security options cannot be expected to visit Configure System beforehand if their environment demands it?

@timja
Copy link
Member

timja commented Nov 30, 2023

/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

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 Nov 30, 2023
@olamy olamy merged commit 1e9372e into jenkinsci:master Dec 4, 2023
17 checks passed
@olamy olamy deleted the proxy-configuration-own-management-link branch December 4, 2023 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ath-successful This PR has successfully passed the full acceptance-test-harness suite 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 security-approved @jenkinsci/core-security-review reviewed this PR for security issues web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants