[Buildbot-commits] [Buildbot] #2526: Un-started build steps with properties in descriptions fail

Buildbot trac trac at buildbot.net
Wed Aug 21 00:36:29 UTC 2013


#2526: Un-started build steps with properties in descriptions fail
---------------------+------------------------
Reporter:  cmumford  |       Owner:
    Type:  defect    |      Status:  new
Priority:  major     |   Milestone:  undecided
 Version:  0.8.7p1   |  Resolution:
Keywords:            |
---------------------+------------------------

Comment (by cmumford):

 Replying to [comment:7 dustin]:
 > Well, I'm suggesting a patch that would modify `describe` directly.
 >
 > There are some escapes you can use in Interpolate references to
 translate None to an empty string or some other string.
 So I originally stuck with my IRenderable solution, but later on started
 to use Buildbot's JSON API and discovered that these new classes also
 needed to be JSON serializable. So I switched to your solution which
 worked around that problem as well:


 {{{
 class TestShellCommand(ShellCommand):
     def __init__(self, workdir=None,
                  description=None, descriptionDone=None,
 descriptionSuffix=None,
                  command=None,
                  usePTY="slave-config",
                  title='Default Title',
                  **kwargs):
         super(TestShellCommand, self).__init__(workdir, description,
             descriptionDone, descriptionSuffix, command, usePTY, **kwargs)
         self.title = title

     def describe(self, done=False):
         build_no = self.getProperty("test_build_num", '0')
         build_no_class = GetBuildNumberCssStyle(build_no)
         branch = self.getProperty("branch", 'master?')
         if branch == '':
             branch = 'master?'
         ret = ["Branch: <span class='BuildBranch'>%s</span>" % branch,
                     "Build: <span class='%s'>%s</span>"%(build_no_class,
 build_no),
                     self.title]
         if not done:
             ret.append("(Running)")
         return ret
 }}}

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2526#comment:8>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list