Excludes List

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Excludes List

Brendt
Hi all,

Its been a while since my last visit, and although my company still hasn't decided to use hudson (I hope to change their minds) I wanted to come to you guys and submit an enhancement request.

Now please forgive me if this enhancement is already out there!

How about having an excludes list?  By this I mean, Hudson will not do a build if the only things that have been checked into the repository are irrelevant to the build process succeeding.  For instance at my company all our static content (*.html, *.gif, *.css, etc) are all irrelevant to our continuous builds.  It would be pretty handy if you could save creating a build JUST because you have checked in a couple irrelevant files.

So what do you think?

Thanks,
B
Reply | Threaded
Open this post in threaded view
|

Re: Excludes List

Kohsuke Kawaguchi
Administrator
Draco2k8 wrote:

> Hi all,
>
> Its been a while since my last visit, and although my company still hasn't
> decided to use hudson (I hope to change there minds) I wanted to come to you
> guys and submit an enhancement.
>
> Now please forgive me if this enhancement is already out there!
>
> How about having an excludes list?  By this I mean, Hudson will not do a
> build if the only things that have been updated are irrelevant to the build
> succeeding.  For instance at my company all our static content (*.html,
> *.gif, *.css, etc) are all irrelevant to our continuous builds.  It would be
> pretty handy if you could save creating a build JUST because you have
> checked in a couple irrelevant files.
>
> So what do you think?
The decision to start a build is done before SCM update runs, so the
only option there is either to abort a build, which would have other
implications.

Maybe what you are asking is a better SCM polling support that doesn't
trigger a build for changes in certain regions, and that would make more
sense.

I think filing an RFE would be a good thing to keep track of something
like this.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Excludes List

Brendt
kohsuke wrote
The decision to start a build is done before SCM update runs, so the
only option there is either to abort a build, which would have other
implications.
So hudson knows to do an actual build (by this I mean run the actual script that builds the project e.g. ant script, batch file, etc.) of the job before checking that the SCM has any updated files?  I don't understand VCS much at all, but that just sounds strange...or I just don't understand what you are saying, which is possible :)

kohsuke wrote
Maybe what you are asking is a better SCM polling support that doesn't
trigger a build for changes in certain regions, and that would make more
sense.
Sounds good.

Maybe I can give a better example for an excludes list:

Company VCS directory structure:

My Project (base module)
- server
  - config (configuration files for our product)
  - db      (*.sql scripts, if a dev updates this, a build would start which is not necessary because we do
               not have an auto deploy script which would run the *.sql files)
  - src     (obviously a build should occur if this is updated)
  version.properties (a versioning file that could potentially be updated using ant and ${BUILD_NUMBER}
                            from hudson, after being update it could be checked into VCS without worry that
                            hudson would kick off another build just because it had been updated.)

Determining whether or not certain file types (or expanding on that, certain folders) are necessary to a build's status (success or failure) would help prevent hudson from doing unnecessary work.

kohsuke wrote
I think filing an RFE would be a good thing to keep track of something
like this.
Would love to.  Could you point me in the right direction? (Sorry, I've never done this before).

Thanks,
B
Reply | Threaded
Open this post in threaded view
|

Re: Excludes List

Brendt
Draco2k8 wrote
Would love to.  Could you point me in the right direction? (Sorry, I've never done this before).

Thanks,
B
Done.  I hope I created it correctly
Issue 848
Reply | Threaded
Open this post in threaded view
|

Re: Excludes List

Brendt
I've finally got around to taking a look at this, and I've hacked up something that works for CVS (as CVS gets the modified files when pollChanges(...) is called).  I was hoping I could get someone to take a look at it and say if it was ok to check in?

Pretty much a user specifies some files/folders they do not want triggering builds e.g.:

server/db/*
server/src/web/*.html
tools/*

Then we iterate over the "changedFiles" list and the second a file does not much the excluded regions, we return true for pollChanges(...)

So anyone want to take a look at this?
Reply | Threaded
Open this post in threaded view
|

Re: Excludes List

Clemens Anhuth
Brendt wrote:

> I've finally got around to taking a look at this, and I've hacked up
> something that works for CVS (as CVS gets the modified files when
> pollChanges(...) is called).  I was hoping I could get someone to take a
> look at it and say if it was ok to check in?
>
> Pretty much a user specifies some files/folders they do not want triggering
> builds e.g.:
>
> server/db/*
> server/src/web/*.html
> tools/*

Brendt,

great!

Does it support ? (single character match) and stuff like
/server/*/.xyz too?



Bye bye

clemens

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Excludes List

Brendt
Clemens Anhuth wrote
Brendt,

great!

Does it support ? (single character match) and stuff like
/server/*/.xyz too?



Bye bye

clemens
Clemens,

It supports anything that Pattern.compile can compile.

I pretty much do this:

Pattern p = Pattern.compile("server/db/*");
Matcher m = p.matcher(changedFile);
boolean b = m.matches();

So I guess as long as what goes into Pattern.compile() works, it should work.
Reply | Threaded
Open this post in threaded view
|

Re: Excludes List

Kohsuke Kawaguchi
Administrator

Very cool. I suspect the use of file pattern GLOB would be more common
for file patterns, rather than regular expression, though.

And more importantly, where is the patch?  :-)


Brendt wrote:

>
> Clemens Anhuth wrote:
>>
>> Brendt,
>>
>> great!
>>
>> Does it support ? (single character match) and stuff like
>> /server/*/.xyz too?
>>
>>
>>
>> Bye bye
>>
>> clemens
>>
> Clemens,
>
> It supports anything that
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html#compile(java.lang.String)
> Pattern.compile  can compile.
>
> I pretty much do this:
>
> Pattern p = Pattern.compile("server/db/*");
> Matcher m = p.matcher(changedFile);
> boolean b = m.matches();
>
> So I guess as long as what goes into Pattern.compile() works, it should
> work.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Excludes List

Brendt

kohsuke wrote
Very cool. I suspect the use of file pattern GLOB would be more common
for file patterns, rather than regular expression, though.

And more importantly, where is the patch?  :-)

--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi@sun.com

 
Patch added to Issue 848  This doesn't include the help file.
Reply | Threaded
Open this post in threaded view
|

Re: Excludes List

Brendt
Brendt wrote
Patch added to Issue 848  This doesn't include the help file.
I found a bug in the original patch, so please review CVS_Excluded_Regions_v2.  I've also added the HTML help file.  Please see Issue 848 for the files.

I'd really like to get this into the core but don't want to check it in without it being accepted as a temporary solution.