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

Support for Item categorization in Jenkins 2 #9

Merged
merged 4 commits into from Mar 31, 2016

Conversation

recena
Copy link
Collaborator

@recena recena commented Mar 23, 2016

This PR belongs to this JENKINS-31162 issue and allows to categorize the External Monitor Jobs in a right way.

@reviewbybees

@ghost
Copy link

ghost commented Mar 23, 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.

@recena
Copy link
Collaborator Author

recena commented Mar 23, 2016

As part of this PR I'd like to remove the link to the documentation in the description.

* @return A string it represents a URL pattern to get the Item icon in different sizes.
*/
public String getIconFilePathPattern() {
return (Jenkins.RESOURCE_PATH + "/plugin/external-monitor-job/images/:size/externaljob.png").replaceFirst("^/", "");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jglick you prefer this way, right?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, so long as the API contract remains that the implementation must return a context-relative path.

(I briefly considered whether it would be appropriate for the caller to automatically prepend RESOURCE_PATH but this seems a little risky, and inconsistent with other Jenkins APIs defining image paths.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jglick If you agree, I prefer to use the original format, used in other plugins:

public String getIconFilePathPattern() {
    return "plugin/external-monitor-job/images/:size/externaljob.png";
}

In my opinion, more flexible.

Copy link
Member

Choose a reason for hiding this comment

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

more flexible

How so?

Not a big deal either way, just means you will lose icon caching for repeated page loads.

@jenkinsadmin
Copy link
Member

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

@jglick
Copy link
Member

jglick commented Mar 30, 2016

🐝

* @return A string it represents a ItemCategory identifier.
*/
public String getCategoryId() {
return "standaloneprojects";
Copy link
Member

Choose a reason for hiding this comment

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

Why it is this string and not any other should be documented somewhere IMO.

Copy link
Member

Choose a reason for hiding this comment

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

I would expect it to be available via Enum or a static variable from the Jenkins core 2.0. IMHO there should be a TODO for it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@amuniz @oleg-nenashev

When this plugin upgrades his baseline, he will able to use something like that: StandaloneProjectsCategory.ID. By now, if we want that these plugins use ItemCategorization feature (provided by Jenkins 2.0) and additionally are compatible with Jenkins 1.x, this was the best option.

@amuniz
Copy link
Member

amuniz commented Mar 31, 2016

🐝

@oleg-nenashev
Copy link
Member

🐜 for the logo. It's a bit strange. It may also confuse people if somebody creates the "Item Type Icon Column" for list views, because this logo contains a blue ball similar to the status indicator

🐝 for the other stuff

@recena
Copy link
Collaborator Author

recena commented Mar 31, 2016

@oleg-nenashev The icon was designed by @gusreiber not me.

@recena
Copy link
Collaborator Author

recena commented Mar 31, 2016

@reviewbybees done

@recena recena merged commit d1c1011 into jenkinsci:master Mar 31, 2016
@ghost
Copy link

ghost commented Mar 31, 2016

This pull request has completed our internal processes and we now respectfully request the maintainers of this repository to consider our proposal contained within this pull request for merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants