Giter Site home page Giter Site logo

node-gitlab-2-github's Introduction

node-gitlab-2-github

Install

  1. You need nodejs and npm installed
  2. Clone this repo with git clone https://github.com/piceaTech/node-gitlab-2-github.git
  3. cd node-gitlab-2-github
  4. npm i

Preliminaries

Before using this script, you must mirror your GitLab repo to your new GitHub repo. This can be done with the following steps:

# Clone the repo from GitLab using the `--mirror` option. This is like
# `--bare` but also copies all refs as-is. Useful for a full backup/move.
git clone --mirror [email protected]:username/repo.git

# Change into newly created repo directory
cd repo

# Push to GitHub using the `--mirror` option.  The `--no-verify` option skips any hooks.
git push --no-verify --mirror [email protected]:username/repo.git

# Set push URL to the mirror location
git remote set-url --push origin [email protected]:username/repo.git

# To periodically update the repo on GitHub with what you have in GitLab
git fetch -p origin
git push --no-verify --mirror

After doing this, the autolinking of issues, commits, and branches will work. See Usage for next steps.

Usage

The user must be a member of the project you want to copy. This user must be the one

  1. cp sample_settings.ts settings.ts
  2. edit settings.ts
  3. run npm run start

Docker

If you don't have Node.js installed in your local environment and don't want to install it you can use the Dockerized approach.

  1. Make sure that you have Docker installed in your computer. You can test running docker version in the terminal.
  2. cp sample_settings.ts settings.ts
  3. edit settings.ts
  4. docker build -t node-gitlab-2-github:latest ., or, you can use make build-image
  5. docker run node-gitlab-2-github:latest, or, you can use make docker-run

If you want to let it run in the background (detached mode), just use the following command:

  1. docker run -d node-gitlab-2-github:latest

Docker with bind mounts

In order to optimize the usage of the dockerized application, one can use the bind mounts feature of Docker (Docker docs). This way, whenever you change the settings.ts file in the host environment it will change in the container filesystem as well.

The process to use this trick is pretty much the same we presented before, the only different is the addition of a flag in the docker command to tell it what is the directory/file to be bound.

  1. Make sure that you have Docker installed in your computer. You can test running docker version in the terminal.
  2. cp sample_settings.ts settings.ts
  3. edit settings.ts
  4. docker build -t node-gitlab-2-github:latest ., or, you can use make build-image
  5. This command must work for Linux or Mac: docker run --mount type=bind,source="$(pwd)/settings.ts",target="/app/settings.ts",readonly node-gitlab-2-github:latest, or, you can use make docker-run-bind
  • If you want to run this last command in the Windows environment, please consult the Docker documentation on how to solve the problem of the pwd command expanding incorrectly there - Docker documentation - Topics for windows.

Where to find info for the settings.ts

gitlab

gitlab.url

The URL under which your gitlab instance is hosted. Default is the official http://gitlab.com domain.

gitlab.token

Go to Settings / Access Tokens. Create a new Access Token with api and read_repository scopes and copy that into the settings.ts

gitlab.projectID

Leave it null for the first run of the script. Then the script will show you which projects there are. Can be either string or number.

gitlab.listArchivedProjects

When listing projects on the first run (projectID = null), include archived ones too. The default is true.

gitlab.sessionCookie

GitLab's API does not allow downloading of attachments and only images can be downloaded using HTTP. To work around this limitation and enable binary attachments to be migrated one can use the session cookie set in the browser after logging in to the gitlab instance. The cookie is named _gitlab_session.

github

github.baseUrl

Where is the github instance hosted? The default is the official github.com domain

github.apiUrl

Point this to the api. The default is api.github.com.

github.owner

Under which organisation or user will the new project be hosted

github.ownerIsOrg

A boolean indicator (default is false) to specify that the owner of this repo is an Organisation.

github.token

Go to Settings / Developer settings / Personal access tokens. Generate a new token with repo scope and copy that into the settings.ts

github.token_owner

Set to the user name of the user whose token is used (see above). This is required to determine whether the user running the migration is also the creator of comments and issues. If this is the case and useIssueCreationAPI is true (see below), the extra line specifying who created a comment or issue will not be added.

github.repo

What is the name of the new repo

github.recreateRepo

If true (default is false), we will try to delete the destination github repository if present, and (re)create it. The github token must be granted delete_repo scope. The newly created repository will be made private by default.

If you've set github.recreateRepo to true and the repo belongs to an Organisation, the github.ownerIsOrg flag must be set as true.

This is useful when debugging this tool or a specific migration. You will always be prompted for confirmation.

s3 (optional)

S3 can be used to store attachments from issues. If omitted, has attachment label will be added to GitHub issue.

s3.accessKeyId and s3.secretAccessKey

AWS credentials that are used to copy attachments from GitLab into the S3 bucket.

IAM User who owns these credential must have write permissions to the bucket.

s3.bucket

Existing bucket, with an appropriate security policy. One possible policy is to allow public access.

s3.region

Specify Region (example: us-west-1) of bucket list of regions

usermap

Maps the usernames from gitlab to github. If the assinee of the gitlab issue is equal to the one currently logged in github it will also get assigned without a usermap. The Mentions in issues will also be translated to the new github name.

projectmap

When one renames the project while transfering so that the projects don't loose there links to the mentioned issues.

conversion

conversion.useLowerCaseLabels

If this is set to true (default) then labels from GitLab will be converted to lowercase in GitHub.

transfer

