Skip to content

Commit

Permalink
- Moved updates classes to their respective rst file.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewongbb committed Jan 16, 2013
1 parent 392b10a commit c520838
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 113 deletions.
113 changes: 0 additions & 113 deletions master/docs/developer/data.rst
Expand Up @@ -123,119 +123,6 @@ Within the buildmaster process, the root of the data API is available at `self.m
These attributes allow resource types to access one another for purposes of coordination.
They are *not* intended for external access -- all external access to the data API should be via the methods above or update methods.


Updates
.......

The updates section is available at `self.master.data.updates`, and contains a number of ad-hoc methods needed by the process modules.

.. note:
The update methods are implemented in resource type classes, but through some initialization-time magic, all appear as attributes of ``self.master.data.updates``.
All update methods return a Deferred.

.. py:class:: buildbot.data.changes.ChangeResourceType
.. py:method:: addChange(files=None, comments=None, author=None, revision=None, when_timestamp=None, branch=None, category=None, revlink='', properties={}, repository='', codebase=None, project='', src=None)
:param files: a list of filenames that were changed
:type files: list of unicode strings
:param unicode comments: user comments on the change
:param unicode author: the author of this change
:param unicode revision: the revision identifier for this change
:param integer when_timestamp: when this change occurred (seconds since the epoch), or the current time if None
:param unicode branch: the branch on which this change took place
:param unicode category: category for this change
:param string revlink: link to a web view of this revision
:param properties: properties to set on this change. Note that the property source is *not* included in this dictionary.
:type properties: dictionary with unicode keys and simple values (JSON-able).
:param unicode repository: the repository in which this change took place
:param unicode project: the project this change is a part of
:param unicode src: source of the change (vcs or other)
:returns: the ID of the new change, via Deferred

Add a new change to Buildbot.
This method is the interface between change sources and the rest of Buildbot.

All parameters should be passed as keyword arguments.

All parameters labeled 'unicode' must be unicode strings and not bytestrings.
Filenames in ``files``, and property names, must also be unicode strings.
This is tested by the fake implementation.

.. py:class:: buildbot.data.changes.MasterResourceType
.. py:method:: masterActive(name, masterid)
:param unicode name: the name of this master (generally ``hostname:basedir``)
:param integer masterid: this master's master ID
:returns: Deferred

Mark this master as still active.
This method should be called at startup and at least once per minute.
The master ID is acquired directly from the database early in the master startup process.

.. py:method:: expireMasters()
:returns: Deferred

Scan the database for masters that have not checked in for ten minutes.
This method should be called about once per minute.

.. py:method:: masterStopped(name, masterid)
:param unicode name: the name of this master
:param integer masterid: this master's master ID
:returns: Deferred

Mark this master as inactive.
Masters should call this method before completing an expected shutdown.
This method will take care of deactivating or removing configuration resources like builders and schedulers as well.

.. py:class:: buildbot.data.changes.BuildsetResourceType
.. py:method:: addBuildset(scheduler=None, sourcestamps=[], reason='', properties={}, builderNames=[], external_idstring=None)
:param string scheduler: the name of the scheduler creating this buildset
:param list sourcestamps: sourcestamps for the new buildset; see below
:param unicode reason: the reason for this build
:param unicode reason: the reason for this build
:param properties: properties to set on this buildset
:type properties: dictionary with unicode keys and (source, property value) values
:param list builderNames: names of the builders for which build requests should be created
:param unicode external_idstring: arbitrary identifier to recognize this buildset later
:returns: (buildset id, dictionary mapping builder names to build request ids) via Deferred

.. warning:
The ``scheduler`` parameter will be replaced with a ``schedulerid`` parameter in future releases.
The ``builderNames`` parameter will be replaced with a ``builderIds`` parameter in future releases.
Create a new buildset and corresponding buildrequests based on the given parameters.
This is the low-level interface for scheduling builds.

Each sourcestamp in the list of sourcestamps can be given either as an integer, assumed to be a sourcestamp ID, or a dictionary of keyword arguments to be passed to :py:meth:`~buildbot.db.sourcestamps.SourceStampsConnectorComponent.findSourceStampId`.

.. py:method:: maybeBuildsetComplete(bsid)
:param integer bsid: buildset that may be complete
:returns: Deferred

This method should be called when a build request is finished.
It checks the given buildset to see if all of its buildrequests are finished.
If so, it updates the status of the buildset and send the appropriate messages.

.. py:class:: buildbot.data.changes.BuilderResourceType
.. py:method:: updateBuilderList(masterid, builderNames)
:param integer masterid: this master's master ID
:param list builderNames: list of names of currently-configured builders (unicode strings)
:returns: Deferred

Record the given builders as the currently-configured set of builders on this master.
Masters should call this every time the list of configured builders changes.

Links
.....

Expand Down
22 changes: 22 additions & 0 deletions master/docs/developer/rtype-builder.rst
Expand Up @@ -43,3 +43,25 @@ Builders

This path selects a specific builder, identified by ID.
If the given builder is not running on the given master, this path returns nothing.

Updates
.......

The updates section is available at `self.master.data.updates`, and contains a number of ad-hoc methods needed by the process modules.

.. note:
The update methods are implemented in resource type classes, but through some initialization-time magic, all appear as attributes of ``self.master.data.updates``.
All update methods return a Deferred.

.. py:class:: buildbot.data.changes.BuilderResourceType
.. py:method:: updateBuilderList(masterid, builderNames)
:param integer masterid: this master's master ID
:param list builderNames: list of names of currently-configured builders (unicode strings)
:returns: Deferred

Record the given builders as the currently-configured set of builders on this master.
Masters should call this every time the list of configured builders changes.

44 changes: 44 additions & 0 deletions master/docs/developer/rtype-buildset.rst
Expand Up @@ -43,3 +43,47 @@ Buildsets

.. todo:
Consuming from this path selects and :bb:event:`buildset.$bsid.complete` events for this buildset.
Updates
.......

The updates section is available at `self.master.data.updates`, and contains a number of ad-hoc methods needed by the process modules.

.. note:
The update methods are implemented in resource type classes, but through some initialization-time magic, all appear as attributes of ``self.master.data.updates``.
All update methods return a Deferred.

.. py:class:: buildbot.data.changes.BuildsetResourceType
.. py:method:: addBuildset(scheduler=None, sourcestamps=[], reason='', properties={}, builderNames=[], external_idstring=None)
:param string scheduler: the name of the scheduler creating this buildset
:param list sourcestamps: sourcestamps for the new buildset; see below
:param unicode reason: the reason for this build
:param unicode reason: the reason for this build
:param properties: properties to set on this buildset
:type properties: dictionary with unicode keys and (source, property value) values
:param list builderNames: names of the builders for which build requests should be created
:param unicode external_idstring: arbitrary identifier to recognize this buildset later
:returns: (buildset id, dictionary mapping builder names to build request ids) via Deferred

.. warning:
The ``scheduler`` parameter will be replaced with a ``schedulerid`` parameter in future releases.
The ``builderNames`` parameter will be replaced with a ``builderIds`` parameter in future releases.
Create a new buildset and corresponding buildrequests based on the given parameters.
This is the low-level interface for scheduling builds.

Each sourcestamp in the list of sourcestamps can be given either as an integer, assumed to be a sourcestamp ID, or a dictionary of keyword arguments to be passed to :py:meth:`~buildbot.db.sourcestamps.SourceStampsConnectorComponent.findSourceStampId`.

.. py:method:: maybeBuildsetComplete(bsid)
:param integer bsid: buildset that may be complete
:returns: Deferred

This method should be called when a build request is finished.
It checks the given buildset to see if all of its buildrequests are finished.
If so, it updates the status of the buildset and send the appropriate messages.

40 changes: 40 additions & 0 deletions master/docs/developer/rtype-change.rst
Expand Up @@ -43,3 +43,43 @@ Changes
:pathkey integer changeid: the ID of the change

This path selects a specific change, identified by ID.

Updates
.......

The updates section is available at `self.master.data.updates`, and contains a number of ad-hoc methods needed by the process modules.

.. note:
The update methods are implemented in resource type classes, but through some initialization-time magic, all appear as attributes of ``self.master.data.updates``.
All update methods return a Deferred.

.. py:class:: buildbot.data.changes.ChangeResourceType
.. py:method:: addChange(files=None, comments=None, author=None, revision=None, when_timestamp=None, branch=None, category=None, revlink='', properties={}, repository='', codebase=None, project='', src=None)
:param files: a list of filenames that were changed
:type files: list of unicode strings
:param unicode comments: user comments on the change
:param unicode author: the author of this change
:param unicode revision: the revision identifier for this change
:param integer when_timestamp: when this change occurred (seconds since the epoch), or the current time if None
:param unicode branch: the branch on which this change took place
:param unicode category: category for this change
:param string revlink: link to a web view of this revision
:param properties: properties to set on this change. Note that the property source is *not* included in this dictionary.
:type properties: dictionary with unicode keys and simple values (JSON-able).
:param unicode repository: the repository in which this change took place
:param unicode project: the project this change is a part of
:param unicode src: source of the change (vcs or other)
:returns: the ID of the new change, via Deferred

Add a new change to Buildbot.
This method is the interface between change sources and the rest of Buildbot.

All parameters should be passed as keyword arguments.

All parameters labeled 'unicode' must be unicode strings and not bytestrings.
Filenames in ``files``, and property names, must also be unicode strings.
This is tested by the fake implementation.

41 changes: 41 additions & 0 deletions master/docs/developer/rtype-master.rst
Expand Up @@ -43,3 +43,44 @@ Masters

This path selects a specific master, identified by ID.
The ``:builderid`` field is ignored, since ``:masterid`` uniquely identifies the master.


Updates
.......

The updates section is available at `self.master.data.updates`, and contains a number of ad-hoc methods needed by the process modules.

.. note:
The update methods are implemented in resource type classes, but through some initialization-time magic, all appear as attributes of ``self.master.data.updates``.
All update methods return a Deferred.

.. py:class:: buildbot.data.changes.MasterResourceType
.. py:method:: masterActive(name, masterid)
:param unicode name: the name of this master (generally ``hostname:basedir``)
:param integer masterid: this master's master ID
:returns: Deferred

Mark this master as still active.
This method should be called at startup and at least once per minute.
The master ID is acquired directly from the database early in the master startup process.

.. py:method:: expireMasters()
:returns: Deferred

Scan the database for masters that have not checked in for ten minutes.
This method should be called about once per minute.

.. py:method:: masterStopped(name, masterid)
:param unicode name: the name of this master
:param integer masterid: this master's master ID
:returns: Deferred

Mark this master as inactive.
Masters should call this method before completing an expected shutdown.
This method will take care of deactivating or removing configuration resources like builders and schedulers as well.

0 comments on commit c520838

Please sign in to comment.