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

Remove missed occurence of FileOnMasterKeyStoreSource #312

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

jtnord
Copy link
Member

@jtnord jtnord commented Jul 3, 2024

Adapt to jenkinsci/credentials-plugin#540

ammends #310

Testing done

ran mvn verify with the following change

diff --git a/pom.xml b/pom.xml
index 167d1e7..4eec89d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
   <url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
   <properties>
     <changelist>999999-SNAPSHOT</changelist>
-    <jenkins.version>2.414.3</jenkins.version>
+    <jenkins.version>2.426.3</jenkins.version>
     <gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
   </properties>
   <licenses>
@@ -62,6 +62,7 @@
     <dependency>
       <groupId>org.jenkins-ci.plugins</groupId>
       <artifactId>credentials</artifactId>
+      <version>1355.v46f52a_b_98d64</version>
     </dependency>
     <dependency>
       <groupId>org.jenkins-ci.plugins</groupId>

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 demonstrates feature works or fixes the issue

@jtnord jtnord requested a review from a team as a code owner July 3, 2024 10:13
@jtnord jtnord enabled auto-merge July 3, 2024 10:15
@@ -148,11 +148,11 @@ public void basicsPipeline() throws Exception {
String alias = "androiddebugkey";
String password = "android";
StandardCertificateCredentials c = new CertificateCredentialsImpl(CredentialsScope.GLOBAL, "my-certificate", alias,
password, new CertificateCredentialsImpl.FileOnMasterKeyStoreSource(certificate.getAbsolutePath()));
password, new CertificateCredentialsImpl.UploadedKeyStoreSource(new FileParameterValue.FileItemImpl(certificate), null));
Copy link
Member Author

Choose a reason for hiding this comment

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

the fix

CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), c);
// create the Pipeline job
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
String pipelineScript = IOUtils.toString(getTestResourceInputStream("basicsPipeline-Jenkinsfile"), StandardCharsets.UTF_8);
String pipelineScript = getTestResourceAsUTF8String("basicsPipeline-Jenkinsfile");
Copy link
Member Author

Choose a reason for hiding this comment

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

preventing resource leaks by ensuring the stream is closed.

f.copyFrom(in);
f.chmod(mask);
return f;
try (InputStream in = getTestResourceInputStream(fileName)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

preventing resource leaks by ensuring the stream is closed.

@jtnord jtnord merged commit f91669a into jenkinsci:master Jul 3, 2024
14 checks passed
@jtnord jtnord deleted the remove-FileOnMasterKeySource-2 branch July 3, 2024 10:34
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.

1 participant