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
Hide 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 = {
'
gradle.properties
'
:
'
gradle
'
,
gradlew
:
'
gradle
'
,
'
gradle-wrapper.properties
'
:
'
gradle
'
,
license
:
'
certificate
'
,
'
license.md
'
:
'
certificate
'
,
'
license.md.rendered
'
:
'
certificate
'
,
'
license.txt
'
:
'
certificate
'
,
licence
:
'
certificate
'
,
'
licence.md
'
:
'
certificate
'
,
'
licence.md.rendered
'
:
'
certificate
'
,
'
licence.txt
'
:
'
certificate
'
,
COPYING
:
'
certificate
'
,
'
COPYING.LESSER
'
:
'
certificate
'
,
LICENSE
:
'
certificate
'
,
LICENCE
:
'
certificate
'
,
'
LICENSE.md
'
:
'
certificate
'
,
'
LICENCE.md
'
:
'
certificate
'
,
'
LICENSE.txt
'
:
'
certificate
'
,
'
LICENCE.txt
'
:
'
certificate
'
,
'
.gitlab-license
'
:
'
certificate
'
,
dockerfile
:
'
docker
'
,
'
docker-compose.yml
'
:
'
docker
'
,
'
.mailmap
'
:
'
email
'
,
...
...
app/services/packages/maven/metadata/sync_service.rb
View file @
df8aa2a5
...
...
@@ -13,16 +13,20 @@ module Packages
def
execute
return
error
(
'Blank package name'
)
unless
package_name
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
result
=
update_plugins_xml
return
result
if
result
.
error?
end
update_versions_xml
# update versionless_package for versions if it exists
return
update_versions_xml
if
metadata_package_file_for_versions
result
end
private
...
...
@@ -79,6 +83,9 @@ module Packages
def
metadata_package_file_for_plugins
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
))
end
end
...
...
@@ -106,6 +113,8 @@ module Packages
end
def
package_name_for_plugins
return
unless
versionless_package_for_versions
group
=
versionless_package_for_versions
.
maven_metadatum
.
app_group
group
.
tr
(
'.'
,
'/'
)
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:
incoming_email
:
enabled
:
true
# The email address including the `%{key}` placeholder that will be replaced to reference the item being replied to.
# The placeholder can be omitted but if present, it must appear in the "user" part of the address (before the `@`).
# The email address including the %{key} placeholder that will be replaced to reference 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"
# 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
expect
(
::
Packages
::
Maven
::
Metadata
::
CreateVersionsXmlService
).
not_to
receive
(
:new
)
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
context
'without a metadata package file for versions'
do
...
...
@@ -141,7 +141,7 @@ RSpec.describe ::Packages::Maven::Metadata::SyncService do
expect
(
::
Packages
::
Maven
::
Metadata
::
CreateVersionsXmlService
).
not_to
receive
(
:new
)
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
context
'without a project'
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'
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
metadata_file_for_plugins
.
update!
(
size:
100
.
megabytes
)
end
...
...
@@ -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'
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
before
do
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
let
(
:project
)
{
create
(
:project
)
}
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
}
.
to
change
{
::
Packages
::
PackageFile
.
count
}.
by
(
0
)
.
and
raise_error
(
described_class
::
SyncError
,
'Non existing versionless package'
)
end
end
...
...
@@ -146,9 +147,10 @@ RSpec.describe Packages::Maven::Metadata::SyncWorker, type: :worker do
let
(
:project
)
{
create
(
:project
)
}
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
}
.
to
change
{
::
Packages
::
PackageFile
.
count
}.
by
(
0
)
.
and
raise_error
(
described_class
::
SyncError
,
'Non existing versionless package'
)
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