Skip to content

BS Requests

Manuel Schnitzer edited this page Dec 6, 2017 · 12 revisions

BSRequest

An instance of BSRequest represents one request in OBS.

BsRequestAction

A request can have multiple actions (BsRequestAction). An action defines what will happen, when the request gets accepted. Every action is described in it's own sub-class for example if a request has a BsRequestAction of the type (string) submit, it will perform the code in BsRequestActionSubmit.

Target project and package relation

An action can have a project and a package as a target (depending on the action type). The foreign keys for the target project and package are stored in target_project_id and target_package_id. To act on these relations, you can access the attributes target_project_object and target_package_object.

Things you should be aware of:

When the target project gets deleted:

When the target package gets deleted, the request gets declined and the target_project_object is nil. If you still want to find out the target project name, you can access the attribute target_project which holds the name as a string. Note that the foreign keys (pointing to the target project and package) will not get set to nil! (Issue: #4187)

This also applies to the package. If the project was deleted, the package also no longer exists.

When the target package gets deleted:

When the target package gets deleted, the request gets declined and the target_package_object is nil. If you still want to find out the target package name, you can access the attribute target_package which holds the name as a string. Note that the foreign keys pointing to the target package, will not get set to nil! (Issue: #4187)

When the target_package_id is nil (for submit requests only):

It means that there is no target package with the name specified in target_package. When accepting this request, a new package will be created.

Action Types

NOTE: The class BsRequestActionAcceptInfo is not an action itself. If a request was accepted, a new record of type BsRequestActionAcceptInfo is being created and it holds information about the accepted request.

Mappings:

Type Representative Class Action
submit BsRequestActionSubmit changes source code or creates a new package
delete BsRequestActionDelete deletes a project/package
change_devel BsRequestActionChangeDevel changes the origin devel project of a project
add_role BsRequestActionAddRole adds a role (e.g. the submitter wants to be a project/package maintainer)
set_bugowner BsRequestActionSetBugowner sets the bugowner for a package
maintenance_incident BsRequestActionMaintenanceIncident usually comes from devel projects from the maintainer of a package in order to update a package in the distribution update channels.
maintenance_release BsRequestActionMaintenanceRelease a maintenance release request is created from a Maintenance Incident Project and is supposed to be released in the codestream and a set of products
group BsRequestActionGroup - no longer being used -

BsRequestCounter

This model holds always only one record in which it stores the number for the next request which will be created. When a new request gets created, the counter column gets increased by +1. This is required for a database setup with multiple servers where it can happen that there a gaps between the incrementing id's. To avoid those gaps, we increment the bs_request_counter.counter table column.

BsRequestPermissionCheck

The BsRequestPermissionCheck model is being used for permission checks before a submit request can get accepted or a request state can be changed.

Clone this wiki locally