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
453528dd
Commit
453528dd
authored
Jul 19, 2021
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track execution of project overwrite service
parent
cef05ad0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
app/services/projects/overwrite_project_service.rb
app/services/projects/overwrite_project_service.rb
+17
-0
config/feature_flags/development/project_overwrite_service_tracking.yml
..._flags/development/project_overwrite_service_tracking.yml
+8
-0
No files found.
app/services/projects/overwrite_project_service.rb
View file @
453528dd
...
...
@@ -5,6 +5,8 @@ module Projects
def
execute
(
source_project
)
return
unless
source_project
&&
source_project
.
namespace
==
@project
.
namespace
start_time
=
::
Gitlab
::
Metrics
::
System
.
monotonic_time
Project
.
transaction
do
move_before_destroy_relationships
(
source_project
)
# Reset is required in order to get the proper
...
...
@@ -25,10 +27,25 @@ module Projects
else
raise
end
ensure
track_service
(
start_time
,
source_project
,
e
)
end
private
def
track_service
(
start_time
,
source_project
,
exception
)
return
if
::
Feature
.
disabled?
(
:project_overwrite_service_tracking
,
source_project
,
default_enabled: :yaml
)
duration
=
::
Gitlab
::
Metrics
::
System
.
monotonic_time
-
start_time
Gitlab
::
AppJsonLogger
.
info
(
class:
self
.
class
.
name
,
namespace_id:
source_project
.
namespace
.
id
,
project_id:
source_project
.
id
,
duration_s:
duration
.
to_f
,
error:
exception
.
class
.
name
)
end
def
move_before_destroy_relationships
(
source_project
)
options
=
{
remove_remaining_elements:
false
}
...
...
config/feature_flags/development/project_overwrite_service_tracking.yml
0 → 100644
View file @
453528dd
---
name
:
project_overwrite_service_tracking
introduced_by_url
:
rollout_issue_url
:
milestone
:
'
14.1'
type
:
development
group
:
group::pipeline execution
default_enabled
:
false
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