Maven 1.x Changelog Plugin
  1. Maven 1.x Changelog Plugin
  2. MPCHANGELOG-36

changelog.xml author tag in Clearcase contains developer.id

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Clearcase, Windows XP
    • Number of attachments :
      3

      Description

      With exactly the same project.xml I see this type of thing in the changelog.xml generated using the CVS changelog factory:

      <changelog-entry>
      <date>2004-04-14</date>
      <time>11:05:28</time>
      <author><![CDATA[Matt Read]]></author>

      However with Clearcase factory I get this:

      <changelog-entry>
      <date>2004-04-15</date>
      <time>10:28:28</time>
      <author><![CDATA[readm ]]></author>

      I.e. it's using the developer.id from project.xml instead of the developer.name. It's also padding with whitespace which might also be causing problems.

      Symptoms of this are that although the changelog report and file activity reports are correct, the Developer Activity report is blank as it's unable to match author to name.

      1. ClearcaseChangeLogParserTest.java
        3 kB
        Matt Read
      2. clearcaselog.txt
        0.7 kB
        Matt Read
      3. username_patch.txt
        0.8 kB
        Matt Read

        Activity

        Hide
        Matt Read added a comment -

        Adding a .trim() to the setAuthor() method when parsing the output of the "cleartool lshistory" command in ClearcaseChangeLogParser.java fixes the majority of problems, EXCEPT when the Clearcase user id is longer than 8 characters. I'll work on a more complete patch when I have more than 5 mins.

        Index: ClearcaseChangeLogParser.java
        ===================================================================
        RCS file: /home/cvspublic/maven-plugins/changelog/src/main/org/apache/maven/clearcaselib/ClearcaseChangeLogParser.java,v
        retrieving revision 1.3
        diff -u -r1.3 ClearcaseChangeLogParser.java
        — ClearcaseChangeLogParser.java 2 Mar 2004 15:00:18 -0000 1.3
        +++ ClearcaseChangeLogParser.java 26 Apr 2004 14:15:03 -0000
        @@ -250,7 +250,7 @@
        }
        else if (line.startsWith(USER_TAG))
        {

        • getCurrentLogEntry().setAuthor(line.substring(USER_TAG.length()));
          + getCurrentLogEntry().setAuthor(line.substring(USER_TAG.length()).trim());
          // add entry, and set state to get file
          addEntry(getCurrentLogEntry(), getCurrentFile());
          setStatus(GET_FILE);
        Show
        Matt Read added a comment - Adding a .trim() to the setAuthor() method when parsing the output of the "cleartool lshistory" command in ClearcaseChangeLogParser.java fixes the majority of problems, EXCEPT when the Clearcase user id is longer than 8 characters. I'll work on a more complete patch when I have more than 5 mins. Index: ClearcaseChangeLogParser.java =================================================================== RCS file: /home/cvspublic/maven-plugins/changelog/src/main/org/apache/maven/clearcaselib/ClearcaseChangeLogParser.java,v retrieving revision 1.3 diff -u -r1.3 ClearcaseChangeLogParser.java — ClearcaseChangeLogParser.java 2 Mar 2004 15:00:18 -0000 1.3 +++ ClearcaseChangeLogParser.java 26 Apr 2004 14:15:03 -0000 @@ -250,7 +250,7 @@ } else if (line.startsWith(USER_TAG)) { getCurrentLogEntry().setAuthor(line.substring(USER_TAG.length())); + getCurrentLogEntry().setAuthor(line.substring(USER_TAG.length()).trim()); // add entry, and set state to get file addEntry(getCurrentLogEntry(), getCurrentFile()); setStatus(GET_FILE);
        Hide
        Brett Porter added a comment -

        ok, we'll wait for the extended patch. Please attach to the issue instead of posting inline.

        Show
        Brett Porter added a comment - ok, we'll wait for the extended patch. Please attach to the issue instead of posting inline.
        Hide
        Matt Read added a comment -

        I've attached a new test that recreates the problem. Let me know if you'd prefer this as a patch from the root of the project.

        Show
        Matt Read added a comment - I've attached a new test that recreates the problem. Let me know if you'd prefer this as a patch from the root of the project.
        Hide
        Matt Read added a comment -

        And the example Clearcase output log required for the test to execute.

        Show
        Matt Read added a comment - And the example Clearcase output log required for the test to execute.
        Hide
        Matt Read added a comment -

        And the patch which makes the test pass.

        Show
        Matt Read added a comment - And the patch which makes the test pass.
        Hide
        Matt Read added a comment -

        These files will both test and fix the issue that I originally reported however there is still a problem if the developer.id in project.xml is longer than 8 characters.

        I'm not sure how to write a test for this as it depends on the plugin.jelly executing and I'm not familiar enough with Maven to know how to do that.

        I'm also unsure what the fix would look like as code is not product specific (ChangeLog.replaceAuthorIdWithName()).

        Let me know if I can help, otherwise I'd suggest including a note in the documentation for Clearcase users.

        Matt.

        Show
        Matt Read added a comment - These files will both test and fix the issue that I originally reported however there is still a problem if the developer.id in project.xml is longer than 8 characters. I'm not sure how to write a test for this as it depends on the plugin.jelly executing and I'm not familiar enough with Maven to know how to do that. I'm also unsure what the fix would look like as code is not product specific (ChangeLog.replaceAuthorIdWithName()). Let me know if I can help, otherwise I'd suggest including a note in the documentation for Clearcase users. Matt.
        Hide
        dion gillard added a comment -

        Applied

        Show
        dion gillard added a comment - Applied

          People

          • Assignee:
            Unassigned
            Reporter:
            Matt Read
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: