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

No excludedRegions results in no changes found

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • clearcase-plugin
    • None
    • Platform: All, OS: All

    Description

      Hi!

      I've been running the latest code from trunk and have found an issue. When
      Hudson calls pollChanges it always results in false saying that no changes are
      detected. I've been doing som debugging and found that since I don't have any
      excludedRegions defined the FileFilter will always vote for false resulting in
      no detected changes.

      The UCMHistoryActionTest are missing a test that uses the actual Filters that a
      real Hudosn will be running. When i added the same filters as is created in
      ClearCaseSCM.java (method configureFilters) to the assertSuccessfulParse test it
      fails.

      @Test
      public void assertSuccessfulParse() throws Exception {
      context.checking(new Expectations() {
      {
      one(cleartool).lshistory(with(aNonNull(String.class)),
      with(aNull(Date.class)), with(equal("view")),
      with(equal("branch")),
      with(equal(new String[]

      { "vobpath" })));
      will(returnValue(new StringReader("\"20071015.151822\" \"username\"
      \"Customer\\DataSet.xsd\" \"\\main\\sit_r6a\\1\" \"create version\" \"mkelem\"
      \"activity\" "
      + "\"20071015.151822\" \"username\" \"Customer\\DataSet.xsd\"
      \"\\main\\sit_r6a\\2\" \"create version\" \"mkelem\" \"activity\" ")));
      }
      });

      List<Filter> filters = new ArrayList<Filter>();
      filters.add(new DefaultFilter());
      filters.add(new FileFilter(FileFilter.Type.DoesNotContainRegxp, ""));

      UcmHistoryAction action = new UcmHistoryAction(cleartool, filters);
      boolean hasChange = action.hasChanges(null, "view",
      new String[] { "branch" }, new String[] { "vobpath" }

      );
      assertTrue("The getChanges() method did not report a change", hasChange);
      context.assertIsSatisfied();
      }

      I don't have any proposed solution but would appreciate if someone that has
      implemented the excludedRegions functionalliy could take a look at this.

      Attachments

        Activity

          abayer Andrew Bayer added a comment -

          I'm responsible for the excludedRegions functionality - I'm traveling at the moment but I'll resolve this
          when I return mid next week.

          abayer Andrew Bayer added a comment - I'm responsible for the excludedRegions functionality - I'm traveling at the moment but I'll resolve this when I return mid next week.

          Ok, I understand. I've done a temporary fix and built my own version of the plugin.

          henrikreinhold henrikreinhold added a comment - Ok, I understand. I've done a temporary fix and built my own version of the plugin.
          abayer Andrew Bayer added a comment -

          Alright, I'm back in the States and will get on this now. First of all, when
          configureFilters() is actually called in the live plugin, it's only adding a
          filter for excluded regions if there are any defined. In the test you gave,
          you're adding a DoesNotContainRegxp filter with "" as the pattern - that, I
          think off the top of my head, will actually match anything, and so will result
          in there being no changes.

          I need to get a live environment to test against - I've added unit tests for
          testing against the behavior used with excludedRegions (though I haven't
          committed those changes yet) and they're working fine, but I need to test this
          out live to be sure.

          abayer Andrew Bayer added a comment - Alright, I'm back in the States and will get on this now. First of all, when configureFilters() is actually called in the live plugin, it's only adding a filter for excluded regions if there are any defined. In the test you gave, you're adding a DoesNotContainRegxp filter with "" as the pattern - that, I think off the top of my head, will actually match anything, and so will result in there being no changes. I need to get a live environment to test against - I've added unit tests for testing against the behavior used with excludedRegions (though I haven't committed those changes yet) and they're working fine, but I need to test this out live to be sure.
          abayer Andrew Bayer added a comment -

          Found the problem and just committed the fix - it was checking whether
          excludedRegions were null when it should have been checking if it was the empty
          string.

          abayer Andrew Bayer added a comment - Found the problem and just committed the fix - it was checking whether excludedRegions were null when it should have been checking if it was the empty string.

          Code changed in hudson
          User: : abayer
          Path:
          trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java
          trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/base/BaseHistoryActionTest.java
          trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/ucm/UcmHistoryActionTest.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=16582
          Log:
          JENKINS-3325 - excludedRegions will be empty string, not null, so changed check to fit that. Also added unit tests for FileFilter comparison to *HistoryActionTest classes.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/base/BaseHistoryActionTest.java trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/ucm/UcmHistoryActionTest.java http://fisheye4.cenqua.com/changelog/hudson/?cs=16582 Log: JENKINS-3325 - excludedRegions will be empty string, not null, so changed check to fit that. Also added unit tests for FileFilter comparison to *HistoryActionTest classes.
          abayer Andrew Bayer added a comment -

          Fixed - will be live in 0.8.2.

          abayer Andrew Bayer added a comment - Fixed - will be live in 0.8.2.
          abayer Andrew Bayer added a comment -

          Marking as verified - fixed in 0.8.2.

          abayer Andrew Bayer added a comment - Marking as verified - fixed in 0.8.2.

          People

            abayer Andrew Bayer
            henrikreinhold henrikreinhold
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: