Skip to content

Commit cc30593

Browse files
authored
Merge pull request #126 from mdbenito/feature/126-milestone-references
References to milestones
2 parents a9f2cd6 + 11c10a0 commit cc30593

7 files changed

Lines changed: 802 additions & 606 deletions

File tree

README.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ After doing this, the autolinking of issues, commits, and branches will work. Se
3434

3535
## Usage
3636

37-
The user must be a member of the project you want to copy or else you won't see it in the first step.
37+
The user must be a member of the project you want to copy. This user must be the one
3838

3939
1. `cp sample_settings.ts settings.ts`
4040
1. edit settings.ts
@@ -64,7 +64,11 @@ GitLab's API [does not allow downloading of attachments](https://gitlab.com/gitl
6464

6565
#### github.baseUrl
6666

67-
Where is the github instance hosted? Default is the official `api.github.com` domain
67+
Where is the github instance hosted? The default is the official `github.com` domain
68+
69+
#### github.apiUrl
70+
71+
Point this to the api. The default is `api.github.com`.
6872

6973
#### github.owner
7074

@@ -150,11 +154,15 @@ Set to true (default) to enable using the [GitHub preview API for importing issu
150154

151155
### usePlaceholderIssuesForMissingIssues
152156

153-
If this is set to true (default) then the migration process will automatically create empty dummy issues for every 'missing' GitLab issue (if you deleted an GitLab issue for example). Those issues will be closed on Github and they ensure, that the issue ids stay the same on both, GitLab and Github.
157+
If this is set to true (default) then the migration process will automatically create empty dummy issues for every 'missing' GitLab issue (if you deleted a GitLab issue for example). Those issues will be closed on Github and they ensure that the issue ids stay the same on both GitLab and Github.
158+
159+
#### usePlaceholderMilestonesForMissingMilestones
154160

155-
### useReplacementIssuesForCreationFails
161+
If this is set to true (default) then the migration process will automatically create empty dummy milestones for every 'missing' GitLab milestone (if you deleted a GitLab milestone for example). Those milestones will be closed on Github and they ensure that the milestone ids stay the same on both GitLab and Github.
156162

157-
If this is set to true (default) then the migration process will automatically create so called "replacement-issues" for every issue where the migration fails. This replacement issue will be exactly the same, but the original description will be lost. In the future, the description of the replacement issue will also contain a link to the original issue on GitLab. This way users, who still have access to the GitLab repository can still view its content. However, this is still an open task. (TODO)
163+
#### useReplacementIssuesForCreationFails
164+
165+
If this is set to true (default) then the migration process will automatically create so called "replacement-issues" for every issue where the migration fails. This replacement issue will be exactly the same, but the original description will be lost. In the future, the description of the replacement issue will also contain a link to the original issue on GitLab. This way, users who still have access to the GitLab repository can still view its content. However, this is still an open task. (TODO)
158166

159167
It would of course be better to find the cause for migration fails, so that no replacement issues would be needed. Finding the cause together with a retry-mechanism would be optimal, and will maybe come in the future - currently the replacement-issue-mechanism helps to keep things in order.
160168

@@ -184,9 +192,17 @@ Suggested values:
184192

185193
Object consisting of `logfile` and `log`. If `log` is set to true, then the merge requests are logged in the specified file and not migrated. Conversely, if `log` is set to false, then the merge requests are migrated to GitHub and not logged. If the source or target branches linked to the merge request have been deleted, the merge request cannot be migrated to a pull request; instead, an issue with a custom "gitlab merge request" tag is created with the full comment history of the merge request.
186194

195+
### usermap
196+
197+
Maps gitlab user names to github users. This is used to properly set assignees in issues and PRs and to translate mentions in issues.
198+
199+
### projectmap
200+
201+
This is useful when migrating multiple projects if they are renamed at destination. Provide a map from gitlab names to github names so that any cross-project references (e.g. issues) are not lost.
202+
187203
## Import limit
188204

189-
Because Github has a limit of 5000 Api requests per hour one has to watch out that one doesn't get over this limit. I transferred one of my project with it ~ 300 issues with ~ 200 notes. This totals to some 500 objects excluding commits which are imported through githubs importer. I never got under 3800 remaining requests (while testing it two times in one hour).
205+
Because Github has a limit of 5000 Api requests per hour one has to be careful not to go over this limit. I transferred one of my project with it ~ 300 issues with ~ 200 notes. This totals to some 500 objects excluding commits which are imported through githubs importer. I never got under 3800 remaining requests (while testing it two times in one hour).
190206

191207
So the rule of thumb should be that one can import a repo with ~ 2500 issues without a problem.
192208

@@ -197,7 +213,9 @@ So the rule of thumb should be that one can import a repo with ~ 2500 issues wit
197213
See section 'useReplacementIssuesForCreationFails' above for more infos!
198214
One reason seems to be some error with `Octokit` (error message snippet: https://pastebin.com/3VNUNYLh)
199215

200-
### Milestone refs and issue refs
216+
### Milestone, MR and issue references
217+
218+
This is WIP
201219

202220
the milestone refs and issue refs do not seem to be rewritten properly at the
203221
moment. specifically, milestones show up like `%4` in comments
@@ -214,6 +232,6 @@ A throttling mechanism could maybe help to avoid api rate limit errors.
214232
In some scenarios the ability to migrate is probably more important than the total
215233
duration of the migration process. Some users may even be willing to accept a very long duration (> 1 day if necessary?), if they can get the migration done at all, in return.
216234

217-
### Make request run in parallel
235+
### Make requests run in parallel
218236

219-
Some requests could be run in parallel, to shorten the total duration. Currently all GitLab- and Github-Api-Requests are being run sequentially.
237+
Some requests could be run in parallel, to shorten the total duration. Currently all GitLab- and Github-Api-Requests are run sequentially.

sample_settings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export default {
88
sessionCookie: null,
99
},
1010
github: {
11-
// baseUrl: 'https://gitlab.mycompany.com:123/etc',
11+
// baseUrl: 'https://github.mycompany.com:123/etc',
12+
// apiUrl: 'https//api.github.mycompany.com',
1213
owner: '{{repository owner (user or organization)}}',
1314
token: '{{token}}',
1415
token_owner: '{{token_owner}}',
@@ -41,6 +42,7 @@ export default {
4142
},
4243
debug: false,
4344
useIssueImportAPI: true,
45+
usePlaceholderMilestonesForMissingMilestones: true,
4446
usePlaceholderIssuesForMissingIssues: true,
4547
useReplacementIssuesForCreationFails: true,
4648
useIssuesForAllMergeRequests: false,

0 commit comments

Comments
 (0)