forked from gitlabhq/gitlabhq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add latest changes from gitlab-org/gitlab@master
- Loading branch information
GitLab Bot
committed
Jun 18, 2020
1 parent
aed2039
commit ef19a5c
Showing
36 changed files
with
703 additions
and
287 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
app/controllers/projects/pipelines/application_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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
# Abstract class encapsulating common logic for creating new controllers in a pipeline context | ||
|
||
module Projects | ||
module Pipelines | ||
class ApplicationController < Projects::ApplicationController | ||
include Gitlab::Utils::StrongMemoize | ||
|
||
before_action :pipeline | ||
before_action :authorize_read_pipeline! | ||
|
||
private | ||
|
||
def pipeline | ||
strong_memoize(:pipeline) do | ||
project.all_pipelines.find(params[:pipeline_id]).tap do |pipeline| | ||
render_404 unless can?(current_user, :read_pipeline, pipeline) | ||
end | ||
end | ||
end | ||
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
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
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
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
changelogs/unreleased/215160-add-intermediate-group-deploy-key-table.yml
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,5 @@ | ||
--- | ||
title: Create group_deploy_keys_groups intermediate table | ||
merge_request: 32901 | ||
author: | ||
type: added |
27 changes: 27 additions & 0 deletions
27
db/migrate/20200522205606_create_group_deploy_keys_group.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
class CreateGroupDeployKeysGroup < ActiveRecord::Migration[6.0] | ||
include Gitlab::Database::MigrationHelpers | ||
DOWNTIME = false | ||
|
||
def up | ||
with_lock_retries do | ||
create_table :group_deploy_keys_groups do |t| | ||
t.timestamps_with_timezone | ||
|
||
t.references :group, index: false, null: false, foreign_key: { to_table: :namespaces, on_delete: :cascade } | ||
t.references :group_deploy_key, null: false, foreign_key: { on_delete: :cascade } | ||
|
||
t.index [:group_id, :group_deploy_key_id], unique: true, name: 'index_group_deploy_keys_group_on_group_deploy_key_and_group_ids' | ||
end | ||
end | ||
end | ||
|
||
def down | ||
with_lock_retries do | ||
# rubocop:disable Migration/DropTable | ||
drop_table :group_deploy_keys_groups | ||
# rubocop:enable Migration/DropTable | ||
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
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
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
Oops, something went wrong.