提交 29eea410 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 1a3d7b9f
......@@ -188,11 +188,9 @@ class TodosFinder
end
def by_state(items)
if params[:state].to_s == 'done'
items.done
else
items.pending
end
return items.pending if params[:state].blank?
items.with_states(params[:state])
end
def by_type(items)
......
- form_field = local_assigns.fetch(:form_field, nil)
- variable = local_assigns.fetch(:variable, nil)
- key = variable[0]
- value = variable[1]
- variable_type = variable[2] || "env_var"
- destroy_input_name = "#{form_field}[variables_attributes][][_destroy]"
- variable_type_input_name = "#{form_field}[variables_attributes][][variable_type]"
- key_input_name = "#{form_field}[variables_attributes][][key]"
- value_input_name = "#{form_field}[variables_attributes][][secret_value]"
%li.js-row.ci-variable-row
.ci-variable-row-body.border-bottom
%input.js-ci-variable-input-destroy{ type: "hidden", name: destroy_input_name }
%select.js-ci-variable-input-variable-type.ci-variable-body-item.form-control.select-control.custom-select.table-section.section-15{ name: variable_type_input_name }
= options_for_select(ci_variable_type_options, variable_type)
%input.js-ci-variable-input-key.ci-variable-body-item.qa-ci-variable-input-key.form-control.table-section.section-15{ type: "text",
name: key_input_name,
value: key,
placeholder: s_('CiVariables|Input variable key') }
.ci-variable-body-item.gl-show-field-errors.table-section.section-15.border-top-0.p-0
%textarea.js-ci-variable-input-value.js-secret-value.qa-ci-variable-input-value.form-control{ rows: 1,
name: value_input_name,
placeholder: s_('CiVariables|Input variable value') }
= value
%button.js-row-remove-button.ci-variable-row-remove-button.table-section.section-5.border-top-0{ type: 'button', 'aria-label': s_('CiVariables|Remove variable row') }
= icon('minus-circle')
......@@ -23,6 +23,13 @@
%label
= s_('Pipeline|Variables')
%ul.ci-variable-list
- if params[:var]
- params[:var].each do |variable|
= render 'ci/variables/url_query_variable_row', form_field: 'pipeline', variable: variable
- if params[:file_var]
- params[:file_var].each do |variable|
- variable.push("file")
= render 'ci/variables/url_query_variable_row', form_field: 'pipeline', variable: variable
= render 'ci/variables/variable_row', form_field: 'pipeline', only_key_value: true
.form-text.text-muted
= (s_("Pipeline|Specify variable values to be used in this run. The values specified in %{settings_link} will be used by default.") % {settings_link: settings_link}).html_safe
......
---
title: Populate new pipeline CI vars from params
merge_request: 19023
author:
type: added
---
title: Expose mergeable state of a merge request
merge_request: 18888
author: briankabiro
type: added
......@@ -304,7 +304,9 @@ Parameters:
"task_completion_status":{
"count":0,
"completed_count":0
}
},
"has_conflicts": false,
"blocking_discussions_resolved": true
}
]
```
......@@ -453,7 +455,9 @@ Parameters:
"task_completion_status":{
"count":0,
"completed_count":0
}
},
"has_conflicts": false,
"blocking_discussions_resolved": true
}
]
```
......@@ -606,7 +610,9 @@ Parameters:
"task_completion_status":{
"count":0,
"completed_count":0
}
},
"has_conflicts": false,
"blocking_discussions_resolved": true
}
```
......
......@@ -777,6 +777,10 @@ module API
expose :squash
expose :task_completion_status
expose :cannot_be_merged?, as: :has_conflicts
expose :mergeable_discussions_state?, as: :blocking_discussions_resolved
end
class MergeRequest < MergeRequestBasic
......
......@@ -5,10 +5,6 @@ require 'digest/sha1'
module QA
context 'Release', :docker do
describe 'Git clone using a deploy key' do
after do
Runtime::Feature.enable('job_log_json') if @job_log_json_flag_enabled
end
before do
# Handle WIP Job Logs flag - https://gitlab.com/gitlab-org/gitlab/issues/31162
@job_log_json_flag_enabled = Runtime::Feature.enabled?('job_log_json')
......@@ -34,6 +30,7 @@ module QA
end
after do
Runtime::Feature.enable('job_log_json') if @job_log_json_flag_enabled
Service::DockerRun::GitlabRunner.new(@runner_name).remove!
end
......
# frozen_string_literal: true
require 'spec_helper'
describe "Populate new pipeline CI variables with url params", :js do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:page_path) { new_project_pipeline_path(project) }
before do
sign_in(user)
project.add_maintainer(user)
visit "#{page_path}?var[key1]=value1&file_var[key2]=value2"
end
it "var[key1]=value1 populates env_var variable correctly" do
page.within('.ci-variable-list .js-row:nth-child(1)') do
expect(find('.js-ci-variable-input-variable-type').value).to eq('env_var')
expect(find('.js-ci-variable-input-key').value).to eq('key1')
expect(find('.js-ci-variable-input-value').text).to eq('value1')
end
end
it "file_var[key2]=value2 populates file variable correctly" do
page.within('.ci-variable-list .js-row:nth-child(2)') do
expect(find('.js-ci-variable-input-variable-type').value).to eq('file')
expect(find('.js-ci-variable-input-key').value).to eq('key2')
expect(find('.js-ci-variable-input-value').text).to eq('value2')
end
end
end
......@@ -140,6 +140,29 @@ describe TodosFinder do
end
end
end
context 'by state' do
let!(:todo1) { create(:todo, user: user, group: group, target: issue, state: :done) }
let!(:todo2) { create(:todo, user: user, group: group, target: issue, state: :pending) }
it 'returns the expected items when no state is provided' do
todos = finder.new(user, {}).execute
expect(todos).to match_array([todo2])
end
it 'returns the expected items when a state is provided' do
todos = finder.new(user, { state: :done }).execute
expect(todos).to match_array([todo1])
end
it 'returns the expected items when multiple states are provided' do
todos = finder.new(user, { state: [:pending, :done] }).execute
expect(todos).to match_array([todo1, todo2])
end
end
end
context 'external authorization' do
......
......@@ -775,6 +775,8 @@ describe API::MergeRequests do
expect(json_response['merge_error']).to eq(merge_request.merge_error)
expect(json_response['user']['can_merge']).to be_truthy
expect(json_response).not_to include('rebase_in_progress')
expect(json_response['has_conflicts']).to be_falsy
expect(json_response['blocking_discussions_resolved']).to be_truthy
end
it 'exposes description and title html when render_html is true' do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册