Skip to content

Add a property to specify the icon of the result #1919

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

Merged
merged 5 commits into from
Feb 17, 2025
Merged

Conversation

uhafner
Copy link
Member

@uhafner uhafner commented Jan 3, 2025

Add a new property icon to override the default icon for the results.

The icon can be given for the tool or for the overall results:

recordIssues id: 'custom-id', name: 'custom-name', icon: 'custom-icon', 
                       tool: javaDoc(pattern:'**/*issues.txt', reportEncoding:'UTF-8')

recordIssues tool: javaDoc(pattern:'**/*issues.txt', 
    reportEncoding:'UTF-8', 
    id: 'custom-id', 
    name: 'custom-name', 
    icon: 'custom-icon')

@uhafner uhafner added the enhancement Enhancement of existing functionality label Jan 3, 2025
@KalleOlaviNiemitalo
Copy link
Contributor

Can I deploy a custom icon to the userContent directory and reference that?

@uhafner
Copy link
Member Author

uhafner commented Jan 4, 2025

Can I deploy a custom icon to the userContent directory and reference that?

Yes, that works as well. I'll add that to the documentation of the property.

@KalleOlaviNiemitalo
Copy link
Contributor

How about an URL pointing to an external site? Like https://aka.ms/msbuildicon.

@uhafner
Copy link
Member Author

uhafner commented Jan 8, 2025

How about an URL pointing to an external site? Like https://aka.ms/msbuildicon.

It seems that Jenkins also does support that... I never tried that before but it works out of the box.

Base automatically changed from fix-icon-JENKINS-72777 to main February 17, 2025 22:58
@uhafner uhafner merged commit ee575bf into main Feb 17, 2025
3 of 29 checks passed
@uhafner uhafner deleted the icon-property branch February 17, 2025 22:58
uhafner added a commit that referenced this pull request Mar 8, 2025
In #1919
a new icon property has been added to the recorder.
This accidentally broke the URL mapping of the warning results.

When a custom ID is given, then this ID will be used as URL.
Only for empty URLs, the default ID of the label provider will be used.

Additionally, the log messages have been fixed when the ID
is used in tool and recorder (see JENKINS-75391).
final ResultHandler resultHandler) throws IOException, InterruptedException {
final ResultHandler resultHandler, final LogHandler logHandler) throws IOException, InterruptedException {
if (analysisTools.isEmpty()) {
throw new IllegalStateException("No tools configured to record issues");

Choose a reason for hiding this comment

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

👋 Hello! This seems to be a breaking behavioral change; can it be rolled back and reintroduced in a dedicated major release? Alternatively, can the docs be updated to say that tools isn't actually optional, i.e. clarify that you need one of tool or tools? Thanks!

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 wonder why someone should call the recorder without tools. But if that should be better documented, please file a PR for the documentation (or for the help files).

Choose a reason for hiding this comment

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

I wonder why someone should call the recorder without tools.

The issue is that the docs for the step show both of these as "(Optional)".

I think the "(Optional)" is generated from the code, so I assume it can't really be changed (since technically you only need one or the other). If that's the case—and please correct me if I'm wrong—I will just see about adding a sentence to the doc clarifying this relationship and the fact that exactly one of them is required. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants