Skip to content

Conversation

@timja
Copy link
Member

@timja timja commented Dec 29, 2025

  • Adds a "New credentials" link to Credentials page.
  • Improves UX of selecting a credentials type
  • Uses dialogs when creating credentials to improve the experience.
credentials.mov

Part of #986

Fixes #939

ATH passed in jenkinsci/acceptance-test-harness#2565

TODO:

  • Global domain doesn't seem to work right anymore
  • No create button on c:select Add - i.e. adding a credential from a credential chooser dropdown
  • c:select needs migrating to wizard, i.e. overflow button needs to give domains in overflow...
  • Don't redirect to store after creation of credentials if on root page
  • Convert domain add credentials to use wizard
  • Do we want to constrain width of domain selector for descriptions?
  • Review if WrappedCredentialsStore still needs to exist
  • Empty state for main page should have add credentials added
  • Fix integration tests
  • ATH
  • PCT
  • Take a video once we're happy with it
  • Empty scope
  • Review TODO items in code
  • Nested folders

Testing done

  • Single level folder
  • System credentials
  • User credentials
  • ATH
  • Integration tests in this plugin
  • Nested folders

nested folder example:
image

Tested with:

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@timja
Copy link
Member Author

timja commented Jan 11, 2026

I've noticed a couple of times in ATH that behaviour isn't running in time and the scope dropdown is empty:

image

Would be good to fix this

@timja
Copy link
Member Author

timja commented Jan 11, 2026

Example here I think:
https://ci.jenkins.io/job/Core/job/acceptance-test-harness/job/PR-2565/5/testReport/plugins/GitPluginTest/latest_linux_jdk21_firefox_split6___custom_name_and_email/

aster200632705|Caused: java.lang.IllegalArgumentException: Failed to instantiate class com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey from {"stapler-class":"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey","$class":"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey","scope":"","id":"","description":"","username":"gitplugin","usernameSecret":false,"privateKeySource":{"value":"0","privateKey":"[value redacted]","$redact":"privateKey","stapler-class":"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource","$class":"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource"},"passphrase":"[value redacted]","$redact":"passphrase"}
master200632705|	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:870)
master200632705|	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:633)
master200632705|	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:628)
master200632705|	at hudson.model.Descriptor.bindJSON(Descriptor.java:662)
master200632705|	at hudson.model.Descriptor.newInstanceImpl(Descriptor.java:620)
master200632705|Caused: java.lang.LinkageError: Failed to instantiate class com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey from {"stapler-class":"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey","$class":"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey","scope":"","id":"","description":"","username":"gitplugin","usernameSecret":false,"privateKeySource":{"value":"0","privateKey":"[value redacted]","$redact":"privateKey","stapler-class":"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource","$class":"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource"},"passphrase":"[value redacted]","$redact":"passphrase"}

@timja
Copy link
Member Author

timja commented Jan 13, 2026

That was resolved, main thing left is ATH to sort.... taking quite awhile...

@timja
Copy link
Member Author

timja commented Jan 16, 2026

Something weird is going on.

Sometimes (in ATH) the Add button for adding an SSH username with password doesn't work.

https://github.com/jenkinsci/acceptance-test-harness/pull/2565/checks?check_run_id=60413734684

https://ci.jenkins.io/job/Core/job/acceptance-test-harness/job/PR-2565/9/testReport/plugins/WorkflowPluginTest/latest_linux_jdk25_firefox_split4___hello_world_from_git/

image

I can reproduce it rarely when I run an ATH test, can't reproduce interactively.
There's no browser console errors.
But if you click the Add button nothing happens.

Something to do with behaviour not registering.

Help appreciated if anyone has time.

@timja timja marked this pull request as ready for review January 25, 2026 16:25
@timja timja requested a review from a team as a code owner January 25, 2026 16:25
@timja timja marked this pull request as draft January 25, 2026 16:26
@timja
Copy link
Member Author

timja commented Jan 25, 2026

ATH passing 🎉

Just need to review TODOs

@timja timja marked this pull request as ready for review January 25, 2026 19:03
@timja
Copy link
Member Author

timja commented Jan 25, 2026

@jtnord would appreciate a review if possible, thanks.

@timja

This comment was marked as resolved.

-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:f="/lib/form">
<st:setHeader name="X-Wizard-Title" value="${%Add Credentials}" />
Copy link
Member

Choose a reason for hiding this comment

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

X-Wizard-Title?

</j:otherwise>
</j:choose>

<form action="${relativePath}dialog2${query}" method="GET" name="dialog">
Copy link
Member

Choose a reason for hiding this comment

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

is there some subtle security issue here? can I craft a link to this with ${thepath}?relativePath=https://somewhere-else.com/someform to change the form submission to go to a completely different server?


<l:ajax>
<f:form id="credentials-dialog-form"
action="${request2.getParameter('relativePath')}/createCredentials" method="POST" name="newCredentials">
Copy link
Member

Choose a reason for hiding this comment

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

relativePath is user supplied and IIRC stapler will pull this out from https://my.jenkins/whatever...?relativePath=http://somewhereelse.com/someotherform

margin-bottom: 1.5rem;
}

.jenkins-choice-list {
Copy link
Member

Choose a reason for hiding this comment

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

should this changing /defining styles in the jenkins hierachy? (I have no idea about how this gets mapped)

checkMethod="${attrs.checkMethod}"/>
<!-- TODO add support for checking permissions against stores in request path -->
<j:set var="storeItems" value="${selectHelper.getStoreItems(context, includeUser)}"/>
<!-- TODO look into includeUser -->
Copy link
Member

Choose a reason for hiding this comment

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

is this valid? did things work (excepting permissions issues and failing hard) before and not now?

Comment on lines +29 to +35
const backButton = document.createElement("button");
backButton.classList.add("jenkins-button");
backButton.classList.add("jenkins-dialog__back-button");
backButton.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M328 112L184 256l144 144"/></svg>`;
title.style.transition = "var(--standard-transition)";
title.style.marginLeft = "2.75rem";
dialog.appendChild(backButton);
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this needs some aria accessibility attributes?

@jtnord
Copy link
Member

jtnord commented Jan 26, 2026

I get an unneeded scrollbar when attempting to add a credential.

image

@jtnord
Copy link
Member

jtnord commented Jan 26, 2026

not sure if this is an issue somewhere in Jenkins core or here, but if I click in the dialog (in certain places) it closes it unexpectedly.
It also closed it if I click outside the dialog (possibly more expected - but was a surprise to me when there is a specifix close (X) button.

the purple area seems to dismiss in the following:

image

As I may be part way through completing something I would not expect this to occur.

@jtnord
Copy link
Member

jtnord commented Jan 26, 2026

credential type options seem to be completely inaccessible (chrome windows) - I can not tab to them, space and arrows control the page in the background of the dialog. I can tab to the X and the next button, but not the individual credential types

@jtnord
Copy link
Member

jtnord commented Jan 26, 2026

NIT: the bottom floating buttons are missing some styling from the normal stick floating button bar on core pages.
there is no bluring of the background behind them.

e.g.

image

Possibly not possible, but it would be great for the ATH if the bottom button bar was outside of the scroll for the rest of the dialog (similar to the title) so that you did not have to mess with disabling the sticky button with js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JENKINS-71109] CSS misalignment of nested form entries when editing credentials

3 participants