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-33228] Misc global config page improvements #112

Merged
merged 15 commits into from
Mar 10, 2016

Conversation

kohsuke
Copy link
Member

@kohsuke kohsuke commented Mar 8, 2016

See JENKINS-33228 for the context of this discussion.

This PR consists of a number of small changes to slightly improve the global configuration page.

GitHubServerConfig and especially its help text is still not really adequate for reuse by other plugins, but those requires further work.

Review on Reviewable

But it occupies the precious real estate and pushes all the form controls to the right. Given the way global configuration page works, this affects all the form controls of the global config page, not just this plugin.
... especially so if this plugin is meant to be a common configuration point for all GitHub related plugins, ala JENKINS-33228.
... as this plugin is used to configure GitHub instances that other plugins will also use.

description for repeatableHeteroProperty isn't all that useful anyway, because when multiple instances are configured, the description gets pushed far down and it's not clear where that text is associated with.
There's no nested structure in GitHubServerConfig, so the added descriptiveness is not being useful.
And "custom API URL" is a poor wording when it really refers to GitHub Enterprise
@kohsuke
Copy link
Member Author

kohsuke commented Mar 8, 2016

@reviewbybees

@ghost
Copy link

ghost commented Mar 8, 2016

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@kohsuke kohsuke force-pushed the config-improvements branch 2 times, most recently from 780988d to 96c8426 Compare March 8, 2016 05:28
…t after

And if someone is testing a setting, cache can be only harmful, so might as well disable that. This also prevents garbage from accumulating
@jenkinsadmin
Copy link
Member

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@@ -171,7 +171,7 @@ public boolean configure(StaplerRequest req, JSONObject json) throws FormExcepti

@Override
public String getDisplayName() {
return "GitHub Plugin Configuration";
return "GitHub Configuration";
Copy link
Member

Choose a reason for hiding this comment

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

When you maintain different production installations with many plugins it extremely critical to know what plugin contributes what configuration 👎

Copy link
Member

Choose a reason for hiding this comment

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

And yes, i know about help buttons, but they may be broken by core like in different plugins today.

Copy link
Member

Choose a reason for hiding this comment

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

they may be broken by core

What is this referring to?

Copy link
Member

Choose a reason for hiding this comment

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

it [is] extremely critical to know what plugin contributes what configuration

But it is precisely the point of this PR to make this configuration be more readily applicable to multiple plugins, regardless of which plugin contributes it.

From the user perspective, they are configuring GitHub settings in Jenkins. If they need to troubleshoot why something is not working as expected, there are multiple techniques for doing that, such as enabling logging, searching known bug reports, etc. The link in help text may indeed be used to determine which plugin is defining a given configuration fragment, but this is not necessarily the source of a problem anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Github plugin provides connection for plugins, it has own documentation that guides on how configure this connection. I.e. in pullrequest-plugin i have reference: 1) configure github-plugin 2) configure PR plugin.
Please remember that non enterprise usage it's not marketing feature where you want mask everything and resolve all issues via support. FOSS users should understand what and where should be configured.

I think we can review and bit update github-plugin documentation to indicate that it could be used by other plugins.Technically it has connection API + ancient push->GitSCM.poll() parts. Other plugins should also reference to github-plugin (i.e. if configured user should have additional permissions).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd also point out that most other plugins do not put "Plugin" nor "Configuration" in it. In fact I should have further removed "Configuration" from the subject line.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, "configuration" sounds bit redundant. Would it be possible to place some UI element that would show that this section comes from gh plugin, then i would be ok to remove "plugin" word?

Copy link
Member

Choose a reason for hiding this comment

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

this ok for me (it was here for historical reason)

Copy link
Member

Choose a reason for hiding this comment

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

At all, would it render help button if we place somewhere help.html?

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@KostyaSha
Copy link
Member

