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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
20486593
Commit
20486593
authored
Mar 27, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip MR metrics when importing projects from GitHub
parent
336ba94a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
3 deletions
+7
-3
app/models/concerns/importable.rb
app/models/concerns/importable.rb
+3
-0
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+2
-1
app/models/merge_request.rb
app/models/merge_request.rb
+0
-1
lib/gitlab/github_import/pull_request_formatter.rb
lib/gitlab/github_import/pull_request_formatter.rb
+2
-1
No files found.
app/models/concerns/importable.rb
View file @
20486593
...
...
@@ -3,4 +3,7 @@ module Importable
attr_accessor
:importing
alias_method
:importing?
,
:importing
attr_accessor
:skip_metrics
alias_method
:skip_metrics?
,
:skip_metrics
end
app/models/concerns/issuable.rb
View file @
20486593
...
...
@@ -14,6 +14,7 @@ module Issuable
include
Awardable
include
Taskable
include
TimeTrackable
include
Importable
# This object is used to gather issuable meta data for displaying
# upvotes, downvotes, notes and closing merge requests count for issues and merge requests
...
...
@@ -99,7 +100,7 @@ module Issuable
acts_as_paranoid
after_save
:update_assignee_cache_counts
,
if: :assignee_id_changed?
after_save
:record_metrics
after_save
:record_metrics
,
unless: :skip_metrics?
def
update_assignee_cache_counts
# make sure we flush the cache for both the old *and* new assignees(if they exist)
...
...
app/models/merge_request.rb
View file @
20486593
...
...
@@ -3,7 +3,6 @@ class MergeRequest < ActiveRecord::Base
include
Issuable
include
Referable
include
Sortable
include
Importable
belongs_to
:target_project
,
class_name:
"Project"
belongs_to
:source_project
,
class_name:
"Project"
...
...
lib/gitlab/github_import/pull_request_formatter.rb
View file @
20486593
...
...
@@ -20,7 +20,8 @@ module Gitlab
author_id:
author_id
,
assignee_id:
assignee_id
,
created_at:
raw_data
.
created_at
,
updated_at:
raw_data
.
updated_at
updated_at:
raw_data
.
updated_at
,
skip_metrics:
true
}
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