[Buildbot-devel] P4 change source, p4 checkout and p4 streams

Francesco Di Mizio francescodimizio at gmail.com
Thu Feb 5 14:09:47 UTC 2015


Update: my idea was to create the workspace and then pass it in to the p4
step with p4client.

Turned out P4 won't simply use that workspace, it'll override its content.

from the docs:

p4client
(optional): The name of the client to use. In mode='full' and
mode='incremental', it's particularly important that a unique name is used
for each checkout directory to avoid incorrect synchronization. For this
reason, Python percent substitution will be performed on this value to
replace %(slave)s with the slave name and %(builder)s with the builder
name. The default is buildbot_%(slave)s_%(build)s.

well imo that's wrong. it should be: 'name of the workspeace that will
either created or changed.

To work this around I've introduced a new custom step that extends P4Source
and I just skip the workspace creation. It works as I'd expect now.

It might be good to add a param to the constructor. Something like
'create_workspace' (defaulted to True).


An other thing I've noticed with Nine:

from buildbot.plugins import schedulers, util
sch = schedulers.ForceScheduler(
             name="force",
             builderNames=["my-builder"],

             # will generate a combo box
             branch=util.ChoiceStringParameter(name="branch",
                                               choices=["main","devel"],
                                               default="main"),


 File "/home/XXXXX/master/master.cfg", line 84, in <module>
            branch=util.ChoiceStringParameter(name="branch",
choices=["main","devel"], default="main"),
        exceptions.TypeError: __init__() got an unexpected keyword argument
'branch'

Any idea about this?

On Wed, Feb 4, 2015 at 8:36 PM, Francesco Di Mizio <
francescodimizio at gmail.com> wrote:

> > What your P4 step looks like?  Specifically, p4branch parameter?
>
> I am not using p4branch at all. I was expecting the checkout to do
> something smart by itself, fetching it from the property.
> As a note - after checking latest code it seems like Branch (if passed in)
> is used to populate/edit the workspace and not on the p4 sync command.
>
> That should work anyway since the workspace's definition would shring down
> the p4 sync effect. Even in this case though teh value should come from the
> property.
>
> > If you manage to implement the core part for the new functionality, we
> should
> > be able to help to get it to the Buildbot tree.
>
> I'll be thinking about how to best tackle this. Update to come soon.
>
> Cheers,
>  Francesco
>
>
>
>
>
>
> On Wed, Feb 4, 2015 at 8:03 PM, Mikhail Sobolev <mss at mawhrin.net> wrote:
>
>> On Wed, Feb 04, 2015 at 07:24:36PM +0100, Francesco Di Mizio wrote:
>> > The juicy parts of the P4Source poller are:
>> >
>> > -       p4base='//project/'
>> > -       split_file=lambda branchfile: branchfile.split('/',1)
>> >
>> > This causes the builder to be kicked off the right way. The Branch
>> property
>> > is populated the right way, assuming values such as main and 1.2. Even
>> the
>> > changes portion on the web UI is being populated in accordance to what
>> is
>> > going on in P4.
>> >
>> > Now the part I don’t get: when I now perform a p4 checkout (using
>> > p4base='//project/' in the p4-step definition) the Branch property’s
>> value
>> > isn’t considered. The sync command turns out to be ‘sync //project/… ’
>> > instead of ‘’sync //project/Rel1.1/…’
>> What your P4 step looks like?  Specifically, p4branch parameter?
>>
>> > Part 2 – P4 Streams
>> >
>> > Well P4 introduced a while ago this new concept. They involve the
>> creation
>> > of a specific type of p4 clients, all of which is missing from the
>> current
>> > P4 checkout implementation. Is there anything planned about this? I
>> might
>> > consider working myself into this if you think it’s worth it.
>> I quickly checked the history of P4 and it looks like the last
>> _substantial_
>> changes were years ago.  So my not so educated guess would be: no,
>> nothing is
>> planned about P4.
>>
>> If you manage to implement the core part for the new functionality, we
>> should
>> be able to help to get it to the Buildbot tree.
>>
>> --
>> Misha
>>
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming. The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is
>> your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net/
>> _______________________________________________
>> Buildbot-devel mailing list
>> Buildbot-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150205/b668b329/attachment.html>


More information about the devel mailing list