transfer.milestones

If this is set to true (default) then the migration process will transfer milestones.

transfer.labels

If this is set to true (default) then the migration process will transfer labels.

transfer.issues

If this is set to true (default) then the migration process will transfer issues.

transfer.mergeRequests

If this is set to true (default) then the migration process will transfer merge requests.

transfer.releases

If this is set to true (default) then the migration process will transfer releases. Note that github api for releases is limited and hence this will only transfer the title and description of the releases and add them to github in chronological order, but it would not preserve the original release dates, nor transfer artefacts or assets.

dryRun

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

useIssueImportAPI

Set to true (default) to enable using the GitHub preview API for importing issues. This allows setting the date for issues and comments instead of inserting an additional line in the body.

usePlaceholderIssuesForMissingIssues

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.

usePlaceholderMilestonesForMissingMilestones

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.

useReplacementIssuesForCreationFails

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)

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.

useIssuesForAllMergeRequests

If this is set to true (default is false) then all merge requests will be migrated as GitHub issues (rather than pull requests). This can be used to sidestep the problem where pull requests are rejected by GitHub if the feature branch no longer exists or has been merged.

filterByLabel

Filters all merge requests and issues by these labels. The applicable values can be found in the Gitlab API documentation for issues and merge requests respectively. Default is null which returns all issues/merge requests.

skipMergeRequestStates

Merge requests in GitLab with any of the states listed in this array will not be transferred to GitHub (e.g. set to ['merged', 'closed'] to avoid creating issues for closed MRs whose branches have been deleted).

skipMatchingComments

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.

Suggested values:

  • time spent, since those kind of terms can be used in GitLab to track time, they are rather meaningless in Github though
  • action entries, such as changed the description, added 1 commit, mentioned in merge request, etc as they are interpreted as comments

mergeRequests

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.

usermap

Maps gitlab user names to github users. This is used to properly set assignees in issues and PRs and to translate mentions in issues.

projectmap

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.

Import limit

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).

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

Bugs

Issue migration fail

See section 'useReplacementIssuesForCreationFails' above for more infos! One reason seems to be some error with Octokit (error message snippet: https://pastebin.com/3VNUNYLh)

Milestone, MR and issue references

This is WIP

the milestone refs and issue refs do not seem to be rewritten properly at the moment. specifically, milestones show up like %4 in comments and issue refs like #42 do not remap to the #42 from gitlab under the new issue number in github. @ references are remapped properly (yay). If this is a deal breaker, a large amount of the code to do this has been written it just appears to no longer work in current form :(

Feature suggestions / ideas

Throttling mechanism

A throttling mechanism could maybe help to avoid api rate limit errors. In some scenarios the ability to migrate is probably more important than the total 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.

Make requests run in parallel

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

node-gitlab-2-github's People

Contributors

64j0 avatar adcox avatar akaihola avatar alystair avatar andres-duebi avatar ashleyvega avatar belinhacbr avatar bigorneau avatar chrisgo avatar codemonium avatar dependabot[bot] avatar gaurav5430 avatar jeremyzahner avatar john-forrest avatar logerfo avatar maks-io avatar mdbenito avatar merciercorentin avatar navanjr avatar plusk01 avatar sarunast avatar simonbiggs avatar spruce avatar szepeviktor avatar terales avatar thisismydesign avatar tomoya-sato avatar tpage-alfresco avatar viliuss avatar virzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-gitlab-2-github's Issues

Username mapping fix

Here is my fix for username not mapping appropriately in the body of issues:

SimonBiggs@9aab9ca

Unfortunately my GitHub account is currently rate limited (from using this tool), so I can't submit a pull request with this patch.

Cannot read property 'body' of null

I have a private repo that I am trying to move from GitLab to Github but I keep getting this error message when I try to run the project.

Replaced key/password info for privacy

PS D:\node-gitlab-2-github> node index.js
{ gitlab:
   { url: 'https://gitlab.com/',
     token: 'MyToken',
     projectID: 644417 },
  github:
   { url: 'api.github.com',
     pathPrefix: '',
     owner: 'JoshuaGarrison27',
     username: 'JoshuaGarrison27',
     password: 'Password',
     repo: 'Project1' },
  usermap: { JoshuaGarrison27: 'JoshuaGarrison27' },
  projectmap: { 'JoshuaGarrison27/Project1': 'JoshuaGarrison27/Project1' } }




D:\node-gitlab-2-github\node_modules\gitlab\lib\ApiBaseHTTP.js:88
              return fn(err, ret || JSON.parse(response.body).message);
                                            ^

TypeError: Cannot read property 'body' of null
    at D:\node-gitlab-2-github\node_modules\gitlab\lib\ApiBaseHTTP.js:88:45
    at _Class.wrap_response (D:\node-gitlab-2-github\node_modules\slumber\lib\API.js:192:18)
    at _Class.wrap_response (D:\node-gitlab-2-github\node_modules\slumber\lib\API.js:4:59)
    at Request._callback (D:\node-gitlab-2-github\node_modules\slumber\lib\API.js:210:26)
    at self.callback (D:\node-gitlab-2-github\node_modules\request\request.js:188:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at Request.onRequestError (D:\node-gitlab-2-github\node_modules\request\request.js:884:8)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)

RequestError [HttpError]: Validation Failed: "No commits between master and dev_01"

Thank you for this awesome project.
In my case, all features work well except for Transferring Merge Request.
I tried to solve this error but I couldn't get any clues from GitHub API docs..

It brings all of Merge Requests from my GitLab successfully, but I think problem is Creating Pull Requests to my GitHub.
I'd like to know if you have any idea for this.
Error occurs like :

Creating pull request: !4 - dev-01_MR_0226 // -> this is one of my MR titles
Could not create pull request: !4 - dev-01_MR_0226
RequestError [HttpError]: Validation Failed: {"resource":"PullRequest","code":"custom","message":"No commits between master and dev_01"}
    at C:\node-gitlab-2-github\node_modules\@octokit\request\dist-src\fetch-wrapper.js:49:31      
    at processTicksAndRejections (node:internal/process/task_queues:94:5) {
  status: 422,
  headers: {
    // I'll skip it ! It's too long.
  },
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/makeitmin/skidmarker/pulls',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-rest.js/18.0.0 octokit-core.js/3.1.0 <environment undetectable>',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"title":"dev-01_MR_0226","body":"In GitLab by @Seongmin on Feb 26, 2021, 18:32\\n\\n## Issues\\n axios post url error","head":"dev_01","base":"master"}',
    request: { hook: [Function: bound bound register] }
  },
  errors: [
    {
      resource: 'PullRequest',
      code: 'custom',
      message: 'No commits between master and dev_01'
    }
  ],
  documentation_url: 'https://docs.github.com/rest/reference/pulls#create-a-pull-request'
}

