Build/Database: Difference between revisions
< Build
Jump to navigation
Jump to search
(Created page with '=== Design Considerations === * Code must be suitable for submission to upstream * We should store as much data about the builds in the database as possible ** The current except...') |
No edit summary |
||
| Line 17: | Line 17: | ||
The SQL schema is close approximation of buildbot's internal data structures into SQL. | The SQL schema is close approximation of buildbot's internal data structures into SQL. | ||
=== Querying database === | === Querying the database === | ||
reporter.py contains some examples of querying the database. | reporter.py contains some examples of querying the database. The basic process is: | ||
* Call model.connect with the appropriate DB URL. A session-maker object is returned. Use this session-maker object to create a session. | |||
* Use the session to query the various tables. | |||
* Close the session when done | |||
=== Hooks === | === Hooks === | ||
Revision as of 16:25, 22 June 2009
Design Considerations
- Code must be suitable for submission to upstream
- We should store as much data about the builds in the database as possible
- The current exception to this is build logs, which are _not_ stored in the database.
- All active buildbot masters should report into the same database.
Source code
The source code currently resides at http://hg.mozilla.org/users/catlee_mozilla.com/bb_db.
model.py defines all the SQL tables as well as the mapping to python classes.
status.py implements the buildbot status plugin.
Schema
The SQL schema is close approximation of buildbot's internal data structures into SQL.
Querying the database
reporter.py contains some examples of querying the database. The basic process is:
- Call model.connect with the appropriate DB URL. A session-maker object is returned. Use this session-maker object to create a session.
- Use the session to query the various tables.
- Close the session when done
Hooks
The DBStatus plugin allows you to pass in a list of subscribers that get regular buildbot status notifications that are augmented with database information.
Recommended Reading
- SQLAlchemy docs: http://www.sqlalchemy.org/docs, especially the section on querying