Code Monkey home page Code Monkey logo

ttb's Introduction

ttb

A CLI tool to create a new branch from a ticket number in your project management tool.

Requirements

  • Node v13.x or higher
  • An Personal API token

Usage

Installation

npm i -g ttb

Setup

ttb init
ttb add

Branching

Go to your project directory and run

ttb branch <ticket-number>

Commands

  • init - create a config file in your user directory.
  • add - add a new credential. (Will be set to active if no other credentials exist)
  • remove - remove a credential.
  • use - set a credential to active. (This will be the credential used for the branch command)
  • branch <ticket-number> - create a new branch.

Current Support

  • Github

Future

Jira support is soon in progress. The goal is to be able to create a branch from a ticket number. The branch name will be the ticket number and the title of the ticket. The ticket number will be prepended with the ticket type. For example, feature/ttb-1234-this-is-the-title-of-the-ticket.

Development

  1. pnpm i
  2. pnpm run build
  3. pnpm run start <command>

Notes

  • note that options are not working properly when running pnpm run start

Sponsors

Osynlig AB

ttb's People

Contributors

rizken avatar bjornet avatar

Stargazers

Nils Alm avatar

Watchers

 avatar  avatar

ttb's Issues

Link repo to npm

Repo should be linked on the ttb npm page.

Acceptance criteria

  • it should have repository specified in package.json
  • it should have homepage specified in package.json

Type option not working

  • options for branch command is not implemented even tho it was specified in the command
  • issues with labels crashes the program

Suggestion: --code flag redundant

The --code flag is redundant and should be removed.

Current
jirabranchcreator --code=ST-108 --type=epic

Wanted
jirabranchcreator ST-108 --type=epic

List command

As a user, I want to be able to view my credentials, so that I easily can get an overview over my added credentials.

Acceptance Criteria

  • it should add a command named "list"
  • it should list all credentials when running ttb list in the terminal

Install and configure linter and formatter

As a developer, I want strict linting and formatting to lean on so that the code is consistent and I do not need to care for the details of it when developing.

Acceptance Criteria

  • it should install eslint
  • it should install prettier
  • it should configure eslint
  • it should configure prettier

Notes

  • remember that meanwhile we wanna apply what we see as best practices, we also should understand what is actually best practices in the CLI/node env.

Make 'ttb branch' actually create and checkout a new branch instead of giving you the command

As a user I want TTB to create and checkout a new branch with one command so that I can spend more time on coding.

Acceptance criteria

  • it should have appropriate error handling.
  • it should make "ttb branch " create and checkout a new branch with a proper name that the ticket id provides.

Implementation suggestions

  • make use of GitHubs "create a branch" to link the new branch with the ticket that was used to create the branch.

Rewrite JBC into Ticket to Branch

Epic Story

As a developer, I want a modern tool that can get tickets from a multitude of sources and create branches for them.

Acceptance Criteria

  • it should be able to get tickets from Jira
  • it should be able to get tickets from Github
  • it should be written in Typescript
  • it should be able to scale to get tickets from any modern ticketing system

Notes

Links to interesting tools for CLI development

https://github.com/tj/commander.js
https://github.com/SBoudrias/Inquirer.js/
https://github.com/chalk/chalk
https://github.com/helloIAmPau/node-spinner
https://github.com/patorjk/figlet.js

User Stories

Support for multiple API clients

As a developer, I want TTB to be able to scale to consume different API:s so that I can use it for different ticketing systems.

Acceptance Criteria

  • it should add support for multiple API clients
  • it should support Github API over Graphql
  • it should support JIRA API over REST

Notes

Epics

Change default branch to dev

As a developer I want the default branch to be dev so that PRs automatically has dev branch as base.

Acceptance criteria

  • it should make dev branch the default branch of the repository
  • it should make it impossible to create a PR into main from any other branch than dev

Notes

Main branch is the production branch

Make public

Epic Story

As a developer, I want to be able to install ttb as a npm package, so that I can use ttb in a consistent way

Acceptance Criteria

  • it should have a readme that is true and helpful
  • it should rename the repository to "ttb"
  • it should not have legacy code in the repo

User Stories

Add support for changing prefix

As a user I want to be able to add other prefixes than feature so that I can use this for more use cases

Acceptance criteria

  • it should enable provision for a prefix argument
  • it should be able to create a hotfix branch
  • it should be able to create a bugfix branch
  • it should be able to create release branch
  • it should be able to create a custom prefix

Readme

Update readme

  • JIRA token should not be mentioned as of now
  • Clarify what it is expected to do:
    1. ESSENTIAL: create a local branch from a ticket number from github
    1. if possible: link branch to issue in github

Update dependencies

Acceptance criteria

  • it should update all dependencies

Notes

Eslint shouldn't be updated to latest because of major braking changes. This should be done in a separate ticket.

Make sure TTB can complete the ESSENTIAL step of creating a local branch

As a user, when a "nice to have" feature goes wrong, I want the program tell me what went wrong but still do the essential steps.

Acceptance criteria

  • it should check if a branch already exists
  • it should tell the user if it failed to create a linked branch
  • it should checkout a local branch:
    • if branch already exists
    • or it failed to create a linked branch

Notes

Message from Fille > "Jag skapade en Classic Personal Access Token och körde i alla permissions för att testa, men får följande fel:"

Manage credentials

As a developer, I want a credential manager that is easy to use so that I can easily swap between different projects.

Acceptance Criteria

Implementation suggestion

// ~/.ttb/credentials.json

{
  "visitorToolbox": {
    "host": "visitortoolbox.atlassian.net",
    "email": "[email protected]",
  },
  "guestrix": {
    "host": "visitortoolbox.atlassian.net",
    "email": "[email protected]",
    "apiToken": "XhOewfehV7bSdEpqdAuP709D"
  }
}

// ## Improved UX
// a. `ttb <issue>`
// b. (if not authorized) show list of your credentials and select the correct one

Init Ticket to Branch rewrite

As a Viktor, I want this repo to be super crisp so that I can contribute to it.

Acceptance Criteria

  • it should be written in TS since Im a hipster dipster

Notes

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.