lab2hub 0.1.1 → 0.2.0

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -1
  3. data/exe/lab2hub +19 -1
  4. data/lib/lab2hub/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7af3d89f56b78dc9d483166092a8b7f4d408e542
4
- data.tar.gz: 09a5b54e4924fcabedf71c9fd8cf7b0ae48f24c3
3
+ metadata.gz: e6b2261e9f65800ed1a08bc593cf0c1ba955ca59
4
+ data.tar.gz: 975cb694ea3f9b715ac03618abafd625da052ed7
5
5
  SHA512:
6
- metadata.gz: af3304202efe5b6ac8df619b4d7d578f43479f80994ba999b10449b042e755062e35dae6acb8c47aca87dcb1615dbab4cd00aea00edf80b84e1290abd96713cb
7
- data.tar.gz: 7b0f828cdbf61e48cf6b6f57c597650ee840e51a6e645dab144ab1a34b59f273540c485f5c1948ae1bc7d1081e3125b4b03150a2451a810555f6973616a9ce8e
6
+ metadata.gz: 018838f96e784d612462539860f8e19eb3c68207dd6565dc064ed8c95cc4ac4d1744cc70139aa17d21e21c7a2cdbdc78672ee1183e53e2dc68e1df55e3eb301c
7
+ data.tar.gz: 3a3eb76e2ca89a0747de9ce367465e461448b15d41b956a892bf5b1e04c93aefe73d33cef68a9e50a4cb1be38d4a9d487c2bf3be9057f139afd3b1d18e26e18d
data/README.md CHANGED
@@ -3,15 +3,53 @@
3
3
 
4
4
  Easily migrate your projects from GitLab to GitHub.
5
5
 
6
- ## Usage
6
+ ## Installation
7
7
 
8
8
  ```sh
9
9
  gem install lab2hub
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```sh
10
15
  lab2hub --config
11
16
  vi config.yaml
12
17
  lab2hub PROJECT_NAME_ON_GITLAB
13
18
  ```
14
19
 
20
+ ## Features
21
+
22
+ lab2hub migrates your:
23
+
24
+ - Project's title, description, visibility (public or private), and git repository.
25
+ - Issues with comments
26
+
27
+ ### Work In Progress (WIP)
28
+
29
+ - Attachments in issue notes(comments)
30
+ - Milestones
31
+ - Labels
32
+ - Wiki
33
+
34
+ ### config.yaml
35
+
36
+ `config.yaml` file contains the private access tokens for GitHub and GitLab,
37
+ and those tokens are neccessary to access your private repositories on GitLab and
38
+ create new repositories on GitHub.
39
+
40
+ Create `config.yaml` file in the currently working with `lab2hub --config`, and
41
+ open the file with an text editor, and then replace `GITHUB_PERSONAL_ACCESS_TOKEN` and `GITLAB_PRIVATE_TOKEN` with your own tokens:
42
+
43
+ ```yaml
44
+ github: GITHUB_PERSONAL_ACCESS_TOKEN
45
+ gitlab: GITLAB_PRIVATE_TOKEN
46
+ ```
47
+
48
+ Access tokens can be generated and obtained from here:
49
+
50
+ - GitHub: https://github.com/settings/tokens
51
+ - GitLab: https://gitlab.com/profile/account
52
+
15
53
  ## Development
16
54
 
17
55
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -87,7 +87,7 @@ begin
87
87
  puts %x(#{cmd} "#{arg1}" "#{arg2}" "#{arg3}")
88
88
 
89
89
  # Migrate issues
90
- Gitlab.issues(project.id).auto_paginate.each do |issue|
90
+ Gitlab.issues(project.id).auto_paginate.reverse.each do |issue|
91
91
  puts '-' * 80
92
92
  pp issue
93
93
  created = github.issues.create({
@@ -98,6 +98,24 @@ begin
98
98
  labels: issue.labels
99
99
  })
100
100
  pp created
101
+
102
+ # Issue notes (comments)
103
+ notes = Gitlab.issue_notes(project.id, issue.id).auto_paginate
104
+
105
+ notes.select! do |note|
106
+ note.body != 'Status changed to closed' && note.body != 'Status changed to reopened'
107
+ end
108
+
109
+ # Sort by
110
+ notes.each do |note|
111
+ github.issues.comments.create({
112
+ user: repo.owner.login,
113
+ repo: repo.name,
114
+ number: created.number,
115
+ body: note.body
116
+ })
117
+ end
118
+
101
119
  if issue.state == 'closed'
102
120
  github.issues.edit({
103
121
  user: repo.owner.login,
@@ -1,3 +1,3 @@
1
1
  module Lab2hub
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lab2hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - buo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2016-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler