Ticket #87: customprops-fix-debugclient.patch

File customprops-fix-debugclient.patch, 2.4 kB (added by gward, 1 year ago)

Teach DebugPerspective? and debugclient about custom build properties

  • a/buildbot/clients/debug.py

    old new  
    105105            if revision == '': 
    106106                revision = None 
    107107        reason = "debugclient 'Request Build' button pushed" 
     108        custom_props = {} 
    108109        d = self.remote.callRemote("requestBuild", 
    109                                    name, reason, branch, revision
     110                                   name, reason, branch, revision, custom_props
    110111        d.addErrback(self.err) 
    111112 
    112113    def do_ping(self, widget): 
  • a/buildbot/master.py

    old new  
    227227    def detached(self, mind): 
    228228        pass 
    229229 
    230     def perspective_requestBuild(self, buildername, reason, branch, revision): 
     230    def perspective_requestBuild(self, buildername, reason, branch, revision, custom_props): 
     231        assert isinstance(custom_props, dict), \ 
     232               "custom_props must be a dict (not %r)" % (custom_props,) 
     233 
     234        # Provide default values for any custom build properties the 
     235        # client did not send. 
     236        for propertyDict in (self.master.customBuildProperties or []): 
     237            custom_props.setdefault(propertyDict['propertyName'], "") 
     238 
    231239        c = interfaces.IControl(self.master) 
    232240        bc = c.getBuilder(buildername) 
    233241        ss = SourceStamp(branch, revision) 
    234         br = BuildRequest(reason, ss, buildername) 
     242        br = BuildRequest(reason, ss, custom_props, buildername) 
    235243        bc.requestBuild(br) 
    236244 
    237245    def perspective_pingBuilder(self, buildername): 
  • a/buildbot/process/base.py

    old new  
    6060        # TODO: remove the =None on builderName, it is there so I don't have 
    6161        # to change a lot of tests that create BuildRequest objects 
    6262        assert interfaces.ISourceStamp(source, None) 
    63         assert custom_props is not None, "custom_props must not be None" 
     63        assert isinstance(custom_props, dict), \ 
     64               "custom_props must be a dict (not %r)" % (custom_props,) 
    6465        self.reason = reason 
    6566        self.source = source 
    6667        self.custom_props = custom_props