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
14cba850
Commit
14cba850
authored
Feb 26, 2021
by
Eric Engestrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: add helper function to computer a group's Dependency Proxy URL
parent
3b5f46c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+6
-0
app/views/groups/dependency_proxies/_url.html.haml
app/views/groups/dependency_proxies/_url.html.haml
+1
-3
spec/helpers/groups_helper_spec.rb
spec/helpers/groups_helper_spec.rb
+7
-0
No files found.
app/helpers/groups_helper.rb
View file @
14cba850
...
@@ -99,6 +99,12 @@ module GroupsHelper
...
@@ -99,6 +99,12 @@ module GroupsHelper
.
count
.
count
end
end
def
group_dependency_proxy_url
(
group
)
# The namespace path can include uppercase letters, which
# Docker doesn't allow. The proxy expects it to be downcased.
"
#{
group_url
(
group
).
downcase
}#{
DependencyProxy
::
URL_SUFFIX
}
"
end
def
group_icon_url
(
group
,
options
=
{})
def
group_icon_url
(
group
,
options
=
{})
if
group
.
is_a?
(
String
)
if
group
.
is_a?
(
String
)
group
=
Group
.
find_by_full_path
(
group
)
group
=
Group
.
find_by_full_path
(
group
)
...
...
app/views/groups/dependency_proxies/_url.html.haml
View file @
14cba850
-# The namespace path can include uppercase letters, which
-
proxy_url
=
group_dependency_proxy_url
(
@group
)
-# Docker doesn't allow. The proxy expects it to be downcased.
-
proxy_url
=
"
#{
group_url
(
@group
).
downcase
}#{
DependencyProxy
::
URL_SUFFIX
}
"
%h5
.prepend-top-20
=
_
(
'Dependency proxy URL'
)
%h5
.prepend-top-20
=
_
(
'Dependency proxy URL'
)
...
...
spec/helpers/groups_helper_spec.rb
View file @
14cba850
...
@@ -23,6 +23,13 @@ RSpec.describe GroupsHelper do
...
@@ -23,6 +23,13 @@ RSpec.describe GroupsHelper do
end
end
end
end
describe
'group_dependency_proxy_url'
do
it
'converts uppercase letters to lowercase'
do
group
=
create
(
:group
,
path:
'GroupWithUPPERcaseLetters'
)
expect
(
group_dependency_proxy_url
(
group
)).
to
end_with
(
"/groupwithuppercaseletters
#{
DependencyProxy
::
URL_SUFFIX
}
"
)
end
end
describe
'group_lfs_status'
do
describe
'group_lfs_status'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
,
namespace_id:
group
.
id
)
}
let!
(
:project
)
{
create
(
:project
,
namespace_id:
group
.
id
)
}
...
...
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