Issues/MRs migration fails with TypeError: body.matchAll is not a function error

Hi 👋
I am having an issue with migrating issues and merge requests (error below). However labels and milestones were migrated ok and correctly.

It fails with the following error:
for issue:

DEBUG:
 TypeError: body.matchAll is not a function
    at /home/nikolay/projects/node-gitlab-2-github/src/utils.ts:45:24
    at step (/home/nikolay/projects/node-gitlab-2-github/src/utils.ts:52:23)
    at Object.next (/home/nikolay/projects/node-gitlab-2-github/src/utils.ts:33:53)
    at /home/nikolay/projects/node-gitlab-2-github/src/utils.ts:27:71
    at new Promise (<anonymous>)
    at __awaiter (/home/nikolay/projects/node-gitlab-2-github/src/utils.ts:23:12)
    at Object.exports.migrateAttachments (/home/nikolay/projects/node-gitlab-2-github/src/utils.ts:36:132)
    at GithubHelper.<anonymous> (/home/nikolay/projects/node-gitlab-2-github/src/githubHelper.ts:817:38)
    at step (/home/nikolay/projects/node-gitlab-2-github/src/githubHelper.ts:52:23)
    at Object.next (/home/nikolay/projects/node-gitlab-2-github/src/githubHelper.ts:33:53)
        -> creating a replacement issue...
        ...ERROR: Could not create replacement issue either!

Statistics:
        Total nr. of issues: 3395
        Nr. of used placeholder issues: 1
        Nr. of used replacement issues: 0
        Nr. of issue migration fails: 3395

for MRs it's the same

Could not create pull request: !1 - WIP: Resolve "Cancel for job without applications"
TypeError: body.matchAll is not a function
    at /home/nikolay/projects/node-gitlab-2-github/src/utils.ts:45:24
    at step (/home/nikolay/projects/node-gitlab-2-github/src/utils.ts:52:23)
    at Object.next (/home/nikolay/projects/node-gitlab-2-github/src/utils.ts:33:53)
    at /home/nikolay/projects/node-gitlab-2-github/src/utils.ts:27:71
    at new Promise (<anonymous>)
    at __awaiter (/home/nikolay/projects/node-gitlab-2-github/src/utils.ts:23:12)
    at Object.exports.migrateAttachments (/home/nikolay/projects/node-gitlab-2-github/src/utils.ts:36:132)
    at GithubHelper.<anonymous> (/home/nikolay/projects/node-gitlab-2-github/src/githubHelper.ts:817:38)
    at step (/home/nikolay/projects/node-gitlab-2-github/src/githubHelper.ts:52:23)
    at Object.next (/home/nikolay/projects/node-gitlab-2-github/src/githubHelper.ts:33:53)

Did I miss something during configuration in the settings.ts file or it's something completely else?

Crash with abuse rate limits

After having migrated ~20 milestones & ~10 issues, the program crashed on an issue creation request, with the following error message:

Error: {"message":"You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.","documentation_url":"https://developer.github.com/v3/#abuse-rate-limits"}

Reading this section & this section from the official docs, I guess the problem comes from performing more than 1 request per second.

I'd say this program doesn't take precautions in term of github rate abuse limits, but I'm really puzzled by the fact that the README mentions a successful 300 issues migration

Cannot read property 'toString' of undefined while fetching GitLab projects

Hi, I am trying to migrate some our projects from our inner enterprise GitLab to GitHub and get following:

An Error occured while fetching all GitLab projects:
TypeError: Cannot read property 'toString' of undefined
at GitlabHelper. (/tmp/gittest/node-gitlab-2-github/src/gitlabHel per.ts:39:26)
at step (/tmp/gittest/node-gitlab-2-github/src/gitlabHelper.ts:33:23)
at Object.next (/tmp/gittest/node-gitlab-2-github/src/gitlabHelper.ts:14:53)
at fulfilled (/tmp/gittest/node-gitlab-2-github/src/gitlabHelper.ts:5:58)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

Any help is appreciated.

Settings are:
import Settings from './src/settings';

export default {
gitlab: {
url: '<Gitlab_root>/<GitLab_subgroup>',
token: 'migrate:',
projectId: null,
},
github: {
baseUrl: 'api.github.com',
owner: '',
token: '',
repo: '<repo_name>',
},
usermap: {
...
},
projectmap: {
'<project_name>': '/<project_name>',
},
conversion: {
useLowerCaseLabels: true,
},
debug: false,
usePlaceholderIssuesForMissingIssues: true,
useReplacementIssuesForCreationFails: true,
useIssuesForAllMergeRequests: false,
skipMatchingComments: [],
mergeRequests: {
logFile: './merge-requests.json',
log: false,
},
}

Does this migrate a Wiki?

I noticed in the description for this package, it alludes to migrating a Wiki from GitLab → GitHub. However, when you search the code of the project for the word "wiki", it isn't found anywhere.

Will this package migrate a Wiki?

Could not create milestone HttpError: 'description' cannot be null

==================================
Transferring Milestones
==================================
Creating: 1.0
Creating: 2.0
Could not create milestone 2.0
{ HttpError: 'description' cannot be null
    at values.forEach (workspace/node-gitlab-2-github/node_modules/@octokit/rest/plugins/validate/validate.js:60:15)
    at Array.forEach (<anonymous>)
    at Object.keys.forEach.parameterName (workspace/node-gitlab-2-github/node_modules/@octokit/rest/plugins/validate/validate.js:38:12)
    at Array.forEach (<anonymous>)
    at validate (workspace/node-gitlab-2-github/node_modules/@octokit/rest/plugins/validate/validate.js:16:23)
  name: 'HttpError',
  status: 400,
  headers: undefined,
  request: undefined }
Creating: 1.1
Creating: 1.2

Module '@octokit/types/dist-types' has no exported member 'IssuesListForRepoResponseData'

The process fails with the latest @octokit/rest version:

\node_modules\ts-node\src\index.ts:434
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/githubHelper.ts:5:10 - error TS2305: Module '"../node_modules/@octokit/types/dist-types"' has no exported member 'IssuesListForRepoResponseData'.

5 import { IssuesListForRepoResponseData, PullsListResponseData } from "@octokit/types";
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/githubHelper.ts:5:41 - error TS2305: Module '"../node_modules/@octokit/types/dist-types"' has no exported member 'PullsListResponseData'.

5 import { IssuesListForRepoResponseData, PullsListResponseData } from "@octokit/types";
                                          ~~~~~~~~~~~~~~~~~~~~~

I manually installed @octokit/[email protected] (minimum version required by this package), and got it working.

gitlab issue gaps with size > 1 not handled correctly

If there are multiple gitlab issues missing in a row, the current code will not correctly create placeholder issues. I faked a dummy gitlab setup, only containing gitlab issues #15, #16 and #17 (with issues #1 to #14 being non-existent). The current code will turn the set of gitlab issues into
[ { iid: 1 }, { iid: 15 }, { iid: 3 }, { iid: 16 }, { iid: 5 }, { iid: 17 } ]

I tested it with the following code, where the for loop is exactly the same as on the master branch currently:

const gitlabIssues = [
  {iid: 15},
  {iid: 16},
  {iid: 17}
];

for (let i = 0; i < gitlabIssues.length; i++) {
  // GitLab issue internal Id (iid)
  let expectedIdx = i + 1;

  // is there a gap in the GitLab issues?
  // Create placeholder issues so that new GitHub issues will have the same
  // issue number as in GitLab. If a placeholder is used it is because there
  // was a gap in GitLab issues -- likely caused by a deleted GitLab issue.
  if (gitlabIssues[i].iid != expectedIdx) {
    gitlabIssues.splice(i, 0, {
      iid: expectedIdx
    });
    i++;
    console.log('Added placeholder issue for GitLab issue #' + expectedIdx);
    console.log("gitlabIssues now looks like this:", gitlabIssues)
  }
}

When you run this you get:

Added placeholder issue for GitLab issue #1
gitlabIssues now looks like this: [ { iid: 1 }, { iid: 15 }, { iid: 16 }, { iid: 17 } ]
Added placeholder issue for GitLab issue #3
gitlabIssues now looks like this: [ { iid: 1 }, { iid: 15 }, { iid: 3 }, { iid: 16 }, { iid: 17 } ]
Added placeholder issue for GitLab issue #5
gitlabIssues now looks like this: [ { iid: 1 },
  { iid: 15 },
  { iid: 3 },
  { iid: 16 },
  { iid: 5 },
  { iid: 17 } ]

When running multiple migrations it produces wrong issue numbers

When running the migration multiple times the issue numbers created between the first migration and the second migration on gitlab will have different issue numbers than on gitlab.

It stems from the different namespaces for the numbers in gitlab and same namespace for the PR and issues in github. That happens because when migrating the MRs of Gitlab will get the issue / PR numbers right after the first few issues.

Currently I can only think of one "solution" and that is to describe this in the README.

Unexpected token

not sure if this is related to #11 but, it seems that my settings are just fine, although I get the following error.

Screenshot 2019-06-12 09 33 14

Seems like I'm doing something trivially wrong. Hope you could give me a hint.

Broken link when issue comment has an image

GitLab hosts the images in comments "locally" (in my example: /uploads/1457ceabe9cd476cc28fb2d26c236bc4/Screen_Shot_2017-02-04_at_9.27.06_PM.png).

