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
df8aa2a5
Commit
df8aa2a5
authored
Mar 31, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
c4d5e9c2
aaee395b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
18 deletions
+52
-18
app/assets/javascripts/vue_shared/components/file_icon/file_icon_map.js
...ascripts/vue_shared/components/file_icon/file_icon_map.js
+9
-8
app/services/packages/maven/metadata/sync_service.rb
app/services/packages/maven/metadata/sync_service.rb
+12
-3
changelogs/unreleased/299330-limit-license-file-icon.yml
changelogs/unreleased/299330-limit-license-file-icon.yml
+5
-0
changelogs/unreleased/324288-support-versionless-package-in-maven-sync-worker.yml
...4288-support-versionless-package-in-maven-sync-worker.yml
+5
-0
doc/administration/incoming_email.md
doc/administration/incoming_email.md
+5
-2
spec/services/packages/maven/metadata/sync_service_spec.rb
spec/services/packages/maven/metadata/sync_service_spec.rb
+12
-3
spec/workers/packages/maven/metadata/sync_worker_spec.rb
spec/workers/packages/maven/metadata/sync_worker_spec.rb
+4
-2
No files found.
app/assets/javascripts/vue_shared/components/file_icon/file_icon_map.js
View file @
df8aa2a5
...
@@ -402,14 +402,15 @@ const fileNameIcons = {
...
@@ -402,14 +402,15 @@ const fileNameIcons = {
'
gradle.properties
'
:
'
gradle
'
,
'
gradle.properties
'
:
'
gradle
'
,
gradlew
:
'
gradle
'
,
gradlew
:
'
gradle
'
,
'
gradle-wrapper.properties
'
:
'
gradle
'
,
'
gradle-wrapper.properties
'
:
'
gradle
'
,
license
:
'
certificate
'
,
COPYING
:
'
certificate
'
,
'
license.md
'
:
'
certificate
'
,
'
COPYING.LESSER
'
:
'
certificate
'
,
'
license.md.rendered
'
:
'
certificate
'
,
LICENSE
:
'
certificate
'
,
'
license.txt
'
:
'
certificate
'
,
LICENCE
:
'
certificate
'
,
licence
:
'
certificate
'
,
'
LICENSE.md
'
:
'
certificate
'
,
'
licence.md
'
:
'
certificate
'
,
'
LICENCE.md
'
:
'
certificate
'
,
'
licence.md.rendered
'
:
'
certificate
'
,
'
LICENSE.txt
'
:
'
certificate
'
,
'
licence.txt
'
:
'
certificate
'
,
'
LICENCE.txt
'
:
'
certificate
'
,
'
.gitlab-license
'
:
'
certificate
'
,
dockerfile
:
'
docker
'
,
dockerfile
:
'
docker
'
,
'
docker-compose.yml
'
:
'
docker
'
,
'
docker-compose.yml
'
:
'
docker
'
,
'
.mailmap
'
:
'
email
'
,
'
.mailmap
'
:
'
email
'
,
...
...
app/services/packages/maven/metadata/sync_service.rb
View file @
df8aa2a5
...
@@ -13,16 +13,20 @@ module Packages
...
@@ -13,16 +13,20 @@ module Packages
def
execute
def
execute
return
error
(
'Blank package name'
)
unless
package_name
return
error
(
'Blank package name'
)
unless
package_name
return
error
(
'Not allowed'
)
unless
Ability
.
allowed?
(
current_user
,
:destroy_package
,
project
)
return
error
(
'Not allowed'
)
unless
Ability
.
allowed?
(
current_user
,
:destroy_package
,
project
)
return
error
(
'Non existing versionless package'
)
unless
versionless_package_for_versions
return
error
(
'Non existing metadata file for versions'
)
unless
metadata_package_file_for_versions
result
=
success
(
'Non existing versionless package(s). Nothing to do.'
)
# update versionless package for plugins if it exists
if
metadata_package_file_for_plugins
if
metadata_package_file_for_plugins
result
=
update_plugins_xml
result
=
update_plugins_xml
return
result
if
result
.
error?
return
result
if
result
.
error?
end
end
update_versions_xml
# update versionless_package for versions if it exists
return
update_versions_xml
if
metadata_package_file_for_versions
result
end
end
private
private
...
@@ -79,6 +83,9 @@ module Packages
...
@@ -79,6 +83,9 @@ module Packages
def
metadata_package_file_for_plugins
def
metadata_package_file_for_plugins
strong_memoize
(
:metadata_package_file_for_plugins
)
do
strong_memoize
(
:metadata_package_file_for_plugins
)
do
pkg_name
=
package_name_for_plugins
next
unless
pkg_name
metadata_package_file_for
(
versionless_package_named
(
package_name_for_plugins
))
metadata_package_file_for
(
versionless_package_named
(
package_name_for_plugins
))
end
end
end
end
...
@@ -106,6 +113,8 @@ module Packages
...
@@ -106,6 +113,8 @@ module Packages
end
end
def
package_name_for_plugins
def
package_name_for_plugins
return
unless
versionless_package_for_versions
group
=
versionless_package_for_versions
.
maven_metadatum
.
app_group
group
=
versionless_package_for_versions
.
maven_metadatum
.
app_group
group
.
tr
(
'.'
,
'/'
)
group
.
tr
(
'.'
,
'/'
)
end
end
...
...
changelogs/unreleased/299330-limit-license-file-icon.yml
0 → 100644
View file @
df8aa2a5
---
title
:
Partially fix incorrect icons for non-standard license files
merge_request
:
53207
author
:
type
:
fixed
changelogs/unreleased/324288-support-versionless-package-in-maven-sync-worker.yml
0 → 100644
View file @
df8aa2a5
---
title
:
Fix the Maven sync worker to not fail if the versionless package is not found
merge_request
:
56514
author
:
type
:
fixed
doc/administration/incoming_email.md
View file @
df8aa2a5
...
@@ -220,8 +220,11 @@ Example for source installs:
...
@@ -220,8 +220,11 @@ Example for source installs:
incoming_email
:
incoming_email
:
enabled
:
true
enabled
:
true
# The email address including the `%{key}` placeholder that will be replaced to reference the item being replied to.
# The email address including the %{key} placeholder that will be replaced to reference the
# The placeholder can be omitted but if present, it must appear in the "user" part of the address (before the `@`).
# item being replied to. This %{key} should be included in its entirety within the email
# address and not replaced by another value.
# For example: emailadress+%{key}@gmail.com.
# The placeholder must appear in the "user" part of the address (before the `@`).
address
:
"
incoming+%{key}@gitlab.example.com"
address
:
"
incoming+%{key}@gitlab.example.com"
# Email account username
# Email account username
...
...
spec/services/packages/maven/metadata/sync_service_spec.rb
View file @
df8aa2a5
...
@@ -131,7 +131,7 @@ RSpec.describe ::Packages::Maven::Metadata::SyncService do
...
@@ -131,7 +131,7 @@ RSpec.describe ::Packages::Maven::Metadata::SyncService do
expect
(
::
Packages
::
Maven
::
Metadata
::
CreateVersionsXmlService
).
not_to
receive
(
:new
)
expect
(
::
Packages
::
Maven
::
Metadata
::
CreateVersionsXmlService
).
not_to
receive
(
:new
)
end
end
it_behaves_like
'returning a
n error service response'
,
message:
'Non existing versionless package
'
it_behaves_like
'returning a
success service response'
,
message:
'Non existing versionless package(s). Nothing to do.
'
end
end
context
'without a metadata package file for versions'
do
context
'without a metadata package file for versions'
do
...
@@ -141,7 +141,7 @@ RSpec.describe ::Packages::Maven::Metadata::SyncService do
...
@@ -141,7 +141,7 @@ RSpec.describe ::Packages::Maven::Metadata::SyncService do
expect
(
::
Packages
::
Maven
::
Metadata
::
CreateVersionsXmlService
).
not_to
receive
(
:new
)
expect
(
::
Packages
::
Maven
::
Metadata
::
CreateVersionsXmlService
).
not_to
receive
(
:new
)
end
end
it_behaves_like
'returning a
n error service response'
,
message:
'Non existing metadata file for versions
'
it_behaves_like
'returning a
success service response'
,
message:
'Non existing versionless package(s). Nothing to do.
'
end
end
context
'without a project'
do
context
'without a project'
do
...
@@ -205,7 +205,7 @@ RSpec.describe ::Packages::Maven::Metadata::SyncService do
...
@@ -205,7 +205,7 @@ RSpec.describe ::Packages::Maven::Metadata::SyncService do
it_behaves_like
'returning a success service response'
,
message:
'Versionless package for versions destroyed'
it_behaves_like
'returning a success service response'
,
message:
'Versionless package for versions destroyed'
end
end
context
'with a too big maven metadata file for
versio
ns'
do
context
'with a too big maven metadata file for
plugi
ns'
do
before
do
before
do
metadata_file_for_plugins
.
update!
(
size:
100
.
megabytes
)
metadata_file_for_plugins
.
update!
(
size:
100
.
megabytes
)
end
end
...
@@ -244,6 +244,15 @@ RSpec.describe ::Packages::Maven::Metadata::SyncService do
...
@@ -244,6 +244,15 @@ RSpec.describe ::Packages::Maven::Metadata::SyncService do
it_behaves_like
'returning a success service response'
,
message:
'New metadata package files created'
it_behaves_like
'returning a success service response'
,
message:
'New metadata package files created'
end
end
context
'without a versionless package for versions'
do
before
do
versionless_package_for_versions
.
package_files
.
update_all
(
file_name:
'test.txt'
)
expect
(
::
Packages
::
Maven
::
Metadata
::
CreateVersionsXmlService
).
not_to
receive
(
:new
)
end
it_behaves_like
'returning a success service response'
,
message:
'No changes for plugins xml'
end
context
'without a metadata package file for plugins'
do
context
'without a metadata package file for plugins'
do
before
do
before
do
versionless_package_for_plugins
.
package_files
.
update_all
(
file_name:
'test.txt'
)
versionless_package_for_plugins
.
package_files
.
update_all
(
file_name:
'test.txt'
)
...
...
spec/workers/packages/maven/metadata/sync_worker_spec.rb
View file @
df8aa2a5
...
@@ -61,9 +61,10 @@ RSpec.describe Packages::Maven::Metadata::SyncWorker, type: :worker do
...
@@ -61,9 +61,10 @@ RSpec.describe Packages::Maven::Metadata::SyncWorker, type: :worker do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
it
'does not create the updated metadata files'
do
it
'does not create the updated metadata files'
do
expect
(
worker
).
to
receive
(
:log_extra_metadata_on_done
).
with
(
:message
,
'Non existing versionless package(s). Nothing to do.'
)
expect
{
subject
}
expect
{
subject
}
.
to
change
{
::
Packages
::
PackageFile
.
count
}.
by
(
0
)
.
to
change
{
::
Packages
::
PackageFile
.
count
}.
by
(
0
)
.
and
raise_error
(
described_class
::
SyncError
,
'Non existing versionless package'
)
end
end
end
end
...
@@ -146,9 +147,10 @@ RSpec.describe Packages::Maven::Metadata::SyncWorker, type: :worker do
...
@@ -146,9 +147,10 @@ RSpec.describe Packages::Maven::Metadata::SyncWorker, type: :worker do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
it
'does not create the updated metadata files'
do
it
'does not create the updated metadata files'
do
expect
(
worker
).
to
receive
(
:log_extra_metadata_on_done
).
with
(
:message
,
'Non existing versionless package(s). Nothing to do.'
)
expect
{
subject
}
expect
{
subject
}
.
to
change
{
::
Packages
::
PackageFile
.
count
}.
by
(
0
)
.
to
change
{
::
Packages
::
PackageFile
.
count
}.
by
(
0
)
.
and
raise_error
(
described_class
::
SyncError
,
'Non existing versionless package'
)
end
end
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