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
d1421948
Commit
d1421948
authored
Oct 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
587794b4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
3 deletions
+51
-3
app/graphql/types/issue_type.rb
app/graphql/types/issue_type.rb
+0
-1
app/models/user.rb
app/models/user.rb
+1
-0
changelogs/unreleased/allow-username-search-to-work-with-at-sign.yml
...unreleased/allow-username-search-to-work-with-at-sign.yml
+5
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+36
-1
spec/graphql/types/issue_type_spec.rb
spec/graphql/types/issue_type_spec.rb
+1
-1
spec/models/user_spec.rb
spec/models/user_spec.rb
+8
-0
No files found.
app/graphql/types/issue_type.rb
View file @
d1421948
...
...
@@ -49,7 +49,6 @@ module Types
field
:web_url
,
GraphQL
::
STRING_TYPE
,
null:
false
# rubocop:disable Graphql/Descriptions
field
:relative_position
,
GraphQL
::
INT_TYPE
,
null:
true
# rubocop:disable Graphql/Descriptions
field
:epic
,
::
Types
::
EpicType
,
null:
true
,
description:
'The epic to which issue belongs'
field
:participants
,
Types
::
UserType
.
connection_type
,
null:
true
,
complexity:
5
,
description:
'List of participants for the issue'
field
:time_estimate
,
GraphQL
::
INT_TYPE
,
null:
false
,
description:
'The time estimate on the issue'
field
:total_time_spent
,
GraphQL
::
INT_TYPE
,
null:
false
,
description:
'Total time reported as spent on the issue'
...
...
app/models/user.rb
View file @
d1421948
...
...
@@ -444,6 +444,7 @@ class User < ApplicationRecord
#
# Returns an ActiveRecord::Relation.
def
search
(
query
)
query
=
query
&
.
delete_prefix
(
'@'
)
return
none
if
query
.
blank?
query
=
query
.
downcase
...
...
changelogs/unreleased/allow-username-search-to-work-with-at-sign.yml
0 → 100644
View file @
d1421948
---
title
:
Allow users to be searched with a @ prefix
merge_request
:
17742
author
:
type
:
added
doc/ci/yaml/README.md
View file @
d1421948
...
...
@@ -707,6 +707,7 @@ Available rule clauses include:
(similar to
[
`only:variables`
](
#onlyvariablesexceptvariables
)
).
-
[
`changes`
](
#ruleschanges
)
(same as
[
`only:changes`
](
#onlychangesexceptchanges
)
).
-
[
`exists`
](
#rulesexists
)
For example, using
`if`
. This configuration specifies that
`job`
should be built
and run for every pipeline on merge requests targeting
`master`
, regardless of
...
...
@@ -779,9 +780,42 @@ In this example, a job either set to:
-
Run manually if
`Dockerfile`
has changed OR
`$VAR == "string value"`
.
-
`when:on_success`
by the last rule, where no earlier clauses evaluate to true.
#### `rules:exists`
`exists`
accepts an array of paths and will match if any of these paths exist
as files in the repository.
For example:
```
yaml
job
:
script
:
docker build -t my-image:$CI_COMMIT_REF_SLUG .
rules
:
-
exists
:
-
Dockerfile
```
You can also use glob patterns to match multiple files in any directory within
the repository.
For example:
```
yaml
job
:
script
:
bundle exec rspec
rules
:
-
exists
:
-
spec/**.rb
```
NOTE:
**Note:**
For performance reasons, using
`exists`
with patterns is limited to 10000
checks. After the 10000th check, rules with patterned globs will always match.
#### Complex rule clauses
To conjoin
`if`
and
`changes`
clauses with an AND, use them in the same rule.
To conjoin
`if`
,
`changes`
, and
`exists`
clauses with an AND, use them in the
same rule.
In the following example:
...
...
@@ -805,6 +839,7 @@ The only clauses currently available are:
-
`if`
-
`changes`
-
`exists`
Keywords such as
`branches`
or
`refs`
that are currently available for
`only`
/
`except`
are not yet available in
`rules`
as they are being individually
...
...
spec/graphql/types/issue_type_spec.rb
View file @
d1421948
...
...
@@ -10,7 +10,7 @@ describe GitlabSchema.types['Issue'] do
it
{
expect
(
described_class
.
interfaces
).
to
include
(
Types
::
Notes
::
NoteableType
.
to_graphql
)
}
it
'has specific fields'
do
fields
=
%i[iid title description state reference author assignees participants labels
epic
milestone due_date
fields
=
%i[iid title description state reference author assignees participants labels milestone due_date
confidential discussion_locked upvotes downvotes user_notes_count web_path web_url relative_position
time_estimate total_time_spent closed_at created_at updated_at task_completion_status]
...
...
spec/models/user_spec.rb
View file @
d1421948
...
...
@@ -1427,10 +1427,18 @@ describe User do
expect
(
described_class
.
search
(
user
.
username
)).
to
eq
([
user
,
user2
])
end
it
'returns users with a matching username starting with a @'
do
expect
(
described_class
.
search
(
"@
#{
user
.
username
}
"
)).
to
eq
([
user
,
user2
])
end
it
'returns users with a partially matching username'
do
expect
(
described_class
.
search
(
user
.
username
[
0
..
2
])).
to
eq
([
user
,
user2
])
end
it
'returns users with a partially matching username starting with @'
do
expect
(
described_class
.
search
(
"@
#{
user
.
username
[
0
..
2
]
}
"
)).
to
eq
([
user
,
user2
])
end
it
'returns users with a matching username regardless of the casing'
do
expect
(
described_class
.
search
(
user2
.
username
.
upcase
)).
to
eq
([
user2
])
end
...
...
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