BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
54b21556
Commit
54b21556
authored
Apr 11, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-skip-nested-groups-seed' into 'master'
Move the nested groups seed behind an environment flag See merge request !10601
parents
6975a77e
d33fc982
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
33 deletions
+41
-33
17_cycle_analytics.rb
db/fixtures/development/17_cycle_analytics.rb
+4
-2
20_nested_groups.rb
db/fixtures/development/20_nested_groups.rb
+37
-31
No files found.
db/fixtures/development/17_cycle_analytics.rb
View file @
54b21556
...
...
@@ -223,7 +223,9 @@ class Gitlab::Seeder::CycleAnalytics
end
Gitlab
::
Seeder
.
quiet
do
if
ENV
[
'SEED_CYCLE_ANALYTICS'
]
flag
=
'SEED_CYCLE_ANALYTICS'
if
ENV
[
flag
]
Project
.
all
.
each
do
|
project
|
seeder
=
Gitlab
::
Seeder
::
CycleAnalytics
.
new
(
project
)
seeder
.
seed!
...
...
@@ -235,6 +237,6 @@ Gitlab::Seeder.quiet do
seeder
=
Gitlab
::
Seeder
::
CycleAnalytics
.
new
(
Project
.
order
(
:id
).
first
,
perf:
true
)
seeder
.
seed_metrics!
else
puts
"
Not running the cycle analytics seed file. Use the `SEED_CYCLE_ANALYTICS` environment variable to enable it
."
puts
"
Skipped. Use the `
#{
flag
}
` environment variable to enable
."
end
end
db/fixtures/development/20_nested_groups.rb
View file @
54b21556
...
...
@@ -27,43 +27,49 @@ end
Sidekiq
::
Testing
.
inline!
do
Gitlab
::
Seeder
.
quiet
do
project_urls
=
[
'https://android.googlesource.com/platform/hardware/broadcom/libbt.git'
,
'https://android.googlesource.com/platform/hardware/broadcom/wlan.git'
,
'https://android.googlesource.com/platform/hardware/bsp/bootloader/intel/edison-u-boot.git'
,
'https://android.googlesource.com/platform/hardware/bsp/broadcom.git'
,
'https://android.googlesource.com/platform/hardware/bsp/freescale.git'
,
'https://android.googlesource.com/platform/hardware/bsp/imagination.git'
,
'https://android.googlesource.com/platform/hardware/bsp/intel.git'
,
'https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.1.git'
,
'https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.4.git'
]
flag
=
'SEED_NESTED_GROUPS'
user
=
User
.
admins
.
first
if
ENV
[
flag
]
project_urls
=
[
'https://android.googlesource.com/platform/hardware/broadcom/libbt.git'
,
'https://android.googlesource.com/platform/hardware/broadcom/wlan.git'
,
'https://android.googlesource.com/platform/hardware/bsp/bootloader/intel/edison-u-boot.git'
,
'https://android.googlesource.com/platform/hardware/bsp/broadcom.git'
,
'https://android.googlesource.com/platform/hardware/bsp/freescale.git'
,
'https://android.googlesource.com/platform/hardware/bsp/imagination.git'
,
'https://android.googlesource.com/platform/hardware/bsp/intel.git'
,
'https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.1.git'
,
'https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.4.git'
]
project_urls
.
each_with_index
do
|
url
,
i
|
full_path
=
url
.
sub
(
'https://android.googlesource.com/'
,
''
)
full_path
=
full_path
.
sub
(
/\.git\z/
,
''
)
full_path
,
_
,
project_path
=
full_path
.
rpartition
(
'/'
)
group
=
Group
.
find_by_full_path
(
full_path
)
||
create_group_with_parents
(
user
,
full_path
)
user
=
User
.
admins
.
first
params
=
{
import_url:
url
,
namespace_id:
group
.
id
,
path:
project_path
,
name:
project_path
,
description:
FFaker
::
Lorem
.
sentence
,
visibility_level:
Gitlab
::
VisibilityLevel
.
values
.
sample
}
project_urls
.
each_with_index
do
|
url
,
i
|
full_path
=
url
.
sub
(
'https://android.googlesource.com/'
,
''
)
full_path
=
full_path
.
sub
(
/\.git\z/
,
''
)
full_path
,
_
,
project_path
=
full_path
.
rpartition
(
'/'
)
group
=
Group
.
find_by_full_path
(
full_path
)
||
create_group_with_parents
(
user
,
full_path
)
project
=
Projects
::
CreateService
.
new
(
user
,
params
).
execute
project
.
send
(
:_run_after_commit_queue
)
params
=
{
import_url:
url
,
namespace_id:
group
.
id
,
path:
project_path
,
name:
project_path
,
description:
FFaker
::
Lorem
.
sentence
,
visibility_level:
Gitlab
::
VisibilityLevel
.
values
.
sample
}
if
project
.
valid?
print
'.'
else
print
'F'
project
=
Projects
::
CreateService
.
new
(
user
,
params
).
execute
project
.
send
(
:_run_after_commit_queue
)
if
project
.
valid?
print
'.'
else
print
'F'
end
end
else
puts
"Skipped. Use the `
#{
flag
}
` environment variable to enable."
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