[JIRA] (JENKINS-60692) credential type icon not correctly reflected

18 views
Skip to first unread message

domi@fortysix.ch (JIRA)

unread,
Jan 8, 2020, 8:26:02 AM1/8/20
to jenkinsc...@googlegroups.com
Dominik Bartholdi created an issue
 
Jenkins / Bug JENKINS-60692
credential type icon not correctly reflected
Issue Type: Bug Bug
Assignee: Chris Kilding
Attachments: Screenshot 2020-01-08 at 10.00.12.png
Components: aws-secrets-manager-credentials-provider-plugin
Created: 2020-01-08 13:25
Priority: Minor Minor
Reporter: Dominik Bartholdi

I created a username/password credentials with the following command:

aws secretsmanager create-secret --name 'DB_USER_XXXXX' --secret-string 'zzzzzz' --tags 'Key=jenkins:credentials:username,Value=uuuuu' --description 'dddddddd'  

although this worked and the credentials also show up in jenkins, the credentials have the wrong type icon shown in the credentials list screen:

all four credentials shown in the above screenshot should have the same icon in the first position of each line - all should be of type "UserName with Password". Currently the ones from AWS Provider show a different icon with the tool tip "AWS Secrets Manager secret" (which in fact is the icon for "Secret text"). This is very irritating for a user.

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 9, 2020, 7:46:01 AM1/9/20
to jenkinsc...@googlegroups.com
Chris Kilding commented on Bug JENKINS-60692
 
Re: credential type icon not correctly reflected

I'm intending to remove the multi-type credential object in PR #10, replacing it with different credential type classes that each implement just one credentials interface.

On initial inspection this seems to be fixing a lot of cosmetic problems like the formatting of names, bringing them in line with how credentials usually appear in the UI.

If you're interested and have the time, I encourage you to check out the git-plugin-username-password-bug branch, test it locally, and see if it is fixing the icon problem as well?

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 14, 2020, 10:18:06 AM1/14/20
to jenkinsc...@googlegroups.com

Not to worry, I've since run the test and the icons are still all pegged to the one used for secret text.

That icon is actually the default icon if the custom credentials descriptor does not implement the method

 

public String getIconClassName()

 

The most obvious route to fix this is to copy and paste what the Jenkins default credential implementations return in their descriptors. E.g. "icon-credentials-userpass" for UsernamePasswordCredentialsImpl.

The problem is that I can't find the source of the icon class names they return: I presume a PNG with a matching name exists in some other part of the Jenkins codebase, but didn't find it. So while we could copy-paste the class names into this provider, we would get no warning if the names ever changed.

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 14, 2020, 10:19:09 AM1/14/20
to jenkinsc...@googlegroups.com
Chris Kilding edited a comment on Bug JENKINS-60692
Not to worry, I've since run the test and the icons are still all pegged to the one used for secret text.

That icon is actually the default icon if the custom credentials descriptor does not implement the method

 
{code:java}
public String getIconClassName(){code}

 

The most obvious route to fix this is to copy and paste what the Jenkins default credential implementations return in their descriptors. E.g. "icon-credentials-userpass" for UsernamePasswordCredentialsImpl.

The problem is that I can't find the source of the icon class names they return: I presume a PNG with a matching name exists in some other part of the Jenkins codebase, but didn't find it. So while we could copy-paste the class names into this provider, we would get no warning if the names ever changed , or if we made a typo .

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 14, 2020, 10:41:15 AM1/14/20
to jenkinsc...@googlegroups.com

I have requested that the icon names be made available as string constants in the credentials-plugin: JENKINS-60766

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 23, 2020, 6:51:02 AM1/23/20
to jenkinsc...@googlegroups.com
Chris Kilding started work on Bug JENKINS-60692
 
Change By: Chris Kilding
Status: Open In Progress

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 23, 2020, 6:52:03 AM1/23/20
to jenkinsc...@googlegroups.com

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 24, 2020, 7:17:02 AM1/24/20
to jenkinsc...@googlegroups.com

Progress on JENKINS-60766 will take some time, so in the meantime the best option was to use the icon class names (and therefore leverage the icons provided by the upstream credentials jars), and to add conformance tests that will fail if the upstream jars ever change their icon class names.

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 24, 2020, 7:18:02 AM1/24/20
to jenkinsc...@googlegroups.com

This fix will be included in the next plugin release.

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 27, 2020, 1:00:05 PM1/27/20
to jenkinsc...@googlegroups.com
Change By: Chris Kilding
Status: In Review Resolved
Resolution: Fixed
Released As: 0.2.1

chris+jenkins@chriskilding.com (JIRA)

unread,
Jan 27, 2020, 1:00:05 PM1/27/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages