Commit c94db0c2 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Use - as the prefix so we don't conflict with namespaces

The decision was made around:
https://gitlab.com/gitlab-org/gitlab-ce/issues/26407#note_30624641
parent 70eb0c6a
...@@ -181,7 +181,7 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -181,7 +181,7 @@ constraints(ProjectUrlConstrainer.new) do
end end
end end
resources :jobs, only: [:index, :show], constraints: { id: /\d+/ } do resources :jobs, path: '-/jobs', only: [:index, :show], constraints: { id: /\d+/ } do
collection do collection do
post :cancel_all post :cancel_all
......
class RenameProjectsNamedJobs < ActiveRecord::Migration
include Gitlab::Database::RenameReservedPathsMigration::V1
DOWNTIME = false
disable_ddl_transaction!
def up
rename_wildcard_paths('jobs')
end
def down
end
end
...@@ -80,6 +80,7 @@ module Gitlab ...@@ -80,6 +80,7 @@ module Gitlab
# By rejecting `badges` the router can _count_ on the fact that `badges` will # By rejecting `badges` the router can _count_ on the fact that `badges` will
# be preceded by the `namespace/project`. # be preceded by the `namespace/project`.
PROJECT_WILDCARD_ROUTES = %w[ PROJECT_WILDCARD_ROUTES = %w[
-
badges badges
blame blame
blob blob
......
...@@ -177,7 +177,7 @@ describe Projects::EnvironmentsController do ...@@ -177,7 +177,7 @@ describe Projects::EnvironmentsController do
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(json_response).to eq( expect(json_response).to eq(
{ 'redirect_url' => { 'redirect_url' =>
"http://test.host/#{project.path_with_namespace}/jobs/#{action.id}" }) namespace_project_job_url(project.namespace, project, action) })
end end
end end
...@@ -191,7 +191,7 @@ describe Projects::EnvironmentsController do ...@@ -191,7 +191,7 @@ describe Projects::EnvironmentsController do
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(json_response).to eq( expect(json_response).to eq(
{ 'redirect_url' => { 'redirect_url' =>
"http://test.host/#{project.path_with_namespace}/environments/#{environment.id}" }) namespace_project_environment_url(project.namespace, project, environment) })
end end
end end
end end
......
...@@ -15,7 +15,7 @@ feature 'Browse artifact', :js, feature: true do ...@@ -15,7 +15,7 @@ feature 'Browse artifact', :js, feature: true do
end end
before do before do
visit browse_url.sub('jobs', 'builds') visit browse_url.sub('/-/jobs', '/builds')
end end
it "redirects to new URL" do it "redirects to new URL" do
......
...@@ -39,7 +39,7 @@ feature 'Download artifact', :js, feature: true do ...@@ -39,7 +39,7 @@ feature 'Download artifact', :js, feature: true do
context 'when visiting old URL' do context 'when visiting old URL' do
before do before do
visit download_url.sub('jobs', 'builds') visit download_url.sub('/-/jobs', '/builds')
end end
context 'via job id' do context 'via job id' do
......
...@@ -67,7 +67,7 @@ feature 'Artifact file', :js, feature: true do ...@@ -67,7 +67,7 @@ feature 'Artifact file', :js, feature: true do
end end
before do before do
visit file_url.sub('jobs', 'builds') visit file_url.sub('/-/jobs', '/builds')
end end
it "redirects to new URL" do it "redirects to new URL" do
......
...@@ -15,7 +15,7 @@ feature 'Raw artifact', :js, feature: true do ...@@ -15,7 +15,7 @@ feature 'Raw artifact', :js, feature: true do
end end
before do before do
visit raw_url.sub('jobs', 'builds') visit raw_url.sub('/-/jobs', '/builds')
end end
it "redirects to new URL" do it "redirects to new URL" do
......
...@@ -85,7 +85,7 @@ feature 'Jobs', :feature do ...@@ -85,7 +85,7 @@ feature 'Jobs', :feature do
end end
before do before do
visit jobs_url.sub('jobs', 'builds') visit jobs_url.sub('/-/jobs', '/builds')
end end
it "redirects to new URL" do it "redirects to new URL" do
...@@ -203,7 +203,7 @@ feature 'Jobs', :feature do ...@@ -203,7 +203,7 @@ feature 'Jobs', :feature do
end end
before do before do
visit job_url.sub('jobs', 'builds') visit job_url.sub('/-/jobs', '/builds')
end end
it "redirects to new URL" do it "redirects to new URL" do
...@@ -473,7 +473,7 @@ feature 'Jobs', :feature do ...@@ -473,7 +473,7 @@ feature 'Jobs', :feature do
end end
before do before do
visit raw_job_url.sub('jobs', 'builds') visit raw_job_url.sub('/-/jobs', '/builds')
end end
it "redirects to new URL" do it "redirects to new URL" do
......
...@@ -8,7 +8,7 @@ import '~/breakpoints'; ...@@ -8,7 +8,7 @@ import '~/breakpoints';
import 'vendor/jquery.nicescroll'; import 'vendor/jquery.nicescroll';
describe('Build', () => { describe('Build', () => {
const BUILD_URL = `${gl.TEST_HOST}/frontend-fixtures/builds-project/jobs/1`; const BUILD_URL = `${gl.TEST_HOST}/frontend-fixtures/builds-project/-/jobs/1`;
preloadFixtures('builds/build-with-artifacts.html.raw'); preloadFixtures('builds/build-with-artifacts.html.raw');
......
...@@ -356,7 +356,7 @@ import '~/lib/utils/common_utils'; ...@@ -356,7 +356,7 @@ import '~/lib/utils/common_utils';
describe('gl.utils.setCiStatusFavicon', () => { describe('gl.utils.setCiStatusFavicon', () => {
it('should set page favicon to CI status favicon based on provided status', () => { it('should set page favicon to CI status favicon based on provided status', () => {
const BUILD_URL = `${gl.TEST_HOST}/frontend-fixtures/builds-project/jobs/1/status.json`; const BUILD_URL = `${gl.TEST_HOST}/frontend-fixtures/builds-project/-/jobs/1/status.json`;
const FAVICON_PATH = '//icon_status_success'; const FAVICON_PATH = '//icon_status_success';
const spySetFavicon = spyOn(gl.utils, 'setFavicon').and.stub(); const spySetFavicon = spyOn(gl.utils, 'setFavicon').and.stub();
const spyResetFavicon = spyOn(gl.utils, 'resetFavicon').and.stub(); const spyResetFavicon = spyOn(gl.utils, 'resetFavicon').and.stub();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment