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
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-21 18:06:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-21 18:06:17 +0300
commitb5ad06174bb1de39438c90847abb86ac6988e944 (patch)
tree1bb386b92f023fd2a8f776ccc10386675b3b1ef9 /app
parent0a6ffb540e569bd7a7c548d59b12bc55d4bf9cf1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/sidebar/components/todo_toggle/todo.vue11
-rw-r--r--app/assets/stylesheets/framework/sidebar.scss4
-rw-r--r--app/models/project_auto_devops.rb1
-rw-r--r--app/services/git/base_hooks_service.rb24
4 files changed, 34 insertions, 6 deletions
diff --git a/app/assets/javascripts/sidebar/components/todo_toggle/todo.vue b/app/assets/javascripts/sidebar/components/todo_toggle/todo.vue
index 3d96405896d..643b5aca89c 100644
--- a/app/assets/javascripts/sidebar/components/todo_toggle/todo.vue
+++ b/app/assets/javascripts/sidebar/components/todo_toggle/todo.vue
@@ -59,6 +59,9 @@ export default {
collapsedButtonIcon() {
return this.isTodo ? 'todo-done' : 'todo-add';
},
+ collapsedButtonIconVisible() {
+ return this.collapsed && !this.isActionActive;
+ },
},
methods: {
handleButtonClick() {
@@ -82,8 +85,12 @@ export default {
data-boundary="viewport"
@click="handleButtonClick"
>
- <icon v-show="collapsed" :class="collapsedButtonIconClasses" :name="collapsedButtonIcon" />
- <span v-show="!collapsed" class="issuable-todo-inner"> {{ buttonLabel }} </span>
+ <icon
+ v-show="collapsedButtonIconVisible"
+ :class="collapsedButtonIconClasses"
+ :name="collapsedButtonIcon"
+ />
+ <span v-show="!collapsed" class="issuable-todo-inner">{{ buttonLabel }}</span>
<gl-loading-icon v-show="isActionActive" :inline="true" />
</button>
</template>
diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss
index b9cfcf6ce5c..bf1fd7fd29f 100644
--- a/app/assets/stylesheets/framework/sidebar.scss
+++ b/app/assets/stylesheets/framework/sidebar.scss
@@ -61,10 +61,6 @@
padding-right: 0;
z-index: 300;
- .btn-sidebar-action {
- display: inline-flex;
- }
-
@include media-breakpoint-only(sm) {
&:not(.wiki-sidebar):not(.build-sidebar):not(.issuable-bulk-update-sidebar) .content-wrapper {
padding-right: $gutter-collapsed-width;
diff --git a/app/models/project_auto_devops.rb b/app/models/project_auto_devops.rb
index e11d0c48b4b..275fe81583f 100644
--- a/app/models/project_auto_devops.rb
+++ b/app/models/project_auto_devops.rb
@@ -16,6 +16,7 @@ class ProjectAutoDevops < ApplicationRecord
def predefined_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
+ variables.append(key: 'AUTO_DEVOPS_EXPLICITLY_ENABLED', value: '1') if enabled?
variables.concat(deployment_strategy_default_variables)
end
end
diff --git a/app/services/git/base_hooks_service.rb b/app/services/git/base_hooks_service.rb
index 0801fd4d03f..d935d9e8cdc 100644
--- a/app/services/git/base_hooks_service.rb
+++ b/app/services/git/base_hooks_service.rb
@@ -85,12 +85,36 @@ module Git
before: oldrev,
after: newrev,
ref: ref,
+ variables_attributes: generate_vars_from_push_options || [],
push_options: params[:push_options] || {},
checkout_sha: Gitlab::DataBuilder::Push.checkout_sha(
project.repository, newrev, ref)
}
end
+ def ci_variables_from_push_options
+ strong_memoize(:ci_variables_from_push_options) do
+ params[:push_options]&.deep_symbolize_keys&.dig(:ci, :variable)
+ end
+ end
+
+ def generate_vars_from_push_options
+ return [] unless ci_variables_from_push_options
+
+ ci_variables_from_push_options.map do |var_definition, _count|
+ key, value = var_definition.to_s.split("=", 2)
+
+ # Accept only valid format. We ignore the following formats
+ # 1. "=123". In this case, `key` will be an empty string
+ # 2. "FOO". In this case, `value` will be nil.
+ # However, the format "FOO=" will result in key beign `FOO` and value
+ # being an empty string. This is acceptable.
+ next if key.blank? || value.nil?
+
+ { "key" => key, "variable_type" => "env_var", "secret_value" => value }
+ end.compact
+ end
+
def push_data_params(commits:, with_changed_files: true)
{
oldrev: oldrev,