Skip to content

Commit dce8833

Browse files
authored
Merge pull request piceaTech#56 from maks-io/master
Collection of changes (refactoring, enhancements, bug fixes)
2 parents 826bc4f + 3154d80 commit dce8833

File tree

9 files changed

+4320
-1033
lines changed

9 files changed

+4320
-1033
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The user must be a member of the project you want to copy or else you won't see
3838

3939
1. `cp sample_settings.js settings.js`
4040
1. edit settings.js
41-
1. run `node index.js`
41+
1. run `npm run start`
4242

4343
## Where to find info for the `settings.js`
4444

@@ -82,6 +82,22 @@ What is the name of the new repo
8282

8383
As default it is set to false. Doesn't fire the requests to github api and only does the work on the gitlabb side to test for wonky cases before using up api-calls
8484

85+
#### usePlaceholderIssuesForMissingIssues
86+
87+
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.
88+
89+
#### useReplacementIssuesForCreationFails
90+
91+
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)
92+
93+
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.
94+
95+
#### skipMatchingComments
96+
97+
This is an array (empty per default) that may contain string values. Any note/comment in any issue, that contains one or more of those string values, will be skipped (meaining not migrated). Note that this is case insensitive, therefore the string value `foo` would also lead to skipping notes containing a (sub)string `FOO`.
98+
99+
Suggested values are things like `time spent`, since those kind of terms can be used in GitLab to track time, they are rather meaningless in Github though.
100+
85101
#### mergeRequests
86102

87103
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.
@@ -96,15 +112,34 @@ When one renames the project while transfering so that the projects don't loose
96112

97113
## Import limit
98114

99-
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 transfered 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).
115+
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).
100116

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

103119
## Bugs
104120

121+
### Issue migration fail
122+
123+
See section 'useReplacementIssuesForCreationFails' above for more infos!
124+
One reason seems to be some error with `Octokit` (error message snippet: https://pastebin.com/3VNUNYLh)
125+
126+
### Milestone refs and issue refs
127+
105128
the milestone refs and issue refs do not seem to be rewritten properly at the
106129
moment. specifically, milestones show up like `%4` in comments
107130
and issue refs like `#42` do not remap to the `#42` from gitlab under the new
108131
issue number in github. @ references are remapped properly (yay). If this is a
109132
deal breaker, a large amount of the code to do this has been written it just
110133
appears to no longer work in current form :(
134+
135+
## Feature suggestions / ideas
136+
137+
### Throttling mechanism
138+
139+
A throttling mechanism could maybe help to avoid api rate limit errors.
140+
In some scenarios the ability to migrate is probably more important than the total
141+
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.
142+
143+
### Make request run in parallel
144+
145+
Some requests could be run in parallel, to shorten the total duration. Currently all GitLab- and Github-Api-Requests are being run sequentially.

0 commit comments

Comments
 (0)