Skip to content

Staging Workflow

Björn Geuken edited this page Mar 21, 2019 · 33 revisions

Overall state of StagingProjects

What makes a project acceptable?

The overall_state method defines the overall state of a StagingProject. This method defines whether a StagingProject can be merged or not.

The following conditions should be met to make a staging project acceptable:

  • if it is not empty
  • if there are no untracked requests or obsolete requests (requests in state 'declined', 'superseded' or 'revoked')
  • if there are no unfinished builds for any StagedRequest of a StagingProject
  • if there are no open reviews for any StagedRequest of a StagingProject
  • if there are no open StatusChecks for any Repositories of a StagingProject

How to merge the project?

Merging a StagingProject means to accept all requests that are staged for this project. Once the requests have been accepted, they are unstaged from the project.

@staging_project.staged_requests.each do |staged_request|
   staged_request.request.reviews.accept # the by project review
   staged_request.request.accept....
   staged_request.destroy # Remove the relationship
end
Clone this wiki locally