[JIRA] (JENKINS-41526) "Filter for Poll SCM" detects changes on similarly named folders

2 views
Skip to first unread message

zerotim@gmail.com (JIRA)

unread,
Jan 27, 2017, 1:48:02 PM1/27/17
to jenkinsc...@googlegroups.com
Timothy Williams created an issue
 
Jenkins / Bug JENKINS-41526
"Filter for Poll SCM" detects changes on similarly named folders
Issue Type: Bug Bug
Assignee: Joseph Petersen
Components: accurev-plugin
Created: 2017/Jan/27 6:47 PM
Environment: Jenkins Version 2.32.1
AccuRev Plugin Version 0.7.9
Labels: regression
Priority: Major Major
Reporter: Timothy Williams

"Filter for Poll SCM" detects changes on similarly named folders.

We have three folders in the root of the stream named "hi-lib", "hi-lib-dal", and "hi-lib-dal-mongo". The "Filter for Poll SCM" for each folder job is set as "hi-lib/", "hi-lib-dal/", and "hi-lib-dal-mongo/". This is because without the trailing forward-slash AccuRev Plugin Version 0.7.6 would detect changes in each job even if changes were only promoted to one folder - adding the forward-slash resolved that issue.

With AccuRev Plugin Version 0.7.9, after promoting a change to "hi-lib-dal-mongo", all three builds started for detected changes in all three folders even though only "hi-lib-dal-mongo" contained a promoted change.

It appears something changed in AccuRev Plugin Version 0.7.9 that broke the polling and filtering by folders by ignoring the forward-slash that denoted the end of the folder name. Is there another way I should qualify the "Filter for Poll SCM" value? Thanks.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

josephp90@gmail.com (JIRA)

unread,
Jan 29, 2017, 3:32:01 PM1/29/17
to jenkinsc...@googlegroups.com
Joseph Petersen commented on Bug JENKINS-41526
 
Re: "Filter for Poll SCM" detects changes on similarly named folders

will simple wildcard works?

so in your case it would be
hi-lib/
hi-lib-dal/
hi-lib-dal-mongo/
?
or perhaps targeting both main and test scope
src//java/*

Your welcome to take a look at the current implementation and come with a PR
https://github.com/jenkinsci/accurev-plugin/blob/master/src/main/java/hudson/plugins/accurev/CheckForChanges.java

josephp90@gmail.com (JIRA)

unread,
Jan 29, 2017, 3:32:01 PM1/29/17
to jenkinsc...@googlegroups.com
Joseph Petersen edited a comment on Bug JENKINS-41526
will simple wildcard works?

so in your case it would be

{code:java}
*hi-lib/*
*hi-lib-dal/*
*hi-lib-dal-mongo/*
{code}

?
or perhaps targeting both main and test scope

{code:java}
*src/*/java/*
{code}


Your welcome to take a look at the current implementation and come with a PR
https://github.com/jenkinsci/accurev-plugin/blob/master/src/main/java/hudson/plugins/accurev/CheckForChanges.java

josephp90@gmail.com (JIRA)

unread,
Jan 29, 2017, 3:33:01 PM1/29/17
to jenkinsc...@googlegroups.com
Joseph Petersen edited a comment on Bug JENKINS-41526
will simple wildcard works?

so in your case it would be
for each job. They can still be comma seperated if you need more filters

{code:java}
*hi-lib/*
*hi-lib-dal/*
*hi-lib-dal-mongo/*
{code}

?
or perhaps targeting both main and test scope

{code:java}
*src/*/java/*
{code}


Your welcome to take a look at the current implementation and come with a PR
https://github.com/jenkinsci/accurev-plugin/blob/master/src/main/java/hudson/plugins/accurev/CheckForChanges.java

josephp90@gmail.com (JIRA)

unread,
Jan 29, 2017, 3:36:01 PM1/29/17
to jenkinsc...@googlegroups.com
Joseph Petersen edited a comment on Bug JENKINS-41526
will simple wildcard works?

so in your case it would be for each job. They can still be comma seperated if you need more filters

{code:java}
*hi-lib/*
*hi-lib-dal/*
*hi-lib-dal-mongo/*
{code}

?
or perhaps targeting both main and test scope

{code:java}
*src/*/java/*
{code}


Your welcome to take a look at the current implementation and come with a PR

josephp90@gmail.com (JIRA)

unread,
Jan 29, 2017, 3:36:01 PM1/29/17
to jenkinsc...@googlegroups.com
Joseph Petersen edited a comment on Bug JENKINS-41526
will simple wildcard works?

so in your case it would be for each job. They can still be comma seperated if you need more filters

{code:java}
*hi-lib/*
*hi-lib-dal/*
*hi-lib-dal-mongo/*
{code}

?
or perhaps targeting both main and test scope

{code:java}
*src/*/java/*
{code}


Your welcome to take a look at the current implementation and come with a PR
https://github.com/jenkinsci/accurev-plugin/blob/master/src/main/java/hudson/plugins/accurev/CheckForChanges.java

josephp90@gmail.com (JIRA)

unread,
Jan 29, 2017, 3:37:01 PM1/29/17
to jenkinsc...@googlegroups.com
Joseph Petersen edited a comment on Bug JENKINS-41526
will simple wildcard works work ?


so in your case it would be for each job. They can still be comma seperated if you need more filters

{code:java}
*hi-lib/*
*hi-lib-dal/*
*hi-lib-dal-mongo/*
{code}

?
or perhaps targeting both main and test scope

{code:java}
*src/*/java/*
{code}


Your welcome to take a look at the current implementation and come with a PR

josephp90@gmail.com (JIRA)

unread,
Jan 30, 2017, 3:17:01 AM1/30/17
to jenkinsc...@googlegroups.com

Arno Moonen Since you refactored it last, perhaps you have a better suggestion on the issue?

arno@90a.nl (JIRA)

unread,
Jan 30, 2017, 4:10:01 AM1/30/17
to jenkinsc...@googlegroups.com

The filter is currently pretty.. well, ugly. It simply checks if the path contains the strings from the filter list.
I did not think of this particular use case when refactoring the code, otherwise I would not have included the / in the STRIP_CHARS (see line 133 of CheckForChanges.java).
I'm in favor of removing the STRIP_CHARS variable and calling StringUtils.stripAll with only a single argument.
This will only strip all the whitespace from the strings.

I would also propose to change line 110 in CheckForChanges.java, replacing the call to StringUtils.indexOfAny with StringUtils.startsWithAny.
However, we should make sure that the "root" of the paths is the same in all conditions.

It would be even better to allow for the "Ant-style" include patterns (which would allow for wildcards and such), but I would have to look into that.

josephp90@gmail.com (JIRA)

unread,
Jan 30, 2017, 4:21:01 AM1/30/17
to jenkinsc...@googlegroups.com

I looked into ant style most of the implementation requires that the files exist. Which in this case they do not.
So all I could do was simple wildcard without implementing too much.

I checked and server paths given are based on folders and files structure of the current stream

zerotim@gmail.com (JIRA)

unread,
Mar 20, 2017, 8:10:02 PM3/20/17
to jenkinsc...@googlegroups.com
Timothy Williams closed an issue as Fixed
 

Verified appending * to polling folder path resolved this issue. Verified with version 0.7.11.

Change By: Timothy Williams
Status: Open Closed
Resolution: Fixed
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

josephp90@gmail.com (JIRA)

unread,
Mar 7, 2020, 1:08:07 AM3/7/20
to jenkinsc...@googlegroups.com
Joseph Petersen assigned an issue to Joseph Petersen
Change By: Joseph Petersen
Assignee: Joseph Petersen (old)
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages