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

Fill credentials from current context instead of just Jenkins singleton #602

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

Dohbedoh
Copy link
Contributor

@Dohbedoh Dohbedoh commented Apr 23, 2021

Proposing this as this is useful in CloudBees products where Cloud implementation can be configured within Folders within folders, then pushed connected Jenkins instance. Similar feature were added to for example the kubernetes plugin: jenkinsci/kubernetes-plugin@00ca6a8

I have added a test to validate that this does not impact the current functionalities.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your master 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 demonstrates feature works or fixes the issue

@res0nance res0nance added the enhancement Feature additions or enhancements label Apr 23, 2021
@res0nance res0nance merged commit 0870ee8 into jenkinsci:master Apr 29, 2021
@Dohbedoh Dohbedoh deleted the feature/credentialscontext branch May 4, 2021 04:26
@@ -1153,12 +1154,12 @@ public FormValidation doCheckSshKeysCredentialsId(@QueryParameter String value)
* @throws IOException
* @throws ServletException
*/
protected FormValidation doTestConnection(URL ec2endpoint, boolean useInstanceProfileForCredentials, String credentialsId, String sshKeysCredentialsId, String roleArn, String roleSessionName, String region)
protected FormValidation doTestConnection(@AncestorInPath ItemGroup context, URL ec2endpoint, boolean useInstanceProfileForCredentials, String credentialsId, String sshKeysCredentialsId, String roleArn, String roleSessionName, String region)
Copy link
Contributor

Choose a reason for hiding this comment

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

Keeping the former method, without the context, to keep the compatibility would be good. Some subclasses may rely on the old signature.

Copy link
Contributor

@MRamonLeon MRamonLeon May 4, 2021

Choose a reason for hiding this comment

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

Since this is a method expected to be called from jellies, it shouldn't break anything. So not a big deal to deserve a fix PR

@res0nance res0nance mentioned this pull request May 4, 2021
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature additions or enhancements
Projects
None yet
3 participants