GithubHelp home page GithubHelp logo

brunodbo / gitlab-issue-creator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cjpthatsme/gitlab-issue-creator

0.0 2.0 0.0 14 KB

A small node command line application for creating issues on GitLab from a CSV file.

JavaScript 100.00%

gitlab-issue-creator's Introduction

Gitlab Issue Creator

NOTE

If you are seeing failures, use the -r command to retry the failed lines. For more info look at the "Use" section below.


TLDR

A small node command line application for creating issues on GitLab from a CSV file.

To process a CSV

node issues.js -c "data.csv"

Long winded documentation

Why?

I recently needed a faster way to create issues on Gitlab. Doing them one by one when you have over a hundered to create is painful to say the least. I found a node package that communicates with the API and built this small program on it.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

You are going to need Node/NPM installed. The easiest way to do so is to download the installer. Get NodeJS

To confirm the install use these commands:

node -v

and

npm -v

If they both print a version number you are good to go.

Installing

Once Node is installed, get a copy of the of this repo. You can clone it or download it. Once you have a local copy, enter it's containing directory and install the required packages using NPM's install command

npm install

This will get you all ready to go!

Configuration

Now that you are all installed lets configure the issues.js file to use your project. You will need a couple of things from your Gitlab account.

Getting Your Gitlab Private Token

Create a Personal Access Token in the "User Settings/Access Tokens" menu on Gitlab and set the scope to API.

Getting Your Gitlab Project ID

This can be found at "Project Settings/General" and Expand the "General Project Settings" section. You Must be either an Owner or Master to get the ID

Getting Your Gitlab User IDs

When creating the CSV, it is easier to use nicknames for the assignees. To accomodate this, I define an object with the nicknames and their associated user IDs. To get the your user IDs, log in to gitlab and use the following URL replacing "YOUR_USER_NAME" with the the username of the person you need an ID for https://gitlab.com/api/v4/users?username=YOUR_USER_NAME

Use

The issue creator comes with three built in commands sh -n , sh -c , and sh -r . Lets look at these individually.

-n

This command is used to create a single issue.

node issues.js -n [title] [description] [assignee] [milestone] [labels(comma separated)]

Here is an example for one of my issues

node issues.js -n Zombies "Create the zombies with 5 variations" Chris Alpha Graphics,Assets

-c

This command is used to create a bunch issues from a CSV file.

node issues.js -c [file]

There is an example CSV in the CSV folder to help keep the CSV in the required format. Simply edit it and run

node issues.js -c csv/data.csv

-r

This command will retry any failures from the CSV import.

node issues.js -r

As the CSV import command runs, there seems to always be failures. I am not 100% sure why but I added this command to help with that. As the importer runs, any failures are put into a new csv called retry.csv. All this command does it load that file and run it back trhough. I have had to run this command 3 times on really big lists. This could be easily automated so it automatically loads the file but I decided that since that would require more validation the csv to be sure that the errors were not caused there, I would just make it a separate command for now.

Note on Newlines: Carriage returns and linefeeds cannot be processed by the a-csv library. To work around this, you can substitute newlines for 0x0A in the description field. 0x0A will be replaced with newlines in your issue description.

Built With


Thanks for checking it out!

gitlab-issue-creator's People

Contributors

cjpthatsme avatar vid-n3t avatar

Watchers

 avatar  avatar

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.