Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-05-18 19:57:37 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-05-18 19:57:37 +0300
commitfb3077e67b527f92a917e0f8b6f2745a322bce9a (patch)
treee284fd772454ae0820d4202646343ec7ad9053ef /config/routes
parentad0a50126cfd02602e942b6bbf012279c98a69c3 (diff)
Complete all legacy builds URL. Tests are added
Diffstat (limited to 'config/routes')
-rw-r--r--config/routes/project.rb24
1 files changed, 2 insertions, 22 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb
index f9d7bceba2c..2cc767b8bc0 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -1,4 +1,5 @@
require 'constraints/project_url_constrainer'
+require 'gitlab/routes/legacy_builds'
resources :projects, only: [:index, :new, :create]
@@ -198,28 +199,7 @@ constraints(ProjectUrlConstrainer.new) do
end
end
- redirect_builds_to_jobs = redirect do |params, req|
- args = params.values_at(:namespace_id, :project_id, :id).compact
- url_helpers = Gitlab::Routing.url_helpers
-
- if params[:id]
- case params[:action]
- when 'status'
- url_helpers.status_namespace_project_job_path(*args, format: params[:format])
- when 'trace'
- url_helpers.trace_namespace_project_job_path(*args, format: params[:format])
- when 'raw'
- url_helpers.raw_namespace_project_job_path(*args)
- else # show
- url_helpers.namespace_project_job_path(*args)
- end
- else # index
- url_helpers.namespace_project_jobs_path(*args)
- end
- end
-
- get '/builds(/:id(/:action))', to: redirect_builds_to_jobs,
- as: 'legacy_build'
+ Gitlab::Routes::LegacyBuilds.new(self).draw
resources :hooks, only: [:index, :create, :edit, :update, :destroy], constraints: { id: /\d+/ } do
member do