Code Monkey home page Code Monkey logo

gh-issue-mover's Introduction

npm

๐Ÿšš gh issue mover

A friendly CLI tool to migrate issues across GitHub and GitHub Enteprise repos.

Features

  • migrate issues one by one or in bulk using labels
  • include comments, labels and assignees in the migration
  • include references to the original issue and author
  • close the original issue with a link to a new one
  • works with both (and across) GitHub and GitHub Enterprise

Example

original issue migrated issue
image image

Usage

Install from npm:

npm install -g gh-issue-mover

Then create configuration file (e.g. config.json) that contains two keys fromRepo and toRepo:

{
  "fromRepo": {
    "owner": "buildo",
    "name": "aliniq",
    "token": "1231231231231231231231231231231231231213212312",
    "rootURL": "https://github-enterprise.example.com/api/v3"
  },
  "toRepo": {
    "owner": "buildo",
    "name": "ams",
    "token": "1231231231231231231231231231231231231213212312",
    "rootURL": "https://github-enterprise.example.com/api/v3"
  }
}

owner and name indentify the repos you want to migrate the issue to/from.

token must be a github token with read permissions on the fromRepo and write permissions on toRepo.

rootURL is the GitHub API endpoint (only required for GitHub Enterprise repos)

Once you have a valid config.json, run

gh-issue-mover --config=config.json

and follow the interactive prompt.

gh-issue-mover's People

Contributors

data-intelligence-robot avatar gabro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gh-issue-mover's Issues

UnhandledPromiseRejectionWarning when migrating by label

While migrate by label an UnhandledPromiseRejectionWarning occured. The migration was still successful despite the error.

Error

๐Ÿ––  Greetings, hooman!

๐Ÿšš  Ready to migrate issues from microsoft/terraform-provider-azuredevops to terraform-providers/terraform-provider-azuredevops?

? How do you want to migrate the issues? by label
? Cool, which labels? (separate multiple labels with commas. They will go in AND) new feature, question
Sorry, no issues found matching labels new feature,question
? Do you want to try again? Yes
? How do you want to migrate the issues? by label
? Cool, which labels? (separate multiple labels with commas. They will go in AND) "new feature"
Sorry, no issues found matching labels "new feature"
? Do you want to try again? Yes
? How do you want to migrate the issues? by label
? Cool, which labels? (separate multiple labels with commas. They will go in AND) question
? You're about to migrate 2 issues matching the labels question . Are you sure? Yes
(node:50752) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
    at Function.all (<anonymous>)
    at _callee3$ (/usr/lib/node_modules/gh-issue-mover/lib/index.js:176:28)
    at tryCatch (/usr/lib/node_modules/gh-issue-mover/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/usr/lib/node_modules/gh-issue-mover/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/usr/lib/node_modules/gh-issue-mover/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/usr/lib/node_modules/gh-issue-mover/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /usr/lib/node_modules/gh-issue-mover/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
(node:50752) 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: 2)
(node:50752) [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.

 ๐Ÿญ  Successfully migrated issue from microsoft/terraform-provider-azuredevops#378 to terraform-providers/terraform-provider-azuredevops#28 


 ๐Ÿญ  Successfully migrated issue from microsoft/terraform-provider-azuredevops#379 to terraform-providers/terraform-provider-azuredevops#27 

Error trying to assign a non-collaborator to issue

Only people who have commented on the issue or are a collaborator can be assigned to a github issue. Right now it fails to assign them, but maybe instead it can add a comment mentioning the person who can't be assigned.

Error:

๐Ÿ˜ฑ Something went wrong while migrating issue #153!
{
  "status": 422,
  "json": {
    "message": "Validation Failed",
    "errors": [
      {
        "value": "tmeckel",
        "resource": "Issue",
        "field": "assignees",
        "code": "invalid"
      }
    ],
    "documentation_url": "https://developer.github.com/v3/issues/#create-an-issue"
  }
}

npm version is missing lib/ folder

I just took this lovely tool for a spin, but found that the version published to npm does not contain the lib/ folder, and so doesn't work.

I was able to get it working locally after building it from a clone.

I think this will be relatively simple to fix with a prepublish script.

If there's traction for it, then I am happy to try creating a PR to fix it.

Unhandled rejection after choosing to open new issue in browser

Migrated an issue from sinonjs/sinon to sinonjs/nise. Received the following output, and an unhandled rejection.

Despite this message the issue was migrated, although I noticed that the ordering of the migrated comments was off (not a big deal as mostly they were irrelevant to the migrated issue so I deleted most of them).

Original Issue: sinonjs/sinon#607
Migrated Issue: sinonjs/nise#33

? You're about to migrate issue #607 from sinonjs/sinon to sinonjs/nise . Are you sure? Yes
๐Ÿ˜ฑ Something went wrong while migrating issue #607!
{
  "status": 403,
  "json": {
    "message": "Must have admin rights to Repository.",
    "documentation_url": "https://developer.github.com/v3/issues/#edit-an-issue"
  }
}
? Open new issue in browser now? Yes
(node:31573) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'htmlUrl' of undefined
(node:31573) [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.

Environment:
OS: Ubuntu 16.04 LTS
NodeJS: v8.9.4
NPM: v5.6.0

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.