Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
29eea410
Commit
29eea410
authored
Oct 28, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
1a3d7b9f
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
119 additions
and
12 deletions
+119
-12
app/finders/todos_finder.rb
app/finders/todos_finder.rb
+3
-5
app/views/ci/variables/_url_query_variable_row.html.haml
app/views/ci/variables/_url_query_variable_row.html.haml
+28
-0
app/views/projects/pipelines/new.html.haml
app/views/projects/pipelines/new.html.haml
+7
-0
changelogs/unreleased/24146-query-string-params.yml
changelogs/unreleased/24146-query-string-params.yml
+5
-0
changelogs/unreleased/30161-expose-merge-request-status-in-api.yml
...s/unreleased/30161-expose-merge-request-status-in-api.yml
+5
-0
doc/api/merge_requests.md
doc/api/merge_requests.md
+9
-3
lib/api/entities.rb
lib/api/entities.rb
+4
-0
qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
...er_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
+1
-4
spec/features/populate_new_pipeline_vars_with_params_spec.rb
spec/features/populate_new_pipeline_vars_with_params_spec.rb
+32
-0
spec/finders/todos_finder_spec.rb
spec/finders/todos_finder_spec.rb
+23
-0
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+2
-0
No files found.
app/finders/todos_finder.rb
View file @
29eea410
...
...
@@ -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
)
...
...
app/views/ci/variables/_url_query_variable_row.html.haml
0 → 100644
View file @
29eea410
-
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'
)
app/views/projects/pipelines/new.html.haml
View file @
29eea410
...
...
@@ -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
...
...
changelogs/unreleased/24146-query-string-params.yml
0 → 100644
View file @
29eea410
---
title
:
Populate new pipeline CI vars from params
merge_request
:
19023
author
:
type
:
added
changelogs/unreleased/30161-expose-merge-request-status-in-api.yml
0 → 100644
View file @
29eea410
---
title
:
Expose mergeable state of a merge request
merge_request
:
18888
author
:
briankabiro
type
:
added
doc/api/merge_requests.md
View file @
29eea410
...
...
@@ -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
}
```
...
...
lib/api/entities.rb
View file @
29eea410
...
...
@@ -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
...
...
qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
View file @
29eea410
...
...
@@ -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
...
...
spec/features/populate_new_pipeline_vars_with_params_spec.rb
0 → 100644
View file @
29eea410
# 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
spec/finders/todos_finder_spec.rb
View file @
29eea410
...
...
@@ -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
...
...
spec/requests/api/merge_requests_spec.rb
View file @
29eea410
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment