Add zuul:value sphinx directive

The keywords 'independent' and 'dependent' for pipeline.manager
shouldn't actually have the yaml path prefix on them -- they are
literal values which should appear in the pipeline.manager dict.
It suggested that the syntax was:

  pipeline:
    manager: pipeline.manager.dependent

rather than the correct:

  pipeline:
    manager: dependent

Change-Id: I7885f5769c2faabc9ea845493e6bab9835e87b8c
This commit is contained in:
James E. Blair 2017-07-26 10:15:31 -07:00
parent 1761e8623f
commit a9648642c4
2 changed files with 24 additions and 2 deletions

View File

@ -140,7 +140,7 @@ optional unless otherwise specified):
.. _independent_pipeline_manager:
.. zuul:attr:: independent
.. zuul:value:: independent
Every event in this pipeline should be treated as independent of
other events in the pipeline. This is appropriate when the order
@ -159,7 +159,7 @@ optional unless otherwise specified):
.. _dependent_pipeline_manager:
.. zuul:attr:: dependent
.. zuul:value:: dependent
The dependent pipeline manager is designed for gating. It
ensures that every change is tested exactly as it is going to be

View File

@ -75,6 +75,26 @@ class ZuulAttrDirective(ZuulConfigObject):
targetname, '', None))
class ZuulValueDirective(ZuulConfigObject):
has_content = True
def handle_signature(self, sig, signode):
signode += addnodes.desc_name(sig, sig)
return sig
def add_target_and_index(self, name, sig, signode):
targetname = self.objtype + '-' + name
if targetname not in self.state.document.ids:
signode['names'].append(targetname)
signode['ids'].append(targetname)
signode['first'] = (not self.names)
self.state.document.note_explicit_target(signode)
indextext = '%s (%s)' % (name, self.objtype)
self.indexnode['entries'].append(('single', indextext,
targetname, '', None))
class ZuulDomain(Domain):
name = 'zuul'
label = 'Zuul'
@ -82,11 +102,13 @@ class ZuulDomain(Domain):
object_types = {
'configobject': ObjType('configobject'),
'attr': ObjType('attr'),
'value': ObjType('value'),
}
directives = {
'configobject': ZuulConfigobjectDirective,
'attr': ZuulAttrDirective,
'value': ZuulValueDirective,
}