-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6348 from vpereira/add_endpoint_to_list_staging_p…
…rojects Add endpoint to list staging projects in a staging workflow
- Loading branch information
Showing
36 changed files
with
6,033 additions
and
5,934 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 18 additions & 1 deletion
19
src/api/app/controllers/staging/staging_projects_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
class Staging::StagingProjectsController < ApplicationController | ||
skip_before_action :require_login | ||
|
||
before_action :set_main_project | ||
|
||
def index | ||
if @main_project.staging | ||
@staging_workflow = @main_project.staging | ||
@staging_projects = @staging_workflow.staging_projects | ||
else | ||
render_error status: 400, errcode: 'project_has_no_staging_workflow' | ||
end | ||
end | ||
|
||
def show | ||
@staging_project = Staging::StagingProject.get_by_name(params[:name]) | ||
@staging_project = @main_project.staging.staging_projects.find_by!(name: params[:name]) | ||
end | ||
|
||
private | ||
|
||
def set_main_project | ||
@main_project = Project.find_by!(name: params[:staging_main_project_name]) | ||
end | ||
end |
23 changes: 23 additions & 0 deletions
23
src/api/app/views/staging/staging_projects/index.xml.builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
xml.staging_projects do | ||
@staging_projects.each do |staging_project| | ||
xml.staging_project(name: staging_project.name) do | ||
render(partial: 'staging/staging_projects/staged_requests', locals: { staged_requests: staging_project.staged_requests, | ||
count: staging_project.staged_requests.count, builder: xml }) | ||
|
||
render(partial: 'staging/staging_projects/untracked_requests', locals: { untracked_requests: staging_project.untracked_requests, | ||
count: staging_project.untracked_requests.count, builder: xml }) | ||
|
||
render(partial: 'staging/staging_projects/requests_to_review', locals: { requests_to_review: staging_project.requests_to_review, | ||
count: staging_project.requests_to_review.count, builder: xml }) | ||
|
||
render(partial: 'staging/staging_projects/missing_reviews', locals: { missing_reviews: staging_project.missing_reviews, | ||
count: staging_project.missing_reviews.count, builder: xml }) | ||
|
||
render(partial: 'staging/staging_projects/building_repositories', locals: { building_repositories: staging_project.building_repositories, | ||
count: staging_project.building_repositories.count, builder: xml }) | ||
|
||
render(partial: 'staging/staging_projects/broken_packages', locals: { broken_packages: staging_project.broken_packages, | ||
count: staging_project.broken_packages.count, builder: xml }) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
250 changes: 250 additions & 0 deletions
250
...taging_ExcludedRequestsController/DELETE_destroy/fails_request_does_not_exist/1_2_2_2.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.