Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-2201

first toplevel directory gets tagged directly into base directoy of new tag

    XMLWordPrintable

Details

    • Patch
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • svn-tag-plugin
    • None
    • Platform: All, OS: All

    Description

      As far as I can see, svn-tag plugin's behaviour is strange, because if
      you set the projects SCM for example to trunk and after a successful
      build are going to tag it, all the modules which were checked out of the
      SCM become subfolders in the tag, except for the first one.

      e.g.

      somerep

      • trunk
      • basic
      • folder1
      • folder2
      • basic-profile
      • folder3
      • folder4
      • basic-stuff
      • ....
      • tags
      • tag1
      • tag2

      then i'm building for example the basic & basic-profile projects, the
      build is successful and I'm going to tag it.
      this is the result:

      somerep

      • trunk
      • basic
      • folder1
      • folder2
      • basic-profile
      • folder3
      • folder4
      • basic-stuff
      • ....
      • tags
      • tag1
      • tag2
      • tag3
      • basic-profile
      • folder3
        -folder4
      • folder1
      • folder2

      the first project to be checked out by the SCM is always deployed in the
      base-directory of the tag, not in it's specific subfolders. the
      following projects are then deployed in their specific subfolders. i
      made a workaround, by checking out a "dummy"-project first, which is
      empty, i can successfully tag the build. but if i have to check out that
      build again - the "dummy" project of course is missing.
      I hope you can see that this problem causes me to be not able to change
      a tag or branch and build it, and if this is successful, lets me tag it
      or branch it as i wish.

      Attachments

        Activity

          weichselbaumer weichselbaumer created issue -

          problem described is when using v1.3, I have changed to 1.5 which changes the
          problem to the following:

          only the last project-directory, which is supposed to be created in the new
          tag-directory is created, the other ones are getting deleted whenever the next
          one is created.

          moduleLocation: Remote ->https://xxx:8443/svn/yyy/trunk/basic
          Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000592'.
          There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000592.
          Tagged as Revision 31876
          moduleLocation: Remote ->https://xxx:8443/svn/yyy/trunk/basic-db
          Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000592'.
          Delete old tag https://xxx:8443/svn/yyy/tags/wc_083000_000592.
          Tagged as Revision 31879
          moduleLocation: Remote ->https://xxx:8443/svn/yyy/trunk/basic-event
          Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000592'.
          Delete old tag https://xxx:8443/svn/yyy/tags/wc_083000_000592.
          Tagged as Revision 31882

          weichselbaumer weichselbaumer added a comment - problem described is when using v1.3, I have changed to 1.5 which changes the problem to the following: only the last project-directory, which is supposed to be created in the new tag-directory is created, the other ones are getting deleted whenever the next one is created. moduleLocation: Remote -> https://xxx:8443/svn/yyy/trunk/basic Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000592'. There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000592 . Tagged as Revision 31876 moduleLocation: Remote -> https://xxx:8443/svn/yyy/trunk/basic-db Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000592'. Delete old tag https://xxx:8443/svn/yyy/tags/wc_083000_000592 . Tagged as Revision 31879 moduleLocation: Remote -> https://xxx:8443/svn/yyy/trunk/basic-event Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000592'. Delete old tag https://xxx:8443/svn/yyy/tags/wc_083000_000592 . Tagged as Revision 31882
          k2nakamura k2nakamura added a comment -

          The original behavior was due to the lack of consideration of multiple locations
          support. In ver 1.4 and 1.5, some fixes were made to support multiple locations,
          but there is still known issue that svn-tag cannot map distinct tag base URL for
          each svn location.
          I believe the ultimate solution is to allow each location to have a unique tag
          base URL, but it requires some interaction with SubversionSCM core, which I
          haven't fully understood.
          The next step I can take is to bind the last part of the location URL to groovy
          shell so that users can embed the name as a part of tag base URL.
          This solution has the caveat that it's useless when the hierarchy of the tree is
          not similar between locations, but I hope it solves most of the use cases.

          k2nakamura k2nakamura added a comment - The original behavior was due to the lack of consideration of multiple locations support. In ver 1.4 and 1.5, some fixes were made to support multiple locations, but there is still known issue that svn-tag cannot map distinct tag base URL for each svn location. I believe the ultimate solution is to allow each location to have a unique tag base URL, but it requires some interaction with SubversionSCM core, which I haven't fully understood. The next step I can take is to bind the last part of the location URL to groovy shell so that users can embed the name as a part of tag base URL. This solution has the caveat that it's useless when the hierarchy of the tree is not similar between locations, but I hope it solves most of the use cases.
          k2nakamura k2nakamura made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          k2nakamura k2nakamura added a comment -

          I added "repoURL", which is the list containing repo URL delimited by slash.
          Specifying "../tags/${env['BUILD_TAG']}/${repoURL[-1]}" as the tag base URL
          should create the tag as you wish.
          Please see the doc for the details.
          http://hudson.gotdns.com/wiki/display/JENKINS/Subversion+Tagging+Plugin
          Please upgrade to version 1.6 and test the configuration. If it's not working,
          please reopen this and let me know.

          k2nakamura k2nakamura added a comment - I added "repoURL", which is the list containing repo URL delimited by slash. Specifying "../tags/${env ['BUILD_TAG'] }/${repoURL [-1] }" as the tag base URL should create the tag as you wish. Please see the doc for the details. http://hudson.gotdns.com/wiki/display/JENKINS/Subversion+Tagging+Plugin Please upgrade to version 1.6 and test the configuration. If it's not working, please reopen this and let me know.
          k2nakamura k2nakamura made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]

          I upgraded to v1.6 and added the repoURL parameter as you said.
          when debugging i can see that the path of the tag is now correct, but I think,
          because the tag directory itself doesn't exist tagging fails. Looks like the
          "root directory" of the tag must be created in the first place.

          Here is my output:
          -----------------------------------------------------------------------------
          Tagging build in Subversion

          moduleLocation: Remote ->https://xxx:8443/svn/yyy/trunk/basic

          Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_082000_000661/basic'.

          There was no old tag at https://xxx:8443/svnyyy/tags/wc_082000_000661/basic.

          Subversion copy failed. svn: Commit failed (details follow):

          svn: '/svn/yyy/tags/wc_082000_000661' path not found: 404 Not Found
          (https://xxx:8443)
          -----------------------------------------------------------------------------

          So if you would generate the tag root directory, which here is
          "wc_082000_000661" first, I think everything would work fine.

          Anyway: Thanks for your quick response to this issue!

          weichselbaumer weichselbaumer added a comment - I upgraded to v1.6 and added the repoURL parameter as you said. when debugging i can see that the path of the tag is now correct, but I think, because the tag directory itself doesn't exist tagging fails. Looks like the "root directory" of the tag must be created in the first place. Here is my output: ----------------------------------------------------------------------------- Tagging build in Subversion moduleLocation: Remote -> https://xxx:8443/svn/yyy/trunk/basic Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_082000_000661/basic'. There was no old tag at https://xxx:8443/svnyyy/tags/wc_082000_000661/basic . Subversion copy failed. svn: Commit failed (details follow): svn: '/svn/yyy/tags/wc_082000_000661' path not found: 404 Not Found ( https://xxx:8443 ) ----------------------------------------------------------------------------- So if you would generate the tag root directory, which here is "wc_082000_000661" first, I think everything would work fine. Anyway: Thanks for your quick response to this issue!
          weichselbaumer weichselbaumer made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          k2nakamura k2nakamura added a comment -

          Svnkit doesn't provide the option to equivalent with "-parent" in the command
          line, but I implemented a workaround and now svn-tag should create the
          intermediate directories. Please upgrade to version 1.7 and verify if the issue
          is fixed.

          Thank you for your patience,

          k2nakamura k2nakamura added a comment - Svnkit doesn't provide the option to equivalent with "-parent" in the command line, but I implemented a workaround and now svn-tag should create the intermediate directories. Please upgrade to version 1.7 and verify if the issue is fixed. Thank you for your patience,
          k2nakamura k2nakamura made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]

          Creating the intermediate directory now works - but somehow the last part of the
          tag directory is treated as a nomral intermediate directory - meaning that this
          also gets created in the first place - therefore I am ending up with the folder
          that I want to have directly in the tag directory being generated as another
          subdirectory...

          Looks like this:

          Tagging build in Subversion
          moduleLocation: Remote ->https://xxx:8443/svn/yyy/trunk/basic
          Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic'.
          There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic.
          Tagged as Revision 32586

          moduleLocation: Remote ->https://xxx:8443/svn/yyy/trunk/basic-db
          Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db'.
          There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db.
          Tagged as Revision 32584

          This gets my a tag that looks like this:
          https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic/basic/$CONTENT
          https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db/basic-db/$CONTENT

          I guess it looks like this, because the tag directory (wc_083000_000682) is
          generated and the directory I want to have in this tag directory is also being
          generated. Therefore I am ending up with this "../directory/directory" tag.

          I think you need to create all intermediate directories of the
          "parsedTagBaseURL" except for the last part - which is the directory that is
          supposed to be tagged.

          Once again I have to say: thank you for your efforts!

          weichselbaumer weichselbaumer added a comment - Creating the intermediate directory now works - but somehow the last part of the tag directory is treated as a nomral intermediate directory - meaning that this also gets created in the first place - therefore I am ending up with the folder that I want to have directly in the tag directory being generated as another subdirectory... Looks like this: Tagging build in Subversion moduleLocation: Remote -> https://xxx:8443/svn/yyy/trunk/basic Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic'. There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic . Tagged as Revision 32586 moduleLocation: Remote -> https://xxx:8443/svn/yyy/trunk/basic-db Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db'. There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db . Tagged as Revision 32584 This gets my a tag that looks like this: https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic/basic/$CONTENT https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db/basic-db/$CONTENT I guess it looks like this, because the tag directory (wc_083000_000682) is generated and the directory I want to have in this tag directory is also being generated. Therefore I am ending up with this "../directory/directory" tag. I think you need to create all intermediate directories of the "parsedTagBaseURL" except for the last part - which is the directory that is supposed to be tagged. Once again I have to say: thank you for your efforts!
          weichselbaumer weichselbaumer made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]

          done..

          weichselbaumer weichselbaumer added a comment - done..
          weichselbaumer weichselbaumer made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]

          don't know what happened here... wanted to close another issue and set this one
          to fixed. it isn't...

          I'll copy-paste my last comment for this issue in here, hope no one get's confused.

          Once again: Issue is not fixed..

          Creating the intermediate directory now works - but somehow the last part of the
          tag directory is treated as a nomral intermediate directory - meaning that this
          also gets created in the first place - therefore I am ending up with the folder
          that I want to have directly in the tag directory being generated as another
          subdirectory...

          Looks like this:

          Tagging build in Subversion
          moduleLocation: Remote ->https://xxx:8443/svn/yyy/trunk/basic
          Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic'.
          There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic.
          Tagged as Revision 32586

          moduleLocation: Remote ->https://xxx:8443/svn/yyy/trunk/basic-db
          Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db'.
          There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db.
          Tagged as Revision 32584

          This gets my a tag that looks like this:
          https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic/basic/$CONTENT
          https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db/basic-db/$CONTENT

          I guess it looks like this, because the tag directory (wc_083000_000682) is
          generated and the directory I want to have in this tag directory is also being
          generated. Therefore I am ending up with this "../directory/directory" tag.

          I think you need to create all intermediate directories of the
          "parsedTagBaseURL" except for the last part - which is the directory that is
          supposed to be tagged.

          Once again I have to say: thank you for your efforts!

          weichselbaumer weichselbaumer added a comment - don't know what happened here... wanted to close another issue and set this one to fixed. it isn't... I'll copy-paste my last comment for this issue in here, hope no one get's confused. Once again: Issue is not fixed.. Creating the intermediate directory now works - but somehow the last part of the tag directory is treated as a nomral intermediate directory - meaning that this also gets created in the first place - therefore I am ending up with the folder that I want to have directly in the tag directory being generated as another subdirectory... Looks like this: Tagging build in Subversion moduleLocation: Remote -> https://xxx:8443/svn/yyy/trunk/basic Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic'. There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic . Tagged as Revision 32586 moduleLocation: Remote -> https://xxx:8443/svn/yyy/trunk/basic-db Tag Base URL: 'https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db'. There was no old tag at https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db . Tagged as Revision 32584 This gets my a tag that looks like this: https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic/basic/$CONTENT https://xxx:8443/svn/yyy/tags/wc_083000_000682/basic-db/basic-db/$CONTENT I guess it looks like this, because the tag directory (wc_083000_000682) is generated and the directory I want to have in this tag directory is also being generated. Therefore I am ending up with this "../directory/directory" tag. I think you need to create all intermediate directories of the "parsedTagBaseURL" except for the last part - which is the directory that is supposed to be tagged. Once again I have to say: thank you for your efforts!
          weichselbaumer weichselbaumer made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          k2nakamura k2nakamura added a comment -

          My test case showed the problem, but I overlooked. Fixed in 1.8.

          k2nakamura k2nakamura added a comment - My test case showed the problem, but I overlooked. Fixed in 1.8.
          k2nakamura k2nakamura made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]
          abayer Andrew Bayer made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 132274 ] JNJira + In-Review [ 201283 ]

          People

            k2nakamura k2nakamura
            weichselbaumer weichselbaumer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: