tractive 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.adoc +17 -4
- data/config.example.yaml +10 -3
- data/lib/tractive/info.rb +1 -1
- data/lib/tractive/main.rb +2 -0
- data/lib/tractive/utilities.rb +7 -0
- data/lib/tractive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d01e25bb5de4180b95349f37e698b9717900155092fe35e43b293d9192bef63
|
4
|
+
data.tar.gz: 0a7fe333d0b26b440ddd5c0e9b2e6728a58da011080a33094ae0c7cf4e2254fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1be7e6bf606c4482e7f04ae4b752ebaa483618a7831326e0862ddc70919c5480963860468691981a7a0c562569b18071c4c4b977b1ca2cdf83543ae898181aa1
|
7
|
+
data.tar.gz: 9afb81d65732dac50a9285823ab68305811e4a081af14119eb2f93fc9fb3554a0cef45d1342354decdb56a60d755caa97445030fbbe3545bced627ede70b9ae3
|
data/Gemfile.lock
CHANGED
data/README.adoc
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
= Tractive: migrating from Trac to GitHub
|
2
|
-
|
3
2
|
== Purpose
|
4
3
|
|
5
4
|
Tractive is a tool that helps you migrate Trac instances to GitHub.
|
@@ -413,7 +412,9 @@ GitHub usernames for users, in the following pattern:
|
|
413
412
|
[source,yaml]
|
414
413
|
----
|
415
414
|
users:
|
416
|
-
{Trac email or username}
|
415
|
+
- email: {Trac email or username}
|
416
|
+
name: {name of the person}
|
417
|
+
username: {username on GitHub}
|
417
418
|
...
|
418
419
|
----
|
419
420
|
|
@@ -422,8 +423,20 @@ EXAMPLE:
|
|
422
423
|
[source,yaml]
|
423
424
|
----
|
424
425
|
users:
|
425
|
-
matthew@example.org
|
426
|
-
|
426
|
+
- email: matthew@example.org
|
427
|
+
name: Matthew
|
428
|
+
username: example-matt
|
429
|
+
- email: valencia
|
430
|
+
name: Valencia
|
431
|
+
username: example-vale
|
432
|
+
----
|
433
|
+
|
434
|
+
If you don't want to map a user, you can just leave the `username` empty like below:
|
435
|
+
----
|
436
|
+
users:
|
437
|
+
- email: matthew@example.org
|
438
|
+
name: Matthew
|
439
|
+
username:
|
427
440
|
----
|
428
441
|
|
429
442
|
==== Milestone mapping
|
data/config.example.yaml
CHANGED
@@ -24,9 +24,16 @@ revmap_path: ./example-revmap.txt
|
|
24
24
|
# the issue migration process will fail if the GitHub user specified as owner
|
25
25
|
# (assignee) does not exist.
|
26
26
|
users:
|
27
|
-
# <Trac email or username
|
28
|
-
|
29
|
-
|
27
|
+
# email: <Trac email or username>
|
28
|
+
# name: <Name of the person (optional)>
|
29
|
+
# username: <username on GitHub>
|
30
|
+
- email: matthew@example.org
|
31
|
+
name: Matthew
|
32
|
+
username: example-matt
|
33
|
+
|
34
|
+
- email: valencia
|
35
|
+
name: Valencia
|
36
|
+
username: example-vale
|
30
37
|
|
31
38
|
# Label mapping from Trac ticket to GitHub label
|
32
39
|
labels:
|
data/lib/tractive/info.rb
CHANGED
@@ -30,7 +30,7 @@ module Tractive
|
|
30
30
|
tracstates = Ticket.distinct.select(:status).select_map(:status).compact
|
31
31
|
|
32
32
|
{
|
33
|
-
"users" => Utilities.
|
33
|
+
"users" => Utilities.make_each_hash(users, %w[email name username]),
|
34
34
|
"milestones" => milestones,
|
35
35
|
"labels" => {
|
36
36
|
"type" => Utilities.make_hash("type_", types),
|
data/lib/tractive/main.rb
CHANGED
@@ -8,6 +8,8 @@ module Tractive
|
|
8
8
|
@opts = opts
|
9
9
|
@cfg = YAML.load_file(@opts[:config])
|
10
10
|
|
11
|
+
@cfg["users"] = @cfg["users"].map { |user| [user["email"], user["username"]] }.to_h
|
12
|
+
|
11
13
|
Tractive::Utilities.setup_logger(output_stream: @opts[:log_file] || $stderr, verbose: @opts[:verbose])
|
12
14
|
@db = Tractive::Utilities.setup_db!(@cfg["trac"]["database"])
|
13
15
|
rescue Sequel::DatabaseConnectionError, Sequel::AdapterNotFound, URI::InvalidURIError, Sequel::DatabaseError => e
|
data/lib/tractive/utilities.rb
CHANGED
@@ -7,6 +7,13 @@ module Tractive
|
|
7
7
|
array.map { |i| [i, "#{prefix}#{i}"] }.to_h
|
8
8
|
end
|
9
9
|
|
10
|
+
def make_each_hash(values, keys)
|
11
|
+
values.map do |value|
|
12
|
+
value = [value] unless value.is_a?(Array)
|
13
|
+
keys.zip(value).to_h
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
10
17
|
def setup_db!(db_url)
|
11
18
|
files_to_load = [
|
12
19
|
"lib/tractive/models/attachment.rb",
|
data/lib/tractive/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tractive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|