summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-02 15:08:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-02 15:08:01 +0000
commitb375c6c05fbd03aea33a9ee9f82e678bdaa8c3cc (patch)
tree55f2a32e5fd3d67597fc8c6cc2a01793ee15c87a /app
parent988b28ec1a379d38f6ac9ed04886ee564fd447fd (diff)
downloadgitlab-ce-b375c6c05fbd03aea33a9ee9f82e678bdaa8c3cc.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js2
-rw-r--r--app/assets/javascripts/pages/projects/settings/repository/form.js2
-rw-r--r--app/controllers/admin/application_settings_controller.rb2
-rw-r--r--app/controllers/projects/deploy_keys_controller.rb17
-rw-r--r--app/controllers/projects/settings/ci_cd_controller.rb5
-rw-r--r--app/controllers/projects/settings/repository_controller.rb2
-rw-r--r--app/models/ci/bridge.rb5
-rw-r--r--app/models/namespace.rb2
-rw-r--r--app/services/ci/create_cross_project_pipeline_service.rb6
-rw-r--r--app/services/ci/create_pipeline_service.rb1
-rw-r--r--app/views/projects/settings/ci_cd/show.html.haml2
-rw-r--r--app/views/projects/settings/repository/show.html.haml2
12 files changed, 27 insertions, 21 deletions
diff --git a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js
index c83e2bdbf38..7f865f4cfb6 100644
--- a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js
+++ b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js
@@ -4,6 +4,7 @@ import AjaxVariableList from '~/ci_variable_list/ajax_variable_list';
import registrySettingsApp from '~/registry/settings/registry_settings_bundle';
import initVariableList from '~/ci_variable_list';
import DueDateSelectors from '~/due_date_select';
+import initDeployKeys from '~/deploy_keys';
document.addEventListener('DOMContentLoaded', () => {
// Initialize expandable settings panels
@@ -44,4 +45,5 @@ document.addEventListener('DOMContentLoaded', () => {
new DueDateSelectors();
registrySettingsApp();
+ initDeployKeys();
});
diff --git a/app/assets/javascripts/pages/projects/settings/repository/form.js b/app/assets/javascripts/pages/projects/settings/repository/form.js
index 3e02893f24c..fa6d17f0729 100644
--- a/app/assets/javascripts/pages/projects/settings/repository/form.js
+++ b/app/assets/javascripts/pages/projects/settings/repository/form.js
@@ -3,7 +3,6 @@
import ProtectedTagCreate from '~/protected_tags/protected_tag_create';
import ProtectedTagEditList from '~/protected_tags/protected_tag_edit_list';
import initSettingsPanels from '~/settings_panels';
-import initDeployKeys from '~/deploy_keys';
import ProtectedBranchCreate from '~/protected_branches/protected_branch_create';
import ProtectedBranchEditList from '~/protected_branches/protected_branch_edit_list';
import DueDateSelectors from '~/due_date_select';
@@ -12,7 +11,6 @@ import fileUpload from '~/lib/utils/file_upload';
export default () => {
new ProtectedTagCreate();
new ProtectedTagEditList();
- initDeployKeys();
initSettingsPanels();
new ProtectedBranchCreate();
new ProtectedBranchEditList();
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index 54c9bde067d..2192bcc96ee 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -244,6 +244,8 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
def render_update_error
action = valid_setting_panels.include?(action_name) ? action_name : :general
+ flash[:alert] = _('Application settings update failed')
+
render action
end
diff --git a/app/controllers/projects/deploy_keys_controller.rb b/app/controllers/projects/deploy_keys_controller.rb
index f13fb4d0b3d..f43e9f2bd19 100644
--- a/app/controllers/projects/deploy_keys_controller.rb
+++ b/app/controllers/projects/deploy_keys_controller.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
class Projects::DeployKeysController < Projects::ApplicationController
- include RepositorySettingsRedirect
respond_to :html
# Authorize
@@ -12,7 +11,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
def index
respond_to do |format|
- format.html { redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings') }
+ format.html { redirect_to_ci_cd_settings }
format.json do
render json: Projects::Settings::DeployKeysPresenter.new(@project, current_user: current_user).as_json
end
@@ -20,7 +19,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
end
def new
- redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings')
+ redirect_to_ci_cd_settings
end
def create
@@ -30,7 +29,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
flash[:alert] = @key.errors.full_messages.join(', ').html_safe
end
- redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings')
+ redirect_to_ci_cd_settings
end
def edit
@@ -39,7 +38,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
def update
if deploy_key.update(update_params)
flash[:notice] = _('Deploy key was successfully updated.')
- redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings')
+ redirect_to_ci_cd_settings
else
render 'edit'
end
@@ -51,7 +50,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
return render_404 unless key
respond_to do |format|
- format.html { redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings') }
+ format.html { redirect_to_ci_cd_settings }
format.json { head :ok }
end
end
@@ -62,7 +61,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
return render_404 unless deploy_key_project
respond_to do |format|
- format.html { redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings') }
+ format.html { redirect_to_ci_cd_settings }
format.json { head :ok }
end
end
@@ -97,4 +96,8 @@ class Projects::DeployKeysController < Projects::ApplicationController
access_denied!
end
end
+
+ def redirect_to_ci_cd_settings
+ redirect_to project_settings_ci_cd_path(@project, anchor: 'js-deploy-keys-settings')
+ end
end
diff --git a/app/controllers/projects/settings/ci_cd_controller.rb b/app/controllers/projects/settings/ci_cd_controller.rb
index ed42fb55223..c4cc1adcd4e 100644
--- a/app/controllers/projects/settings/ci_cd_controller.rb
+++ b/app/controllers/projects/settings/ci_cd_controller.rb
@@ -101,6 +101,7 @@ module Projects
define_triggers_variables
define_badges_variables
define_auto_devops_variables
+ define_deploy_keys
end
def define_runners_variables
@@ -153,6 +154,10 @@ module Projects
@new_deploy_token = DeployToken.new
end
+
+ def define_deploy_keys
+ @deploy_keys = DeployKeysPresenter.new(@project, current_user: current_user)
+ end
end
end
end
diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb
index 28db3024dc4..a1f88c73649 100644
--- a/app/controllers/projects/settings/repository_controller.rb
+++ b/app/controllers/projects/settings/repository_controller.rb
@@ -27,8 +27,6 @@ module Projects
private
def render_show
- @deploy_keys = DeployKeysPresenter.new(@project, current_user: current_user)
-
define_protected_refs
remote_mirror
diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb
index 26997d17816..39be26abc1d 100644
--- a/app/models/ci/bridge.rb
+++ b/app/models/ci/bridge.rb
@@ -167,7 +167,10 @@ module Ci
target_revision: {
ref: target_ref || downstream_project.default_branch
},
- execute_params: { ignore_skip_ci: true }
+ execute_params: {
+ ignore_skip_ci: true,
+ bridge: self
+ }
}
end
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index f06e9da3b2a..fbc010c6b7c 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -130,7 +130,7 @@ class Namespace < ApplicationRecord
return unless host.ends_with?(gitlab_host)
name = host.delete_suffix(gitlab_host)
- Namespace.find_by_full_path(name)
+ Namespace.find_by_path(name)
end
# overridden in ee
diff --git a/app/services/ci/create_cross_project_pipeline_service.rb b/app/services/ci/create_cross_project_pipeline_service.rb
index 8de72ace261..22b8e37a7e8 100644
--- a/app/services/ci/create_cross_project_pipeline_service.rb
+++ b/app/services/ci/create_cross_project_pipeline_service.rb
@@ -20,12 +20,6 @@ module Ci
service.execute(
pipeline_params.fetch(:source), pipeline_params[:execute_params]) do |pipeline|
- @bridge.sourced_pipelines.build(
- source_pipeline: @bridge.pipeline,
- source_project: @bridge.project,
- project: @bridge.downstream_project,
- pipeline: pipeline)
-
pipeline.variables.build(@bridge.downstream_variables)
end
end
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb
index 52977034b70..347630f865f 100644
--- a/app/services/ci/create_pipeline_service.rb
+++ b/app/services/ci/create_pipeline_service.rb
@@ -7,6 +7,7 @@ module Ci
CreateError = Class.new(StandardError)
SEQUENCE = [Gitlab::Ci::Pipeline::Chain::Build,
+ Gitlab::Ci::Pipeline::Chain::Build::Associations,
Gitlab::Ci::Pipeline::Chain::Validate::Abilities,
Gitlab::Ci::Pipeline::Chain::Validate::Repository,
Gitlab::Ci::Pipeline::Chain::Config::Content,
diff --git a/app/views/projects/settings/ci_cd/show.html.haml b/app/views/projects/settings/ci_cd/show.html.haml
index 9e47e380266..ab2f64cdc21 100644
--- a/app/views/projects/settings/ci_cd/show.html.haml
+++ b/app/views/projects/settings/ci_cd/show.html.haml
@@ -54,6 +54,8 @@
= render "shared/deploy_tokens/index", group_or_project: @project, description: deploy_token_description
+= render @deploy_keys
+
%section.settings.no-animate#js-pipeline-triggers{ class: ('expanded' if expanded) }
.settings-header
%h4
diff --git a/app/views/projects/settings/repository/show.html.haml b/app/views/projects/settings/repository/show.html.haml
index 3d1eb85da0d..5bf92d32474 100644
--- a/app/views/projects/settings/repository/show.html.haml
+++ b/app/views/projects/settings/repository/show.html.haml
@@ -11,8 +11,6 @@
-# Those are used throughout the actual views. These `shared` views are then
-# reused in EE.
= render "projects/settings/repository/protected_branches"
-
-= render @deploy_keys
= render "projects/cleanup/show"
= render_if_exists 'shared/promotions/promote_repository_features'