Ticket #291 (closed defect: wontfix)

Opened 2 years ago

Last modified 18 months ago

example for branch in scheduler

Reported by: robert Owned by:
Priority: major Milestone: undecided
Version: 0.7.7 Keywords: scheduler branch
Cc:

Description

Hi!

In  Http://buildbot.net/repos/release/docs/buildbot.html#Schedulers is written

This Scheduler will pay attention to a single branch, ignoring Changes that occur on other branches. Setting branch equal to the special value of None means it should only pay attention to the default branch. Note that None is a keyword, not a string, so you want to use None and not "None".

I have problems with configuriring the scheduler. It starts if I configure the scheduler with None. But If I insert a branch, the scheduler doesn't work anymore. How should I define the branch? Is there a possibility to add an example to User's Manual? I could't find it.

for example my scheduler looks like that but nothing happens after a commit to our SVN-repository:

scheduler_builder_trunk = scheduler.Scheduler("trunk_64_g95", 
                                         "trunk/", 15, ["builder_trunk"])

This works:

scheduler_builder_trunk = scheduler.Scheduler("trunk_64_g95", 
                                         None, 15, ["builder_trunk"])

but buildbot mustn't start when there is a update in release-folder for example.

Thank's a lot for your help! Robert

Change History

  Changed 2 years ago by jpeg

I'm running into the same problem.

My configs look like this:

url = "http://svn.domain.com/svn/project"
src = SVNPoller(svnurl=url, pollinterval=60)
c['change_source'].append(src)

trunk_schedule = Scheduler(
    name="trunk",
    branch='trunk/',
    treeStableTimer=0,
    builderNames=["builder1", "builder2"]
    )
c['schedulers'].append(trunk_schedule)

No matter how I specify the branch in the scheduler, it doesn't pick up the change set and kick a build. Only None is working at this point.

  Changed 2 years ago by jpeg

  • type changed from enhancement to defect

  Changed 2 years ago by jpeg

Connecting into the master via manhole, I started looking into change sets via status.getChange. In each change set I reviewed, the branch attribute was empty. Every other attribute was correctly set.

I'm still digging into the cause. Hopefully there's a patch in here somewhere.

follow-up: ↓ 5   Changed 2 years ago by dustin

There are a few problems here. First, you're adding a trailing slash to the branch, which won't match. Second, commits to trunk come across as the "default" branch, which shows up as None. If you want to build only on commits to trunk, specify branch=None to the scheduler.

I'll admit the whole thing is kind of silly, and should probably be made less silly, but it *is* working as documented.

in reply to: ↑ 4   Changed 2 years ago by jedi

Been a couple of weeks, but I'm following up to this with answers the issues raised and a solution I finally settled on.

Replying to dustin:

There are a few problems here. First, you're adding a trailing slash to the branch, which won't match.

With or without the trailing slash, it still did not work.

Second, commits to trunk come across as the "default" branch, which shows up as None. If you want to build only on commits to trunk, specify branch=None to the scheduler.

Using the example I set forth in a previous comment, using None caused it to pick up every change set the poller was paying attention to, not just "trunk".

I'll admit the whole thing is kind of silly, and should probably be made less silly, but it *is* working as documented.

Not when you consider my previous statement.

I finally got branches working for continuous builds by looking at the tests for schedulers. It turns out that I needed to specify a split_file function for the SVNPoller. I copied the one I found in the test file and modified it like so:

def split_file(path):
    pieces = path.split("/")
    if pieces[0] == "branches":
        return "branches/%s" % pieces[1], "/".join(pieces[2:])
    if pieces[0] == "trunk":
        return "trunk", "/".join(pieces[1:])
    raise RuntimeError("there shouldn't be any files like %s" % path)

Works fine now and does what's expected via trunk AND branches.

  Changed 2 years ago by dustin

That is described in the documentation, but clearly not loudly enough. Like you, I was concentrating on the scheduler while assuming that the ChangeSource was correct.

Would you consider submitting a patch to the documentation or to the default master.cfg? Otherwise, please close the ticket.

  Changed 18 months ago by dustin

  • status changed from new to closed
  • resolution set to wontfix
Note: See TracTickets for help on using tickets.