Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]

7 Staging Workflow

7.1 Working with Staging Projects

This API provides an easy way to get information about a single or all staging projects like state, requests and checks. Note: To use this API, you first need to setup a staging workflow for a project.

7.1.1 Overview of All Staging Projects

This endpoint provides an overview of all staging projects for a certain project.

geeko > osc api '/staging/openSUSE:Factory:Staging/staging_projects/'

Which will return the following XML:

<staging_projects>
  <staging_project name="home:Admin:Staging:A" state="empty">
    <staged_requests count="0"/>
    <untracked_requests count="0"/>
    <requests_to_review count="0"/>
    <obsolete_requests count="0"/>
    <missing_reviews count="0"/>
    <broken_packages count="0"/>
    <checks count="0"/>
    <missing_checks count="0"/>
  </staging_project>
  <staging_project name="home:Admin:Staging:B" state="empty">
    <staged_requests count="0"/>
    <untracked_requests count="0"/>
    <requests_to_review count="0"/>
    <obsolete_requests count="0"/>
    <missing_reviews count="0"/>
    <broken_packages count="0"/>
    <checks count="0"/>
    <missing_checks count="0"/>
  </staging_project>
</staging_projects>

7.1.2 Overview of a Single Staging Project

This endpoint provides an overview of a single staging project.

geeko > osc api '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A'

Which will return the following XML:

<staging_project name="home:Admin:Staging:A" state="empty">
  <staged_requests count="0"/>
  <untracked_requests count="0"/>
  <requests_to_review count="0"/>
  <obsolete_requests count="0"/>
  <missing_reviews count="0"/>
  <broken_packages count="0"/>
  <checks count="0"/>
  <missing_checks count="0"/>
</staging_project>

7.1.3 Copy a Staging Project

This endpoint creates a copy of a staging project. It will queue a job which is going to copy the project configuration, repositories, groups and users.

geeko > osc api -X POST '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A/copy/openSUSE:Factory:Staging:A-copy'

7.2 Working with Requests

One of the main features of the staging workflow is assigning incoming requests to different staging projects.

7.2.1 Assign Requests into a Staging Project

Our main project openSUSE:Factory received requests with number 1 and 2. We would like to group these two requests together and move them into the staging project openSUSE:Factory:Staging:A. This can be done with the following command which will create a link to the package in openSUSE:Factory:Staging:A.

geeko > osc api -X POST '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A/staged_requests' -d '<requests><number>1</number><number>2</number></requests>'

7.2.2 Remove Requests from a Staging Project

When we are done with testing the staging project openSUSE:Factory:Staging:A, we need to remove the requests 1 and 2 again. The following command will remove the package links from openSUSE:Factory:Staging:A.

geeko > osc api -X DELETE '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A/staged_requests' -d '<requests><number>1</number><number>2</number></requests>'

7.2.3 List Requests of a Staging Project

Listing all requests which are currently assigned to openSUSE:Factory:Staging:A can be done with the following command.

geeko > osc api '/staging/openSUSE:Factory:Staging/staging_projects/openSUSE:Factory:Staging:A/staged_requests'

Which will return the following XML:

<staged_requests>
  <request id="6" creator="user_1" state="review" package="ctris"/>
</staged_requests>

7.2.4 Exclude Requests for a Staging Workflow

Our main project openSUSE:Factory received requests with number 3 and 4. We would like to exclude these two requests for the staging workflow project openSUSE:Factory.

geeko > osc api -X POST '/staging/openSUSE:Factory/excluded_requests' -d '<excluded_requests><request number="3" description="Reason description for request number 3."></request><request number="4" description="Reason description for request number 4."></request></requests>'

7.2.5 Remove Requests from a Staging Workflow

The following command will stop excluding requests with number 3 and 4 for the staging workflow project openSUSE:Factory.

geeko > osc api -X DELETE '/staging/openSUSE:Factory/excluded_requests' -d '<requests><number>3</number><number>4</number></requests>'
Print this page