[users at bb.net] buildbot sendchange: FILENAMES argument: how is it used?

Linus Arver linusarver at gmail.com
Fri Jun 2 20:23:39 UTC 2017


On Thu, Jun 01, 2017 at 10:20:15PM -0400, Charles Lepple wrote:
> On Jun 1, 2017, at 8:33 PM, Linus Arver wrote:
> > 
> > Hello all,
> > 
> > The usage for `buildbot sendchange' command is:
> > 
> >    buildbot sendchange --master {MASTERHOST}:{PORT} --auth {USER}:{PASS}
> >            --who {USER} {FILENAMES..}
> > 
> > The current docs [1] (and also docs going back to Buildbot 0.8.1 [2])
> > about the `sendchange' command makes no mention of the FILENAMES
> > argument, or how it is used. Can someone point me in the right
> > direction?
> 
> I'm extrapolating a bit (having mostly used pollers and the GitHub hook listener), but sendchange is constructing a Change object, such as the one shown here:
> 
> http://buildbot.buildbot.net/changes/17193 <http://buildbot.buildbot.net/changes/17193>
> 
> Note the list of changed files at the end.
> 
> https://github.com/buildbot/buildbot/blob/eight/master/buildbot/scripts/runner.py#L291 <https://github.com/buildbot/buildbot/blob/eight/master/buildbot/scripts/runner.py#L291>
> 
> https://github.com/buildbot/buildbot/blob/master/master/buildbot/scripts/runner.py#L225 <https://github.com/buildbot/buildbot/blob/master/master/buildbot/scripts/runner.py#L225>
> 
> The svnpoller script has an example of this:
> 
> https://github.com/buildbot/buildbot/blob/eight/master/contrib/svnpoller.py#L83 <https://github.com/buildbot/buildbot/blob/eight/master/contrib/svnpoller.py#L83>
> 

Ah, that makes sense. Reading the documentation of PBChangeSource, I
realize that the FILENAMES from `sendchange' also interacts with the
`prefix' parameter (by default it is None, but otherwise this acts as a
filename filter to remove those filenames that do not start with the
given prefix). [1] The docs there also say

    If all the filenames in a given Change are removed, the that whole
    Change will be dropped.

so it appears that (presumably) the FILENAMES argument to `sendchange'
cannot be empty --- although as of 0.9.7 when I do

    buildbot sendchange --master=localhost:9989 --who=foo --codebase=website

I get in the buildmaster logs

    2017-06-02 20:02:48+0000 [Broker,1,127.0.0.1] perspective_addChange called
    2017-06-02 20:02:48+0000 [Broker,1,127.0.0.1] No files listed in change... bit strange, but not fatal.
    2017-06-02 20:02:48+0000 [-] added change with revision None to database

so the change does get added even if there are no filenames specified.
Perhaps the docs meant the word "dropped" to mean exactly the behavior I
observed.

> If your source control system makes it difficult or expensive to get a list of changed files, you might be able to get away with a dummy filename (since your Source step will most likely be checking things out based on the revision identifier), but then scheduler features like fileIsImportant won't work.

Thank you for the clarification. FWIW I sense that the filenames gets
"filtered" by `prefix' parameter in PBChangeSource, and if it passes
this stage then the Scheduler can filter it again with
`fileIsImportant'; i.e., it gives us more granularity on deciding when
to ultimately trigger a build. Although, in most cases the VCS will only
care about the revision (not file names, as you pointed out) so it
doesn't really matter in the end for most people.

For the record I have seen a case where a dummy filename has been used
(exactly as you've suggested) without issue, although the use of the
dummy file seems to have been unintentional.

Linus

[1]: http://docs.buildbot.net/latest/manual/cfg-changesources.html#pbchangesource


More information about the users mailing list