@kohsuke please do PRs from your forked repository, jenkinsci is full of your stalled branches (example https://github.com/jenkinsci/jenkins/branches/stale) and commits creating comments in JIRA.

Also for UI improvements please attach screenshot before and after.

This changes seems what i said before to @lanwen, but he decided to target on easier default UI. Let's wait his review.

.doVerifyCredentials(github.serverConfig().getApiUrl(), credsId, 1);
GitHubServerConfig config = new GitHubServerConfig(credsId);
config.setApiUrl(github.serverConfig().getApiUrl());
config.setClientCacheSize(1);
Copy link
Member

Choose a reason for hiding this comment

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

@kohsuke maybe it would be easy for you to implement this https://issues.jenkins-ci.org/browse/JENKINS-32503 ?

@jglick
Copy link
Member

jglick commented Mar 8, 2016

please do PRs from your forked repository

Agreed, origin PRs should be reserved for cases where collaboration is expected.

As far as I can see, no other plugins put 'Configuration' either
@kohsuke
Copy link
Member Author

kohsuke commented Mar 8, 2016

Before:
before

After:
after

@@ -5,15 +5,12 @@ import com.cloudbees.jenkins.GitHubPushTrigger
def f = namespace(lib.FormTagLib);

f.section(title: descriptor.displayName) {
f.entry(title: _("Servers configs with credentials to manage GitHub integrations"),
description: _("List of GitHub Servers to manage hooks, set commit statuses etc."),
Copy link
Member

Choose a reason for hiding this comment

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

think description is useful, as of some users confused what is this section for

Copy link
Member Author

Choose a reason for hiding this comment

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

In the interest of getting other changes in, if this is something you feel strongly I'm happy to give up, but you should see it when you have one or two GitHubServerConfig instances. This text will really look out of place. Existing help file should explain what this field does. In addition, if this plugin is to be better reused from elsewhere, the wording is incorrect, too.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, github servers configuration part should be generified in UI and docs. But clicking help buttons is also not always convenient. Try open all collapsed items in configuration page to get review of configurations - you will tire clicking.

@KostyaSha
Copy link
Member

@kohsuke thanks for screenshots

After:

I think it would make sense place test button under manage hooks as ideally it should also verify ability to manage hooks (that is not possible to check 🏧 because github-api doesn't expose headers AFAIR).

help: descriptor.getHelpFile()) {

f.repeatableHeteroProperty(
field: "configs",
hasHeader: "true",
addCaption: _("Add GitHub Server Config"),
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just set to Add GitHub Server? As of its better for end-users than simple "Add" (it adds a userfriendly context)

Copy link
Member

Choose a reason for hiding this comment

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

I also don't like default "add" "delete" as they are not very useful on what they really do because of pure jelly form selection (it visible, but with all not aligned checkboxes not very convenient).

Copy link
Member

Choose a reason for hiding this comment

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

(Small reminder: verify documentation and screenshots if this changes would be merged.)

@kohsuke
Copy link
Member Author

kohsuke commented Mar 8, 2016

I think it would make sense place test button under manage hooks as ideally it should also verify ability to manage hooks (that is not possible to check 🏧 because github-api doesn't expose headers AFAIR).

When the plugin actually develops the capability to check it, please make that change. This is out of scope of this PR.

@KostyaSha
Copy link
Member

This is out of scope of this PR.

According to commits description you reordering items. Changing later would require redoing screenshots. Placing now probably would also exclude bad aligned help buttons.

help: descriptor.getHelpFile()) {

f.repeatableHeteroProperty(
field: "configs",
hasHeader: "true",
addCaption: _("Add GitHub Server Config"),
deleteCaption: _("Delete GitHub Server Config"))
Copy link
Member

Choose a reason for hiding this comment

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

Restore deleteCaptionif you restored addCaption ?

Copy link
Member

Choose a reason for hiding this comment

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

think add caption is enought

@KostyaSha
Copy link
Member

FYI @kohsuke you may wait for both: my and @lanwen comments before doing changes.

@lanwen
Copy link
Member

lanwen commented Mar 9, 2016

so, ok for me 👍
wait for a few more hours to additional reviews and will merge this

lanwen added a commit that referenced this pull request Mar 10, 2016
[JENKINS-33228] Misc global config page improvements
@lanwen lanwen merged commit 44a8781 into master Mar 10, 2016
@lanwen lanwen deleted the config-improvements branch March 10, 2016 10:38
@lanwen
Copy link
Member

lanwen commented Mar 10, 2016

Will release it as 1.18.0 together with #111 (after it will be completed)

* @param customApiUrl true if optional block "Custom GH Api Url" checked in UI
*/
@DataBoundSetter
public void setCustomApiUrl(boolean customApiUrl) {
Copy link
Member

Choose a reason for hiding this comment

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

This change broke backward compatibility, for example here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly!

Copy link
Member

Choose a reason for hiding this comment

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

See description of the field. This was used only for UI because of pure jelly form.

Copy link
Member

Choose a reason for hiding this comment

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

This was used only for UI because of pure jelly form.

It doesn't matter, it's public API.

Copy link
Member

Choose a reason for hiding this comment

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

hmmm, thanks for the report, will return that in a few hours.

Copy link
Member

Choose a reason for hiding this comment

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

lanwen added a commit to lanwen/github-plugin that referenced this pull request Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants