Uploaded image for project: 'Jenkins Artifactory Plug-in'
  1. Jenkins Artifactory Plug-in
  2. HAP-1051

Artifactory Release Staging stopped working after update to 2.15

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.15.0
    • Fix Version/s: 2.15.1
    • Component/s: None
    • Labels:
      None

      Description

      Artifactory Release Staging stopped working after update to version 2.15

      [RELEASE] Release build triggered
       > git config --get remote.origin.url # timeout=10
      [RELEASE] Checking if tag 'multitenancy-context-1.4.1' exists.
       > git tag -l multitenancy-context-1.4.1 # timeout=10
       > git config --get remote.origin.url # timeout=10
      [RELEASE] Creating tag 'multitenancy-context-1.4.1_test' with message 'this is a test tag'
       > git tag -a -f -m this is a test tag multitenancy-context-1.4.1_test # timeout=10
       > git config --get remote.origin.url # timeout=10
      [RELEASE] Attempting to push tag multitenancy-context-1.4.1_test with --dry-run
       > git config --get remote.origin.url # timeout=10
      [RELEASE] Checking if tag 'multitenancy-context-1.4.1_test' exists.
       > git tag -l multitenancy-context-1.4.1_test # timeout=10
       > git config --get remote.origin.url # timeout=10
      [RELEASE] Deleting local tag: multitenancy-context-1.4.1_test
       > git tag -d multitenancy-context-1.4.1_test # timeout=10
      [RELEASE] ERROR: Failed while attempting push dry-run: Failed to retrieve git credentials
      

      It seems that plugin tries to make some test dry run and stuck during that phase. I see that such option has been introduced in 2.15

      
      git diff artifactory-2.14.0 artifactory-2.15.0 GitCoordinator.java
      diff --git a/src/main/java/org/jfrog/hudson/release/scm/git/GitCoordinator.java b/src/main/java/org/jfrog/hudson/release/scm/git/GitCoordinator.java
      index cc24f33..56cd95b 100644
      --- a/src/main/java/org/jfrog/hudson/release/scm/git/GitCoordinator.java
      +++ b/src/main/java/org/jfrog/hudson/release/scm/git/GitCoordinator.java
      @@ -19,7 +19,6 @@ package org.jfrog.hudson.release.scm.git;
       import hudson.model.AbstractBuild;
       import hudson.model.BuildListener;
       import hudson.model.Result;
      -import org.apache.commons.lang.StringUtils;
       import org.jfrog.hudson.release.ReleaseAction;
       import org.jfrog.hudson.release.ReleaseRepository;
       import org.jfrog.hudson.release.scm.AbstractScmCoordinator;
      @@ -59,6 +58,25 @@ public class GitCoordinator extends AbstractScmCoordinator {
               checkoutBranch = scmManager.getBranchNameWithoutRemote(gitBranchName);
           }
       
      +    public void pushDryRun() throws Exception {
      +        if (releaseAction.isCreateVcsTag()) {
      +            if (scmManager.isTagExists(scmManager.getRemoteConfig(releaseAction.getTargetRemoteName()), releaseAction.getTagUrl())) {
      +                throw new Exception(String.format("Tag with name '%s' already exists", releaseAction.getTagUrl()));
      +            }
      +        }
      +
      +        String testTagName = releaseAction.getTagUrl() + "_test";
      +        try {
      +            scmManager.testPush(scmManager.getRemoteConfig(releaseAction.getTargetRemoteName()), testTagName);
      +        } catch (Exception e) {
      +            throw new Exception(String.format("Failed while attempting push dry-run: %s", e.getMessage()), e);
      +        } finally {
      +            if (scmManager.isTagExists(scmManager.getRemoteConfig(releaseAction.getTargetRemoteName()), testTagName)) {
      +                scmManager.deleteLocalTag(testTagName);
      +            }
      +        }
      +    }
      +
           public void beforeReleaseVersionChange() throws IOException, InterruptedException {
               if (releaseAction.isCreateReleaseBranch()) {
                   // create a new branch for the release and start it
      
      

        Attachments

          Activity

            People

            • Assignee:
              barb Bar Belity
              Reporter:
              piotr Piotr Chmielnik
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: