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
2ff0b5e3
Commit
2ff0b5e3
authored
Jun 08, 2021
by
Jonas Waelter
Committed by
Jonas Wälter
Jun 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace 'tag_list' with 'topic_list' attribute on project
Changelog: removed
parent
227082e3
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
31 deletions
+15
-31
app/graphql/types/project_type.rb
app/graphql/types/project_type.rb
+4
-0
app/helpers/tags_helper.rb
app/helpers/tags_helper.rb
+0
-10
app/models/project.rb
app/models/project.rb
+0
-4
spec/features/projects/show/schema_markup_spec.rb
spec/features/projects/show/schema_markup_spec.rb
+2
-2
spec/graphql/resolvers/projects_resolver_spec.rb
spec/graphql/resolvers/projects_resolver_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-7
spec/requests/api/graphql/project_query_spec.rb
spec/requests/api/graphql/project_query_spec.rb
+1
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+6
-6
No files found.
app/graphql/types/project_type.rb
View file @
2ff0b5e3
...
...
@@ -387,6 +387,10 @@ module Types
::
Security
::
CiConfiguration
::
SastParserService
.
new
(
object
).
configuration
end
def
tag_list
object
.
topic_list
end
private
def
project
...
...
app/helpers/tags_helper.rb
View file @
2ff0b5e3
...
...
@@ -15,16 +15,6 @@ module TagsHelper
project_tags_path
(
@project
,
@id
,
options
)
end
def
tag_list
(
project
)
html
=
[]
project
.
tag_list
.
each
do
|
tag
|
html
<<
link_to
(
tag
,
tag_path
(
tag
))
end
html
.
join
.
html_safe
end
def
protected_tag?
(
project
,
tag
)
ProtectedTag
.
protected?
(
project
,
tag
.
name
)
end
...
...
app/models/project.rb
View file @
2ff0b5e3
...
...
@@ -127,10 +127,6 @@ class Project < ApplicationRecord
after_create
:check_repository_absence!
acts_as_ordered_taggable_on
:topics
# The 'tag_list' alias is required during the 'tags -> topics' migration
# TODO: eliminate 'tag_list' in the further process of the migration
# https://gitlab.com/gitlab-org/gitlab/-/issues/328226
alias_attribute
:tag_list
,
:topic_list
attr_accessor
:old_path_with_namespace
attr_accessor
:template_name
...
...
spec/features/projects/show/schema_markup_spec.rb
View file @
2ff0b5e3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
'Projects > Show > Schema Markup'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:public
,
:with_avatar
,
description:
'foobar'
,
t
ag_list:
'tag1, tag
2'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:public
,
:with_avatar
,
description:
'foobar'
,
t
opic_list:
'topic1, topic
2'
)
}
it
'shows SoftwareSourceCode structured markup'
,
:js
do
visit
project_path
(
project
)
...
...
@@ -16,7 +16,7 @@ RSpec.describe 'Projects > Show > Schema Markup' do
expect
(
page
).
to
have_selector
(
'[itemprop="identifier"]'
,
text:
"Project ID:
#{
project
.
id
}
"
)
expect
(
page
).
to
have_selector
(
'[itemprop="description"]'
,
text:
project
.
description
)
expect
(
page
).
to
have_selector
(
'[itemprop="license"]'
,
text:
project
.
repository
.
license
.
name
)
expect
(
find_all
(
'[itemprop="keywords"]'
).
map
(
&
:text
)).
to
match_array
(
project
.
t
ag
_list
.
map
(
&
:capitalize
))
expect
(
find_all
(
'[itemprop="keywords"]'
).
map
(
&
:text
)).
to
match_array
(
project
.
t
opic
_list
.
map
(
&
:capitalize
))
expect
(
page
).
to
have_selector
(
'[itemprop="about"]'
)
end
end
...
...
spec/graphql/resolvers/projects_resolver_spec.rb
View file @
2ff0b5e3
...
...
@@ -10,7 +10,7 @@ RSpec.describe Resolvers::ProjectsResolver do
let_it_be
(
:group
)
{
create
(
:group
,
name:
'public-group'
)
}
let_it_be
(
:private_group
)
{
create
(
:group
,
name:
'private-group'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
t
ag
_list:
%w(ruby javascript)
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
t
opic
_list:
%w(ruby javascript)
)
}
let_it_be
(
:other_project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:group_project
)
{
create
(
:project
,
:public
,
group:
group
)
}
let_it_be
(
:private_project
)
{
create
(
:project
,
:private
)
}
...
...
spec/models/project_spec.rb
View file @
2ff0b5e3
...
...
@@ -6945,7 +6945,7 @@ RSpec.describe Project, factory_default: :keep do
end
describe
'topics'
do
let_it_be
(
:project
)
{
create
(
:project
,
t
ag
_list:
'topic1, topic2, topic3'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
t
opic
_list:
'topic1, topic2, topic3'
)
}
it
'topic_list returns correct string array'
do
expect
(
project
.
topic_list
).
to
match_array
(
%w[topic1 topic2 topic3]
)
...
...
@@ -6955,12 +6955,6 @@ RSpec.describe Project, factory_default: :keep do
expect
(
project
.
topics
.
first
.
class
.
name
).
to
eq
(
'ActsAsTaggableOn::Tag'
)
expect
(
project
.
topics
.
map
(
&
:name
)).
to
match_array
(
%w[topic1 topic2 topic3]
)
end
context
'aliases'
do
it
'tag_list returns correct string array'
do
expect
(
project
.
tag_list
).
to
match_array
(
%w[topic1 topic2 topic3]
)
end
end
end
shared_examples
'all_runners'
do
...
...
spec/requests/api/graphql/project_query_spec.rb
View file @
2ff0b5e3
...
...
@@ -65,7 +65,7 @@ RSpec.describe 'getting project information' do
end
it
'includes topics array'
do
project
.
update!
(
t
ag
_list:
'topic1, topic2, topic3'
)
project
.
update!
(
t
opic
_list:
'topic1, topic2, topic3'
)
post_graphql
(
query
,
current_user:
current_user
)
...
...
spec/requests/api/projects_spec.rb
View file @
2ff0b5e3
...
...
@@ -287,9 +287,9 @@ RSpec.describe API::Projects do
expect
(
json_response
.
find
{
|
hash
|
hash
[
'id'
]
==
project
.
id
}.
keys
).
not_to
include
(
'open_issues_count'
)
end
context
'filter by topic (column t
ag
_list)'
do
context
'filter by topic (column t
opic
_list)'
do
before
do
project
.
update!
(
t
ag
_list:
%w(ruby javascript)
)
project
.
update!
(
t
opic
_list:
%w(ruby javascript)
)
end
it
'returns no projects'
do
...
...
@@ -1105,7 +1105,7 @@ RSpec.describe API::Projects do
post
api
(
'/projects'
,
user
),
params:
project
expect
(
json_response
[
't
ag_list
'
]).
to
eq
(
%w[tagFirst tagSecond]
)
expect
(
json_response
[
't
opics
'
]).
to
eq
(
%w[tagFirst tagSecond]
)
end
it
'sets topics to a project'
do
...
...
@@ -1113,7 +1113,7 @@ RSpec.describe API::Projects do
post
api
(
'/projects'
,
user
),
params:
project
expect
(
json_response
[
't
ag_list
'
]).
to
eq
(
%w[topic1 topics2]
)
expect
(
json_response
[
't
opics
'
]).
to
eq
(
%w[topic1 topics2]
)
end
it
'uploads avatar for project a project'
do
...
...
@@ -3111,7 +3111,7 @@ RSpec.describe API::Projects do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
't
ag_list
'
]).
to
eq
(
%w[topic1]
)
expect
(
json_response
[
't
opics
'
]).
to
eq
(
%w[topic1]
)
end
it
'updates topics'
do
...
...
@@ -3121,7 +3121,7 @@ RSpec.describe API::Projects do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
't
ag_list
'
]).
to
eq
(
%w[topic2]
)
expect
(
json_response
[
't
opics
'
]).
to
eq
(
%w[topic2]
)
end
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