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
68e4d865
Commit
68e4d865
authored
May 07, 2021
by
Illya Klymov
Committed by
Mike Greiling
May 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce .git in the URL when importing Repo by URL
parent
8cd819af
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
5 deletions
+29
-5
app/views/projects/_import_project_pane.html.haml
app/views/projects/_import_project_pane.html.haml
+1
-1
app/views/shared/_import_form.html.haml
app/views/shared/_import_form.html.haml
+8
-2
changelogs/unreleased/276953-enforce-git-in-the-url-when-importing-repo-by-url.yml
...953-enforce-git-in-the-url-when-importing-repo-by-url.yml
+5
-0
ee/spec/features/projects/new_project_spec.rb
ee/spec/features/projects/new_project_spec.rb
+2
-2
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/features/projects/new_project_spec.rb
spec/features/projects/new_project_spec.rb
+10
-0
No files found.
app/views/projects/_import_project_pane.html.haml
View file @
68e4d865
...
...
@@ -83,7 +83,7 @@
.js-toggle-content.toggle-import-form
{
class:
(
'hide'
if
active_tab
!=
'import'
)
}
=
form_for
@project
,
html:
{
class:
'new_project'
}
do
|
f
|
=
form_for
@project
,
html:
{
class:
'new_project
gl-show-field-errors
'
}
do
|
f
|
%hr
=
render
"shared/import_form"
,
f:
f
=
render
'projects/new_project_fields'
,
f:
f
,
project_name_id:
"import-url-name"
,
hide_init_with_readme:
true
,
track_label:
track_label
app/views/shared/_import_form.html.haml
View file @
68e4d865
...
...
@@ -6,8 +6,14 @@
=
f
.
label
:import_url
,
class:
'label-bold'
do
%span
=
_
(
'Git repository URL'
)
=
f
.
text_field
:import_url
,
value:
import_url
.
sanitized_url
,
autocomplete:
'off'
,
class:
'form-control gl-form-input'
,
placeholder:
'https://gitlab.company.com/group/project.git'
,
required:
true
=
f
.
text_field
:import_url
,
value:
import_url
.
sanitized_url
,
autocomplete:
'off'
,
class:
'form-control gl-form-input'
,
placeholder:
'https://gitlab.company.com/group/project.git'
,
required:
true
,
pattern:
'(?:git|https?):\/\/.*/.*\.git$'
,
title:
_
(
'Please provide a valid URL ending with .git'
)
.row
.form-group.col-md-6
...
...
changelogs/unreleased/276953-enforce-git-in-the-url-when-importing-repo-by-url.yml
0 → 100644
View file @
68e4d865
---
title
:
Enforce .git suffix when importing git repo
merge_request
:
61115
author
:
type
:
changed
ee/spec/features/projects/new_project_spec.rb
View file @
68e4d865
...
...
@@ -74,7 +74,7 @@ RSpec.describe 'New project', :js do
page
.
within
'#import-project-pane'
do
first
(
'.js-import-git-toggle-button'
).
click
fill_in
'project_import_url'
,
with:
'http://foo.git'
fill_in
'project_import_url'
,
with:
'http://foo
/bar
.git'
fill_in
'project_name'
,
with:
'import-project-with-features1'
fill_in
'project_path'
,
with:
'import-project-with-features1'
choose
'project_visibility_level_20'
...
...
@@ -94,7 +94,7 @@ RSpec.describe 'New project', :js do
page
.
within
'#ci-cd-project-pane'
do
find
(
'.js-import-git-toggle-button'
).
click
fill_in
'project_import_url'
,
with:
'http://foo.git'
fill_in
'project_import_url'
,
with:
'http://foo
/bar
.git'
fill_in
'project_name'
,
with:
'CI CD Project1'
fill_in
'project_path'
,
with:
'ci-cd-project1'
choose
'project_visibility_level_20'
...
...
locale/gitlab.pot
View file @
68e4d865
...
...
@@ -24322,6 +24322,9 @@ msgstr ""
msgid "Please provide a valid URL"
msgstr ""
msgid "Please provide a valid URL ending with .git"
msgstr ""
msgid "Please provide a valid YouTube URL or ID"
msgstr ""
...
...
spec/features/projects/new_project_spec.rb
View file @
68e4d865
...
...
@@ -355,6 +355,16 @@ RSpec.describe 'New project', :js do
expect
(
git_import_instructions
).
to
have_content
'Git repository URL'
end
it
'reports error if repo URL does not end with .git'
do
fill_in
'project_import_url'
,
with:
'http://foo/bar'
fill_in
'project_name'
,
with:
'import-project-without-git-suffix'
fill_in
'project_path'
,
with:
'import-project-without-git-suffix'
click_button
'Create project'
expect
(
page
).
to
have_text
(
'Please provide a valid URL ending with .git'
)
end
it
'keeps "Import project" tab open after form validation error'
do
collision_project
=
create
(
:project
,
name:
'test-name-collision'
,
namespace:
user
.
namespace
)
...
...
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