Infrastructure
  1. Infrastructure
  2. INFRA-6548

SVN->JIRA service needs an option to indicate which branch received a commit

    Details

    • Type: Wish Wish
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: Initial Clearing
    • Component/s: None
    • Labels:
      None

      Description

      On the Lucene-Solr project, we had a homegrown solution thanks to [~markrmiller@gmail.com] for updating JIRA issues when there is a commit on SVN. We have recently switched to the official "ASF subversion and git services" solution. This won't be news to you, but here is a recent example of what it adds to an issue:

      {noformat}
      Commit 1502508 from [~romseygeek]
      [ https://svn.apache.org/r1502508 ]

      SOLR-4914: Close input streams as well
      {noformat}

      This is helpful, except that typically there will be two or three commits for an issue in quick succession - one to trunk, one to the stable branch (currently branch_4x) and if a release is pending, one to the release branch (currently lucene_solr_4_4), and we can't tell by looking at the comments which branch was updated by which commits. If all you have access to at a given moment is the email from JIRA, the info isn't available until later.

      I understand from danielsh on #asfinfra that this information is not trivial to extract from SVN. The homegrown solution that we were running did provide it, but it was using a git mirror, not the official apache SVN.

        Activity

        Hide
        Mark Miller added a comment -
        Our old tagged used git - and that info was easy to get. Our second solution used svnpubsub, same as the apache infra script - and that info was still easy to get. So I don't buy the hard to do with svn comment.
        Show
        Mark Miller added a comment - Our old tagged used git - and that info was easy to get. Our second solution used svnpubsub, same as the apache infra script - and that info was still easy to get. So I don't buy the hard to do with svn comment.
        Hide
        Shawn Heisey added a comment -
        Looking at some recent commits, a possible wrinkle has presented itself. One of the most recent commits to the lucene svn repository was to the CMS, not the source code. The commit email has /lucene/cms/trunk in the subject. Some other common prefixes that might come through are /lucene/dev/trunk and /lucene/dev/branches/branch_4x. These are not the only directories directly below /lucene, but they might be the only ones that we need JIRA integration on.

        The differing number of relevant directories in the prefix probably makes things a little more complicated. Perhaps it might be required to allow projects to configure multiple regex values that determine what goes into the comment, with parens enclosing the part that should be echoed? Here's some ideas that might cover Lucene:

        ^\/lucene\/(\w+\/trunk)
        ^\/lucene\/(\w+\/branches\/\w+)

        This would result in things like the following being in the comment:

        cms/trunk
        dev/trunk
        dev/branches/branch_4x

        If a supermajority of projects follow the organizational method found in Lucene, this could be hardcoded in the script, but I'm not going to make that assumption.

        There are also tags, but in theory nobody should ever be committing to a tag. If the repository doesn't enforce immutability on tags, then it would be a good idea to include a regex for that.
        Show
        Shawn Heisey added a comment - Looking at some recent commits, a possible wrinkle has presented itself. One of the most recent commits to the lucene svn repository was to the CMS, not the source code. The commit email has /lucene/cms/trunk in the subject. Some other common prefixes that might come through are /lucene/dev/trunk and /lucene/dev/branches/branch_4x. These are not the only directories directly below /lucene, but they might be the only ones that we need JIRA integration on. The differing number of relevant directories in the prefix probably makes things a little more complicated. Perhaps it might be required to allow projects to configure multiple regex values that determine what goes into the comment, with parens enclosing the part that should be echoed? Here's some ideas that might cover Lucene: ^\/lucene\/(\w+\/trunk) ^\/lucene\/(\w+\/branches\/\w+) This would result in things like the following being in the comment: cms/trunk dev/trunk dev/branches/branch_4x If a supermajority of projects follow the organizational method found in Lucene, this could be hardcoded in the script, but I'm not going to make that assumption. There are also tags, but in theory nobody should ever be committing to a tag. If the repository doesn't enforce immutability on tags, then it would be a good idea to include a regex for that.
        Hide
        Daniel Gruno added a comment -
        I am under the impression that a majority of the projects does use the paths you mentioned, and as such, I have hard-coded it in the script that if such paths are found, branch information will be added to the commens made by svngit2jira.
        Please check if this works and report back :)
        Show
        Daniel Gruno added a comment - I am under the impression that a majority of the projects does use the paths you mentioned, and as such, I have hard-coded it in the script that if such paths are found, branch information will be added to the commens made by svngit2jira. Please check if this works and report back :)
        Hide
        Shawn Heisey added a comment -
        The latest commits look good to me. If what you've got in there now will also show commits to 'cms/trunk' with that branch name, I think this is done as far as the Lucene-Solr project is concerned. I'll leave it in your capable hands for other projects.
        Show
        Shawn Heisey added a comment - The latest commits look good to me. If what you've got in there now will also show commits to 'cms/trunk' with that branch name, I think this is done as far as the Lucene-Solr project is concerned. I'll leave it in your capable hands for other projects.
        Hide
        #asfinfra IRC Bot added a comment -
        <Humbedooh> The same applies to cms/trunk, correct. I'll close this ticket for now, as I consider it fixed, but if any other issues should arise, anyone is welcome to reopen.
        Show
        #asfinfra IRC Bot added a comment - <Humbedooh> The same applies to cms/trunk, correct. I'll close this ticket for now, as I consider it fixed, but if any other issues should arise, anyone is welcome to reopen.

          People

          • Assignee:
            Daniel Gruno
            Reporter:
            Shawn Heisey
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development