tractive 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f7da399b45e9e780b66e3da4ed52181b94f9d5ec6c98293d9dc590688f4aa99
4
- data.tar.gz: 5e64a51c2cae40d501e02144c2acf0c72076bc04b4344b51fb46f92610a4e3c3
3
+ metadata.gz: 6d01e25bb5de4180b95349f37e698b9717900155092fe35e43b293d9192bef63
4
+ data.tar.gz: 0a7fe333d0b26b440ddd5c0e9b2e6728a58da011080a33094ae0c7cf4e2254fe
5
5
  SHA512:
6
- metadata.gz: f112048a0c429f2f1e901c713dd610dc72955ff0b8eab97d463816ede7a57f3406541ef7c4ad1ae024be5d2ddf33f06d0385a9b54cc446fa4d8fbdae00656b04
7
- data.tar.gz: 30da24854a6b49bb38d5075740fc13d5c5a22b53ceca315595b955d63c1450ba93f0fa2509789e6a69186d4cd204033de21fcdec3e39e855c4a18270be40a594
6
+ metadata.gz: 1be7e6bf606c4482e7f04ae4b752ebaa483618a7831326e0862ddc70919c5480963860468691981a7a0c562569b18071c4c4b977b1ca2cdf83543ae898181aa1
7
+ data.tar.gz: 9afb81d65732dac50a9285823ab68305811e4a081af14119eb2f93fc9fb3554a0cef45d1342354decdb56a60d755caa97445030fbbe3545bced627ede70b9ae3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tractive (1.0.2)
4
+ tractive (1.0.3)
5
5
  mysql2
6
6
  ox
7
7
  rest-client
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}: {username on GitHub}
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: example-matt
426
- valencia: example-vale
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>: <username on GitHub>
28
- matthew@example.org: example-matt
29
- valencia: example-vale
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.make_hash("", users),
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
@@ -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",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tractive
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
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.2
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-12 00:00:00.000000000 Z
11
+ date: 2021-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2