Whereas GitHub now hosts them on another domain (https://cloud.githubusercontent.com/assets/.)

However, node-gitlab-2-github, somewhere, uploaded that same image to https://github.com/uploads/1457ceabe9cd476cc28fb2d26c236bc4/Screen_Shot_2017-02-04_at_9.27.06_PM.png, which obviously results in a broken link:

screen shot 2017-02-05 at 9 35 15 pm

Works, but without any results

I would like to get my issues from this repository to this one

It seems to work well for me. At least according to the output of the script.
Here are the results:

➔ node index.js                                                                                                                                               
==================================                                                                                                                            
Skipping Merge Requests                                                                                                                                       
==================================                                                                                                                            
==================================                                                                                                                            
Transferring Milestones                                                                                                                                       
==================================                                                                                                                            
==================================                                                                                                                            
Transferring Labels                                                                                                                                           
==================================                                                                                                                            
Already exists: bug                                                                                                                                           
Creating: confirmed                                                                                                                                           
Creating: critical                                                                                                                                            
Creating: discussion                                                                                                                                          
Already exists: documentation                                                                                                                                 
Already exists: enhancement                                                                                                                                   
Creating: suggestion                                                                                                                                          
Creating: support                                                                                                                                             
Creating: has attachment                                                                                                                                      
==================================                                                                                                                            
Transferring Issues                                                                                                                                           
==================================                                                                                                                            
Transferring 13 issue
..
Transfer complete!

and here you can see that there is nothing created.

My settings are

module.exports = {
  "gitlab": {
    "url": "https://gitlab.version.fz-juelich.de",
    "token": "TOKEN",
    "projectId": 249
  },
  "github": {
    "owner": "jupedsim",
    "token": "TOKEN",
    "repo": "JPSfire"
  },
  "usermap": {
    "chraibi1": "chraibi",
      "graf2": "ArneGraf",
      "sainho93": "zhong1",
      "tscherniewski1": "Tscherniewski",
      "jaeger1": "gjaeger",
      "schroedter1": "schroedtert",
      "andresen1": "Erik-Andresen",
      "hein1": "hein"
  },
    "projectmap": {
        "JuPedSim/JPSfire": "JuPedSim/JPSfire"
  },

  "conversion": {
    "useLowerCaseLabels": false
  },
  "debug": true,
  "mergeRequests": {
    "logFile": "./merge-requests.json",
    "log": false
  }
}

Any idea would be appreciated.

npm ERR! Maximum call stack size exceeded

sudo npm i
[sudo] password for root:
npm WARN notice [SECURITY] set-value has the following vulnerability: 1 high. Go here for more details: https://www.npmjs.com/advisories?search=set-value&version=2.0.1 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] braces has the following vulnerability: 1 low. Go here for more details: https://www.npmjs.com/advisories?search=braces&version=1.8.5 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm ERR! Maximum call stack size exceeded


   ╭──────────────────────────────────────╮
   │                                      │
   │   Update available 5.6.0 → 6.14.4    │
   │       Run npm i npm to update        │
   │                                      │
   ╰──────────────────────────────────────╯


npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-04-15T07_04_41_807Z-debug.log

concat problem

Hi,
I have a problem when run the index,js
TypeError: Cannot read property 'concat' of undefined

Unexpected Token Function

I'm getting the following error when I run the node index.js command:

/home/.../node-gitlab-2-github/index.js:67
async function listProjects() {
      ^^^^^^^^

SyntaxError: Unexpected token function
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3

For context, I'm running Ubuntu 16.04.6 and I installed the npm, nodejs, and nodejs-legacy packages via the apt interface. Is this a version issue? I checked the versions on those packages: nodejs is v4.2.6 and npm is version 3.5.2.

crashes at trying to read GitHub milestones so nothing else is migrated

==================================
Transferring Milestones
==================================
Could not access all GitHub milestones
HttpError: Only absolute URLs are supported
    at /Users/halalpha/Documents/gits/node-gitlab-2-github/node_modules/@octokit/request/lib/request.js:92:13 {
  name: 'HttpError',
  status: 500,
  headers: {},
  request: {
    method: 'GET',
    url: 'api.github.com/repos/duncdrum/ecpo/milestones?state=all',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'node-gitlab-2-github ' +
        'octokit.js/16.1.0 Node.js/12.2.0 ' +
        '(macOS Mojave; x64)',
      authorization: 'token MY_TOKEN'
    },
    request: { timeout: 5000, validate: [Object] }
  }
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1

Is there a way to skip milestones, so i can at least migrate issues. As it stands because milestones errors out no other tasks are run.

GitHub abuse detection might lead to replacement issues

When creating issues at GitHub, I sometimes get HttpError status 403 with the message ‘You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.’ This error leads to the creation of a replacement issue, as can be seen from the output below:

        ...ERROR while migrating issue #5.
DEBUG:
 { HttpError: You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.
...
}
 -> creating a replacement issue...

I’d expect that in this case the issue would be skipped and/or the program would wait before proceeding and no replacement issue is created. There was basically nothing wrong with the issue itself.

undefined:1

I get the following errors

undefined:1
[object Object]
 ^

SyntaxError: Unexpected token o
    at Object.parse (native)
    at /Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/lib/ApiBaseHTTP.js:88:42
    at _Class.wrap_response (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/lib/API.js:192:18)
    at _Class.wrap_response (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/lib/API.js:4:59)
    at Request._callback (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/lib/API.js:215:26)
    at Request.self.callback (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/node_modules/request/request.js:186:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/Users/chraibi/Workspace/node-gitlab-2-github/node_modules/gitlab/node_modules/slumber/node_modules/request/request.js:1081:10)
    at emitOne (events.js:77:13)

This is my settings-file

{
  "gitlab": {
    "url": "http://gitlab.version.fz-juelich.de/",
    "token": "{{TOKEN}}",
    "projectID": null
  },
  "github": {
    "url": "api.github.com",
    "pathPrefix": "JuPedSim",
    "owner": "{{JuPedSim}}",
    "username": "{{chraibi}}",
    "password": "{{pw}}",
    "repo": "{{jpscore}}"
  },
  "usermap": {
    "chraibi1": "chraibi",
      "graf2": "ArneGraf",
      "andresen1": "Erik-Andresen"
  },
  "projectmap": {
    "JuPedSim/jpscore": "JuPedSim/jpscore"
  }
}

I validated the file. Any idea what went wrong?

Import fail if the github project already have milestones

Hello,

When importing my project from gitlab to github I had to do it in two part because the github API shut me down with some kind of abuse mechanism

Here is the message I got

[Error: {"message":"You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.","documentation_
url":"https://developer.github.com/v3#abuse-rate-limits"}]

Anyway when I tried later to import the rest of my issue (some were already imported to github) I got an error here index.js#L70

When debuging a little it appears that getAllGHMilestones() return a map an thus the test if (milestoneDataMapped.indexOf(item.title) < 0) always fail.

Here is the data that produced the issue:

var milestoneDataMapped = [ { id: 2,
        iid: 1,
        project_id: 26,
        title: '24h',
        description: 'Milestone reached after everyone has spent 24h on development',
        state: 'active',
        created_at: '2015-06-16T12:26:25.000Z',
        updated_at: '2015-06-16T12:26:25.000Z',
        due_date: null } ];


var data = { id: 2,
        iid: 1,
        project_id: 26,
        title: '24h',
        description: 'Milestone reached after everyone has spent 24h on development',
        state: 'active',
        created_at: '2015-06-16T12:26:25.000Z',
        updated_at: '2015-06-16T12:26:25.000Z',
        due_date: null };

I tried the following diff and I was able to finish the import.

diff --git a/index.js b/index.js
index 7749ec6..ac4fc3f 100644
--- a/index.js
+++ b/index.js
@@ -59,7 +59,7 @@ if (settings.gitlab.projectID === null) {
       console.log(milestoneDataMapped);
       console.log('\n\n\n\n\n\n\n');

-      async.each(data, function(item, cb) {
+      async.each(data.title, function(item, cb) {
         if (milestoneDataMapped.indexOf(item.title) < 0) {
           console.log('Creating new Milestone', item.title);
           createMilestone(item, function(err, createMilestoneData) {

TypeError: milestoneDataClosed.concat(...).map is not a function

Hello,
at my first attempt to use this tool, I got the error:

Amount of gitlab milestones 0
C:\Users\PASCALMagnard\git\migration\issues\node-gitlab-2-github\index.js:228
milestoneData = milestoneDataClosed.concat(milestoneDataOpen).map(function(item) {
^

TypeError: milestoneDataClosed.concat(...).map is not a function
at C:\Users\PASCALMagnard\git\migration\issues\node-gitlab-2-github\index.js:228:69
at C:\Users\PASCALMagnard\git\migration\issues\node-gitlab-2-github\node_modules\github\api\v3.0.0\issues.js:1047:17
at callCallback (C:\Users\PASCALMagnard\git\migration\issues\node-gitlab-2-github\node_modules\github\index.js:743:17)
at IncomingMessage. (C:\Users\PASCALMagnard\git\migration\issues\node-gitlab-2-github\node_modules\github\index.js:796:25)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

MR to Issue transfer not idempotent

I.e. when the script is run again these issues are re-created. For other entities the entries are not duplicated which is really nice when you have to restart for some reason and would like to pick up where you left off.

Won't transfer issues

I've added all the proper urls, tokens, access keys, usernames, and repo names to settings.js. I've mirrored the repo according to the README instructions. Milestones and tickets transfer just fine. As soon as it gets to transferring issues, I get a 404 error. Any idea what could be going wrong?

Setting issue creator

Hi and thanks for this project for starters! We are migrating from a self-hosted GitLab instance to the open and node-gitlab-2-github seems to do the job nicely for issues etc.

Maybe a dummy question: All issues are created by the user running the migration process (me), and there is a piece of text in the comments telling the original author. Is there any way to create the issues with the names of the original users (with mappings), or is this a limitation of the GitHub API?

Gitlab is not secure error

Hi, we are using gitlab for production and we configured that in one of aws ec2 instance in gitlab we are not providing ssl(https) in gitlab server instead of that we are using one nginx machine to route all our application based on dns in nginx i installed letsencrypt using this i generated certificate for our gitlab in nginx conf file for gitlat am using proxy_pass http:// but in previously in chrome its working fine but in latest days when ever our developers trying to merge any code they are getting some warning saying that "The information your about to submit is not secure" please suggest me i need to change any conf in gitlab or nginx side i dont know how to resolve this issue please help me for this

Ran into issues while migrating data to an organization's repository

I tried using this tool to migrate issues from gitlab to an organization's github repository. However, that didn't quite work out at first, because the repository's URL was encoded to https://.../repos/username/organizationname%2Freponame.
However, after changing my username to the organization's name in settings.json everything worked as expected (saving us quite some work, thanks! :))

Duplicate github Issues are created from gitlab merge requests

When a github PR cannot be created from a gitlab MR, for example because the source branch does not exist, a github Issue is created instead, with a title of pullRequest.title.trim() + ' - [' + pullRequest.state + ']'.

These github Issues are not searched when re-running the migration, resulting in duplicate github Issues being created from gitlab MRs.

Ability to specify to transfer labels, milestones, issues, or merge requests.

Currently this only allows for everything to be transferred. By adding the ability in the settings to specify which sections of content to transfer the user can choose only what needs to be transferred.

NOTE: This could also help users who are running the application more then once to not have to re-transfer content that does not need to be updated.

Error when fetching notes for deleted issue

The problem: an error reading

Could not fetch notes for GitLab issue #undefined
{ StatusCodeError: 400 - {"error":"noteable_id is invalid"}

To recreate:

  • Migrate a project with a deleted issue

The problem is that the placeholderIssue does not include the iid field. When the createIssueComments function attempts to fetch the issue notes for such a placeholder, issue.iid is undefined and the error above is thrown.

Errors while uploading to S3 bucket

Got this error while migrating issue data:

Migrating issue #5 ('some issue')...
Could not download attachment #/uploads/<some uuid>/image.png.
	...ERROR while migrating issue #5.:
DEBUG:
 Error: params.Body is required
    at ManagedUpload.validateBody (/Users/*/*/node-gitlab-2-github/node_modules/aws-sdk/lib/s3/managed_upload.js:271:13)
    at ManagedUpload.configure (/Users/*/*/node-gitlab-2-github/node_modules/aws-sdk/lib/s3/managed_upload.js:123:10)
    at new ManagedUpload (/Users/*/*/node-gitlab-2-github/node_modules/aws-sdk/lib/s3/managed_upload.js:95:10)
    at features.constructor.upload (/Users/*/*/node-gitlab-2-github/node_modules/aws-sdk/lib/services/s3.js:1383:20)
    at Response.<anonymous> (/Users/*/*/node-gitlab-2-github/src/utils.ts:75:16)
    at Request.<anonymous> (/Users/*/*/node-gitlab-2-github/node_modules/aws-sdk/lib/request.js:369:18)
    at Request.callListeners (/Users/*/*/node-gitlab-2-github/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/*/*/node-gitlab-2-github/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit /Users/*/*/node-gitlab-2-github/node_modules/aws-sdk/lib/request.js:688:14)
    at Request.transition (/Users/*/*/node-gitlab-2-github/node_modules/aws-sdk/lib/request.js:22:10) {
  code: 'Error',
  time: 2021-01-18T15:51:28.783Z
}
	-> creating a replacement issue...
	Migrating issue comments...
	...no issue comments available, nothing to migrate.
	...DONE.
	

When observing the S3 bucket, I do see objects (images) being created.

Handling of unexpected server responses

Opening a new issue as a copy of my comment on #11. Unexpected server responses (such as a 401/Not authorized; or if the specified server is not a Gitlab instance) may lead to obscure error messages.

Steps to reproduce

  1. git clone, npm i, cp sample_settings.json settings.json
  2. Replace the value of gitlab.url in settings.json (use e.g. https://gitlab.lrz.de/ or http://www.google.de/)
  3. node index.js

Result

If you use an actual gitlab instance in step 2, you get the message described in #11 (“Unexpected token o in JSON at position 1”).
If you use some other URL (e.g. Google), you get a different message.

Comment

This needs fixing in the gitlab package and has actually been documented at jdalrymple/gitbeaker#149.

However some changes in this codebase might also be in order. Try making the change I suggested upstream, repeat the steps to reproduce and you will end up with another error:

TypeError: projects.sort is not a function

Something like Array.isArray(projects) inside the callback function on line 16 might do the trick.

Exit and documentation_url not found

The error message is:

{ gitlab:
   { url: 'http://gitlab.com/',
     token: 'XXXX',
     projectID: 2394773 },
  github:
   { url: 'api.github.com',
     pathPrefix: '',
     owner: 'GIN-Network',
     username: 'T3KN0KRAT',
     password: 'XXXXX',
     repo: 'gitlabcontrol-test' },
  usermap: { 'adi': 'T3KN0KRAT' },
  projectmap: { 'GIN/gitlabcontrol-test': 'GIN-Network/gitlabcontrol-test' } }
Amount of gitlab milestones 0
{ [Error: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}]
  message: '{"message":"Not Found","documentation_url":"https://developer.github.com/v3"}',
  code: 404 }
FAIL!
/Users/adi/w/py/GIN/tools/node-gitlab-2-github/index.js:216
        exit(1);
        ^

ReferenceError: exit is not defined
    at /Users/adi/w/py/GIN/tools/node-gitlab-2-github/index.js:216:9
    at module.exports.sendError (/Users/adi/w/py/GIN/tools/node-gitlab-2-github/node_modules/github/api/v3.0.0/index.js:32:13)
    at /Users/adi/w/py/GIN/tools/node-gitlab-2-github/node_modules/github/api/v3.0.0/issues.js:1020:29
    at callCallback (/Users/adi/w/py/GIN/tools/node-gitlab-2-github/node_modules/github/index.js:743:17)
    at IncomingMessage.<anonymous> (/Users/adi/w/py/GIN/tools/node-gitlab-2-github/node_modules/github/index.js:793:25)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Forgetting about the exit is not defined error, I don't see anywhere in the code that references a documentation_url. Might you have any ideas of what might be causing this?

Unable to connect to Github

In setting.js I have the following setting for github:

github: {
    owner: "https://api.github.com",
    username: "prastut",
    token: <token generated from Github>
    repo: "trenity"
  },

It throws up error not found. I think I am not able to authenticate from Github. Any help would be highly appreciated, thank you for making this project.

Octokit HttpError: Validation Failed bug when migrating issues

When migrating some issues I get an error, that is somehow related to the octokit module.
A snippet of the error message can be seen here: https://pastebin.com/3VNUNYLh
I also added this bug in README.md as part of the #56 pull request, so in case that PR gets merged, please also remove it there, if you manage to fix this bug. This may also be related to #49, since the error messages pasted there also mention the octokit module.

Needs dependencies updated

NPM audit turns up w/ 2 security vulnerabilities and the issues transfer fails with an 'uncaught promise' error on Node 12+.

After updating the dependencies (ITT the gitlab dep was the issue) both of these issues were fixed.

throwing UnahndledPromiseRejectionWarning

Hi --

I would love to get this up and running, and it seems like most people have had success, however I keep getting the following error and can't trace it. Any thoughts?

(node:28736) UnhandledPromiseRejectionWarning: StatusCodeError: 401 - {"error":"You need to sign in or sign up before continuing."}
at new StatusCodeError (/home/mgruca/DowellLab/node-gitlab-2-github/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/home/mgruca/DowellLab/node-gitlab-2-github/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/home/mgruca/DowellLab/node-gitlab-2-github/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/home/mgruca/DowellLab/node-gitlab-2-github/node_modules/request/request.js:185:22)
at Request.emit (events.js:182:13)
at Request. (/home/mgruca/DowellLab/node-gitlab-2-github/node_modules/request/request.js:1161:10)
at Request.emit (events.js:182:13)
at IncomingMessage. (/home/mgruca/DowellLab/node-gitlab-2-github/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:28736) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:28736) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Thanks!

Import failed with 500 in Github

Running the migration failed when a 500 error occurred adding a comment to a merge request.

Should 500 errors be retried to avoid having to reset from scratch?

Pull request #78 (source branch 'fix_eggs' does not exist => cannot migrate pull request, creating an issue instead.
        Migrating pull request comments...
could not create GitHub issue comment!
RequestError [HttpError]: request to https://api.github.com/repos/python/importlib_metadata/issues/206/comments failed, reason: getaddrinfo ENOTFOUND api.github.com
    at /Users/jaraco/code/public/node-gitlab-2-github/node_modules/@octokit/request/dist-src/fetch-wrapper.js:88:15
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  status: 500,
  headers: {},
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/python/importlib_metadata/issues/206/comments',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-rest.js/18.0.0 octokit-core.js/3.1.0 Node.js/14.13.1 (macOS Catalina; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"body":"In GitLab by [@asottile](https://gitlab.com/asottile) on Jul 2, 2019, 11:27\\n\\n@jaraco thoughts on how I can improve this PR?"}',
    request: { hook: [Function: bound bound register] }
  }
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node node_modules/ts-node/dist/bin.js ./src/index.ts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jaraco/.npm/_logs/2020-10-22T15_56_58_678Z-debug.log

What should be the projectmap

I am getting the error: " Select which project ID should be transported to github. Edit the settings.js accordingly. (gitlab.projectID) "

My gitlab Project deatils:

19 orgStats -- null

What I need to add in projectmap

My settings.js
"projectmap": {
"orgStats": "test",
//"gitlabgroup/projectname.2": "GitHubOrg/projectname.2"
}

Getting SyntaxError: Unexpected token o in JSON at position 1

Hi Team,
I am getting below error while migrating from Gitlab CE to github enterprise.

undefined:1
[object Object]
^

SyntaxError: Unexpected token o in JSON at position 1
at Object.parse (native)
at /home/aditgaur/puppet-agent-automation.git/node-gitlab-2-github/node_modules/gitlab/lib/ApiBaseHTTP.js:88:42
at _Class.wrap_response (/home/aditgaur/puppet-agent-automation.git/node-gitlab-2-github/node_modules/slumber/lib/API.js:192:18)
at _Class.wrap_response (/home/aditgaur/puppet-agent-automation.git/node-gitlab-2-github/node_modules/slumber/lib/API.js:4:59)
at Request._callback (/home/aditgaur/puppet-agent-automation.git/node-gitlab-2-github/node_modules/slumber/lib/API.js:215:26)
at Request.self.callback (/home/aditgaur/puppet-agent-automation.git/node-gitlab-2-github/node_modules/request/request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/home/aditgaur/puppet-agent-automation.git/node-gitlab-2-github/node_modules/request/request.js:1044:10)
at emitOne (events.js:96:13)

Undefined Error for GitLab

Getting undefined error:

undefined
/home/jamesmundia/dev/node-gitlab-2-github/index.js:20
if(settings.gitlab.url === "http://gitlab.mycompany.com/"){
           ^

TypeError: Cannot read property 'gitlab' of undefined
    at Object.<anonymous> (/home/jamesmundia/dev/node-gitlab-2-github/index.js:20:12)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3

gitlab portion of settings.json file:

  "gitlab": {
    "url": "https://gitlab.com/MYUSERNAME/MYREPONAME",
    "token": "{{TOKEN}}",
    "projectID": ID NUMBER
  },

Tried many variations but can't get past the undefined message

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.