Skip to content

Commit

Permalink
add :bb:src:.., :bb🐛.., and :bb:pull:.. sphinx roles
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Nov 12, 2011
1 parent 93712b4 commit 571e764
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 20 deletions.
47 changes: 47 additions & 0 deletions master/docs/bbdocs/ext.py
Expand Up @@ -142,6 +142,49 @@ def make_index(name, localname):
(BBIndex,),
dict(name=name, localname=localname))

class BugRole(object):
"""
A role to create a link to a Trac bug, by number
"""

def __call__(self, typ, rawtext, text, lineno, inliner,
options={}, content=[]):
bugnum = text.lstrip('#')
node = nodes.reference('', '')
node['refuri'] = 'http://trac.buildbot.net/ticket/%s' % bugnum
node['reftitle'] = title = 'bug #%s' % bugnum
node.append(nodes.Text(title))
return [ node ], []


class SrcRole(object):
"""
A role to link to buildbot source on master
"""

def __call__(self, typ, rawtext, text, lineno, inliner,
options={}, content=[]):
node = nodes.reference('', '')
node['refuri'] = (
'https://github.com/buildbot/buildbot/blob/master/%s' % text )
node['reftitle'] = title = 'pull request %s' % text
node.append(nodes.literal(title, title))
return [ node ], []


class PullRole(object):
"""
A role to link to a buildbot pull request
"""

def __call__(self, typ, rawtext, text, lineno, inliner,
options={}, content=[]):
node = nodes.reference('', '')
node['refuri'] = ('https://github.com/buildbot/buildbot/pull/' + text)
node['reftitle'] = title = 'pull request %s' % text
node.append(nodes.Text(title, title))
return [ node ], []


class BBDomain(Domain):
name = 'bb'
Expand Down Expand Up @@ -198,6 +241,10 @@ class BBDomain(Domain):
'cmdline' : XRefRole(),

'index' : XRefRole(),

'bug' : BugRole(),
'src' : SrcRole(),
'pull' : PullRole(),
}

initial_data = {
Expand Down
18 changes: 9 additions & 9 deletions master/docs/developer/database.rst
Expand Up @@ -941,7 +941,7 @@ handled through the model.
``master.db.model.buildrequests``, and columns are available in its ``c``
attribute.

The source file, ``master/buildbot/db/model.py``, contains comments
The source file, :bb:src:`master/buildbot/db/model.py`, contains comments
describing each table; that information is not replicated in this
documentation.

Expand Down Expand Up @@ -1041,23 +1041,23 @@ To make a change to the schema, first consider how to handle any existing data.
When adding new columns, this may not be necessary, but table refactorings can
be complex and require caution so as not to lose information.

Create a new script in ``master/buildbot/db/migrate/versions``, following the
numbering scheme already present. The script should have an ``update`` method,
which takes an engine as a parameter, and ugprades the database, both changing
the schema and performing any required data migrations. The engine passed to
this parameter is "enhanced" by SQLAlchemy-Migrate, with methods to handle
adding, altering, and dropping columns. See the SQLAlchemy-Migrate
Create a new script in :bb:src:`master/buildbot/db/migrate/versions`, following
the numbering scheme already present. The script should have an ``update``
method, which takes an engine as a parameter, and ugprades the database, both
changing the schema and performing any required data migrations. The engine
passed to this parameter is "enhanced" by SQLAlchemy-Migrate, with methods to
handle adding, altering, and dropping columns. See the SQLAlchemy-Migrate
documentation for details.

Finally, modify ``master/buildbot/db/model.py`` to represent the updated
Finally, modify :bb:src:`master/buildbot/db/model.py` to represent the updated
schema. Buildbot's automated tests perform a rudimentary comparison of an
upgraded database with the model, but it is important to check the details -
key length, nullability, and so on can sometimes be missed by the checks. If
the schema and the upgrade scripts get out of sync, bizarre behavior can
result.

Finally, adjust the fake database table definitions in
``master/buildbot/test/fake/fakedb.py`` according to your changes.
:bb:src:`master/buildbot/test/fake/fakedb.py` according to your changes.

Database Compatibility Notes
----------------------------
Expand Down
14 changes: 6 additions & 8 deletions master/docs/manual/cfg-statustargets.rst
Expand Up @@ -249,13 +249,12 @@ be used to access them.
By adding one or more ``name=`` query arguments to the URL, the console view is
restricted to only showing changes made by the given users.

NOTE: To use this page, your :file:`buildbot.css` file in :file:`public_html`
must be the one found in
:file:`master/buildbot/status/web/files/default.css`. This is the
default for new installs, but upgrades of very old installs of
Buildbot may need to manually fix the CSS file.
NOTE: To use this page, your :file:`buildbot.css` file in
:file:`public_html` must be the one found in
:bb:src:`master/buildbot/status/web/files/default.css`. This is the default
for new installs, but upgrades of very old installs of Buildbot may need to
manually fix the CSS file.


The console view is still in development. At this moment by
default the view sorts revisions lexically, which can lead to odd
behavior with non-integer revisions (e.g., git), or with integer
Expand All @@ -266,7 +265,6 @@ be used to access them.
sorting revisions, although it depends on the date being set
correctly in each commit::

w = html.WebStatus(http_port=8080, order_console_by_time=True)

``/rss``
Expand Down Expand Up @@ -636,7 +634,7 @@ Change Hooks

The ``/change_hook`` url is a magic URL which will accept HTTP requests and translate
them into changes for buildbot. Implementations (such as a trivial json-based endpoint
and a GitHub implementation) can be found in :file:`master/buildbot/status/web/hooks`.
and a GitHub implementation) can be found in :bb:src:`master/buildbot/status/web/hooks`.
The format of the url is :samp:`/change_hook/{DIALECT}` where DIALECT is a package within the
hooks directory. Change_hook is disabled by default and each DIALECT has to be enabled
separately, for security reasons
Expand Down
6 changes: 3 additions & 3 deletions master/docs/release-notes.rst
Expand Up @@ -18,13 +18,13 @@ Deprecations, Removals, and Non-Compatible Changes
If you are using this functionality, consider invoking make directly.

* The ``buildbot sendchange`` option ``--username`` has been removed as
promised in bug #1711.
promised in :bb:bug:`1711`.

Features
~~~~~~~~

* Buildbot can now take advantage of authentication done by a front-end web
server: https://github.com/buildbot/buildbot/pull/266
server - see :bb:pull:`266`.

Slave
-----
Expand All @@ -47,5 +47,5 @@ Older Versions
--------------

Release notes for older versions of Buildbot are available in the
``master/docs/release-notes/`` directory of the source tree, or in the archived
:bb:src:`master/docs/release-notes/` directory of the source tree, or in the archived
documentation for those versions at http://buildbot.net/buildbot/docs.

0 comments on commit 571e764

Please sign in to comment.