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
4f5db8c1
Commit
4f5db8c1
authored
Aug 16, 2021
by
Kassio Borges
Committed by
Dmitry Gruzd
Aug 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `GitlabImport::Logger` `import_source` key to `import_type`
parent
855457e2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
8 deletions
+9
-8
doc/development/github_importer.md
doc/development/github_importer.md
+2
-1
lib/gitlab/github_import/bulk_importing.rb
lib/gitlab/github_import/bulk_importing.rb
+1
-1
lib/gitlab/github_import/logger.rb
lib/gitlab/github_import/logger.rb
+1
-1
spec/lib/gitlab/github_import/bulk_importing_spec.rb
spec/lib/gitlab/github_import/bulk_importing_spec.rb
+3
-3
spec/lib/gitlab/github_import/logger_spec.rb
spec/lib/gitlab/github_import/logger_spec.rb
+2
-2
No files found.
doc/development/github_importer.md
View file @
4f5db8c1
...
...
@@ -238,9 +238,10 @@ The code for this resides in:
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48512/diffs) in GitLab 13.7.
> - Number of imported objects [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64256) in GitLab 14.1.
> - `Gitlab::GithubImport::Logger` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65968) in GitLab 14.2.
> - `import_source` [renamed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67726) to `import_type` in GitLab 14.2.
The import progress can be checked in the
`logs/importer.log`
file. Each relevant import is logged
with
`"import_
sourc
e": "github"`
and the
`"project_id"`
.
with
`"import_
typ
e": "github"`
and the
`"project_id"`
.
The last log entry reports the number of objects fetched and imported:
...
...
lib/gitlab/github_import/bulk_importing.rb
View file @
4f5db8c1
...
...
@@ -44,7 +44,7 @@ module Gitlab
def
log_and_increment_counter
(
value
,
operation
)
Gitlab
::
Import
::
Logger
.
info
(
import_
sourc
e: :github
,
import_
typ
e: :github
,
project_id:
project
.
id
,
importer:
self
.
class
.
name
,
message:
"
#{
value
}
#{
object_type
.
to_s
.
pluralize
}
#{
operation
}
"
...
...
lib/gitlab/github_import/logger.rb
View file @
4f5db8c1
...
...
@@ -4,7 +4,7 @@ module Gitlab
module
GithubImport
class
Logger
<
::
Gitlab
::
Import
::
Logger
def
default_attributes
super
.
merge
(
import_
sourc
e: :github
)
super
.
merge
(
import_
typ
e: :github
)
end
end
end
...
...
spec/lib/gitlab/github_import/bulk_importing_spec.rb
View file @
4f5db8c1
...
...
@@ -36,7 +36,7 @@ RSpec.describe Gitlab::GithubImport::BulkImporting do
expect
(
Gitlab
::
Import
::
Logger
)
.
to
receive
(
:info
)
.
with
(
import_
sourc
e: :github
,
import_
typ
e: :github
,
project_id:
1
,
importer:
'MyImporter'
,
message:
'1 object_types fetched'
...
...
@@ -70,7 +70,7 @@ RSpec.describe Gitlab::GithubImport::BulkImporting do
expect
(
Gitlab
::
Import
::
Logger
)
.
to
receive
(
:info
)
.
with
(
import_
sourc
e: :github
,
import_
typ
e: :github
,
project_id:
1
,
importer:
'MyImporter'
,
message:
'0 object_types fetched'
...
...
@@ -100,7 +100,7 @@ RSpec.describe Gitlab::GithubImport::BulkImporting do
.
to
receive
(
:info
)
.
twice
.
with
(
import_
sourc
e: :github
,
import_
typ
e: :github
,
project_id:
1
,
importer:
'MyImporter'
,
message:
'5 object_types imported'
...
...
spec/lib/gitlab/github_import/logger_spec.rb
View file @
4f5db8c1
...
...
@@ -21,7 +21,7 @@ RSpec.describe Gitlab::GithubImport::Logger do
'message'
=>
'Hello world'
,
'correlation_id'
=>
'new-correlation-id'
,
'feature_category'
=>
'importers'
,
'import_
sourc
e'
=>
'github'
'import_
typ
e'
=>
'github'
})
end
...
...
@@ -34,7 +34,7 @@ RSpec.describe Gitlab::GithubImport::Logger do
'hello'
=>
1
,
'correlation_id'
=>
'new-correlation-id'
,
'feature_category'
=>
'importers'
,
'import_
sourc
e'
=>
'github'
'import_
typ
e'
=>
'github'
})
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