Giter Site home page Giter Site logo

story-branch / story_branch Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 7.0 376 KB

Quickly create a feature branch based on the tickets/stories assigned to you in any of the supported trackers - PivotalTracker, JIRA, Github or LinearApp

License: MIT License

Ruby 99.82% Shell 0.18%
ruby pivotal-tracker github-issues terminal productivity-tools jira cli linear-app

story_branch's People

Contributors

akolomiychuk avatar dependabot[bot] avatar jasonm23 avatar linc01n avatar rpbaltazar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

story_branch's Issues

Add ability to cancel story selection without interrupting

Picking up idea from one of the forks, since it seems he abandoned it, but i still think it makes sense.

Not sure if once fully migrated to TTY it will still be valid, but its a good point:

   def list_pivotal_stories api_key, project_id
     PivotalTracker::Client.token = api_key
      project = PivotalTracker::Project.find(project_id.to_i)
      stories = project.stories.all({current_state: :started})
      stories.each_with_index{|s,i| puts "[#{i+1}] ##{s.id} : #{s.name}"}
      puts '[0] Exit'
      stories
    end
  
    def select_story stories
      story_selection = nil
      while story_selection == nil or story_selection > stories.length + 1
        puts "invalid selection" if story_selection != nil
        story_selection = readline("Select a story: ", Range.new(1,stories.length).to_a.map(&:to_s)).to_i
      end
      if story_selection == 0
        puts 'Exiting...'
        exit
      end
      story = stories[story_selection - 1]
      puts "Selected : ##{story.id} : #{story.name}"
      return story
   end

Only the first config file is being considered

A possible configuration setup on a machine would be a global config file with the api key while different projects have different project ids configured in its story_branch file.

Current version ignores the global file when the local (project config) is found.

Suggesting to load the config from either one or other and fallback to env variables.

Story branch asks for choosing project unnecessarily

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

when .story_branch.yml has an array of project ids but only one project id is present it shouldn't ask which project to use.

What did you expect to happen?

What happened instead?

Paste in any error messages using code-fences

Additional information

story_branch finish is broken

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

$allow-users-to-add-a-non-existing-club-to-the-database-when-registering-161674820: story_branch finish                                                                                                                                                                   
No tracked feature associated with this branch

What did you expect to happen?

Ask for the commit message

What happened instead?

No tracked feature associated with this branch

Paste in any error messages using code-fences

Additional information

Support GitHub issues

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

Allow to configure Story Branch to support similar workflow for GitHub projects.

What did you expect to happen?

Since GitHub projects does not follow the exact same workflow as pivotal tracker and in fact is more flexible in terms of states this should be thought a bit further. Maybe it should have as part of the configuration a set of actions. Solving this problem would get story branch closer to be usable in trello as well.

I'm thinking of something along the lines (assuming it follows the kanban template)

  • story_branch start -> assign the task to you. move it to in progress
  • story_branch create -> create the branch
  • story_branch finish -> open PR with last commit being the Finishes/Resolves...

What happened instead?

Additional information

Probably the actions should be configurable as different people might have different workflows, but I'd start with the simplest case.

git finish not working properly

[~/workspace/project]
git finish
Connecting with Pivotal Tracker
Your current branch: 'show-entire-maintenance-history-when-selecting-a-specific-equipment-unit-74195972' is not linked to a Pivotal Tracker story.

When a branch for a story id exists, instead of aborting, ask if you want to reopen

Describe the steps to reproduce

story_branch create
choose a reopened story

What did you expect to happen?

story branch should ask if we want create a new branch or checkout the existing one

What happened instead?

It aborts the process

Additional information

Possibly we should have a check for multiple reopen concept.
e.g.

1st time
story-name-storyid

2nd time
reopen-story-name-storyid

3rd time
reopen-1-story-name-storyid
...

Add basic support for JIRA

JIRA is one of the mostly used trackers in the market nowadays. Its integration is not as straightforward as Github or Pivotal tracker, particularly around the issue search. An initial form for integration would be useful specially if it supports fetching the existing issues assigned to me and create the branch based on that.

Further refinement in integration of different workflows would be a nice to have.

Assign me to owners of the gem in rubygems

Currently @jasonm23, you are the sole owner of Story Branch in ruby gems.

Can you please add me to the list of owners?

I've been working on this and there are a couple more features I'd like to release in the near future.

Similar branch name error is too opinionated

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

For a story that has the only difference as BE and FE, but the feature is the same the branch name is too similar and there is no way around it.

$story_branch create
Choose the feature you want to start: 166948539 - FE: User can create a new vendor
166948539 started
You are checked out at:   user-can-see-a-list-of-existing-vendors-166948513
Provide a new branch name fe-user-can-create-a-new-vendor
This name is very similar to an existing branch. Avoid confusion and use a more unique name.

What did you expect to happen?

Allow the user to:
a) abort the branch creation
b) accept the branch with very similar name
c) give the user the opportunity to update the name

What happened instead?

The process just exits with the error message and forces the user to start again, which is annoying.

Additional information

Branch name sanitisation should also exclude back ticks (`)

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

  • Create a branch using story branch where the title includes back ticks

What did you expect to happen?

  • The branch name should not include them

What happened instead?

  • The branch name had them...

Paste in any error messages using code-fences

Additional information

expected: majority-of-jasmine-1-specs-in-opl-lib-has-unmatched-file-paths-to-spec-names-and-thus-not-running-164361284

actual: majority-of-jasmine-1-specs-in-opl-lib-has-unmatched-file-paths-to-spec-names-and-thus-not-running-164361284

Migrate to Gitlab

Since Microsoft is acquiring Github it may be worth seriously considering moving to another platform.

Gitlab is pretty damn good.

@rpbaltazar what do you think?

Update Circle Ci config to push with a team key

This is more of an internal issue and less of a public problem but still should be tracked.
We would like to be able to push to ruby gems using a team key rather than a specific member, if possible.

Look at the rubygems key management and see if such thing is possible.

Currently CI has my key set

Alter release tag format to be consistent with gem VERSION value

To simplify automation of the release process we could change the tag format to:

^[0-9]+\.[0-9]+\.[0-9]+$

instead of the current style.

^v[0-9]+\.[0-9]+\.[0-9]+$

@rpbaltazar - add your approval and let's ensure the format is used going forward.

We can later add a chore where Circle does it's own tagging based on discovery of a new VERSION

Fuzzy matching

To define more clearly;

My interpretation of fuzzy matching would find matches for words in the search string in any order on the story names. eg.

search text: table change report[TAB]

match names containing: change report table, table report change, report change table etc. 
(as a substring contained in the full story name)

As a second level of fuzziness, find "similar" strings using Levenshtein distance, eg:

search text: tble[TAB]

match a name containing: table (or similar)

This second level of fuzziness may be moved out to another issue, and implemented later.

As a third level, ignore any punctuation in the match strings (and search string?) I haven't thought about this much but as an eg:

search text:  this blue egg

would match a name containing:  this/blue::egg

Cannot install story-branch on Windows

I'm trying to install this on Windows with a fresh Ruby installation (especially installed to use this) but installation fails with the following error:

>gem install story_branch
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing story_branch:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/levenshtein-ffi-1.1.0/ext/levenshtein
C:/Ruby25-x64/bin/ruby.exe -r ./siteconf20190614-20824-mavm9z.rb extconf.rb
creating Makefile

current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/levenshtein-ffi-1.1.0/ext/levenshtein
make "DESTDIR=" clean

current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/levenshtein-ffi-1.1.0/ext/levenshtein
make "DESTDIR="
generating levenshtein-x64-mingw32.def
compiling levenshtein.c
linking shared-object levenshtein.so
C:/Ruby25-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Cannot export Init_levenshtein: symbol not defined
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:259: levenshtein.so] Error 1

make failed, exit code 2

I've tried searching for the error but can't find any useful information. Any pointers to what I might do to get this working?

In the README of levenshtein I read:

This function can be used as a drop-in replacement for
Text::Levenshtein.levenshtein, which is pure Ruby and rather slow. That's it!

Not sure how important the perf. is in the program, but it might be possible to use the pure Ruby impl. if it doesn't matter so it's not dependent on the native lib?

Circle CI broken.

CircleCI was failing because it now reads the config.yml in order and must see workflows first. (Or there must be a job called build)

Running a new build now

Support order for branch name

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

story_branch create always puts the issue id in the end of the branch name. Would be nice if this was configurable as well.

What did you expect to happen?

Similarly to the finish tag option, we should allow the user to configure the issue id to be added to beginning of end of branch name.

What happened instead?

Paste in any error messages using code-fences

Additional information

Story names with \n

When story name contain line break inside and I'm trying to select this story with arrow keys I getting error
/gems/rb-readline-0.5.1/lib/rbreadline.rb:2788:in '[]': no implicit conversion from nil to integer (TypeError)

Finish tag preferred word should allow to be unset

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

story_branch finish forces us to have a finish tag set, so it follows the format: [Resolves #9999999] something something something

What did you expect to happen?

Would be nice if we could have a no finish tag, e.g [#9999999] something something something

What happened instead?

Paste in any error messages using code-fences

Additional information

Ability to create branch for started story

Use case:

I look over backlog in PivotalTracker
I find the story on which I want to work and click start on it
Then I want to create a branch for it, but I cannot

Would be quite convenient to be able to create a branch using a gem (at least for me ๐Ÿ˜„ ).

We can show started stories as

[1] #77758680 [started] : ability to create branch for started story

or we can introduce a argument for story_branch command to show started stories.

What do you think @jasonm23 ?

Cache git branches to speed up the process of creation of a branch

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

run git-story

What did you expect to happen?

faster branch creation

What happened instead?

Paste in any error messages using code-fences

Additional information

The branch gets created but it takes quite some time. we should be caching the branches in order to speed up the flow.

Commit style for auto-scraping notes for Changelog

To avoid the Changelog going stale, I'd suggest adoption of a conventional mark in a commit message to indicate that it's to be included in the Changelog.

CHANGELOG
- Note for changelog
- And some more
- Any markdown bullet list...
- Finish it off with the scissors
--- 8< ---

We can quickly scrape these out of logs using a sed script (IIRC sed '/CHANGELOG/,/--- 8< ---/' would fetch everything in between the marks.

Scissors might be considered a pain to remember, but it doesn't matter what we use, as long as we can establish a convention. - - - the 3 dash markdown horizontal rule might be a useful alternative.

RFC.

story_branch start is displaying unestimated features

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

$ story_branch start

What did you expect to happen?

Only estimated features, bugs and chores should be possible to start.

What happened instead?

All existing stories in the backlog are being displayed and selectable. Starting an un-estimated story makes the api crash

Paste in any error messages using code-fences

Additional information

Keep track of a Change log

It would be useful to have a change log up to date.

If possible, update based on the past versions as well

story_branch finish is broken

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

story_branch finish

What did you expect to happen?

Commit with the usual [Finishes] message

What happened instead?

command crashed

Paste in any error messages using code-fences

story_branch finish
Connecting with Pivotal Tracker
Use standard finishing commit message: [y/N]?
/Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/story_branch-0.3.0/lib/story_branch/string_utils.rb:20:in `tr': no implicit conversion of Regexp into String (TypeError)
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/story_branch-0.3.0/lib/story_branch/string_utils.rb:20:in `undashed'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/story_branch-0.3.0/lib/story_branch/main.rb:64:in `story_finish'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/story_branch-0.3.0/lib/story_branch/commands/finish.rb:16:in `execute'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/story_branch-0.3.0/lib/story_branch/cli.rb:53:in `finish'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/gems/story_branch-0.3.0/exe/story_branch:14:in `<top (required)>'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/bin/story_branch:23:in `load'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/bin/story_branch:23:in `<main>'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/bin/ruby_executable_hooks:15:in `eval'
	from /Users/rpbaltazar/.rvm/gems/ruby-2.4.2@airdrilling/bin/ruby_executable_hooks:15:in `<main>'

Additional information

When setting up a new machine, it might duplicate the project configuration

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

Checkout a project that is already using story_branch. So a .story_branch.yml file already exists.
We are working on a machine in which we haven't yet configured story_branch for this project, so we run story_branch add.
This asks us for the account api token and project api.
Because the project id already exists in the .story_branch.yml, story branch migrates it into an array and duplicates the value.

What did you expect to happen?

Story branch should check if the project id is already in the .story_branch.yml and if yes, skip the adding part.

What happened instead?

Paste in any error messages using code-fences

Additional information

Support multiple project configurations

I'm currently working with two different accounts in Pivotal Tracker therefore there is no nice way of dealing with this since the api key will be different and i don't want to submit my api key to the project repo.

This would also open the possibility of supporting other trackers.

/story_branch.rb:194:in `story_finish': undefined method `StringUtils' for "pagination-on-maintentanance-parts-used":String (NoMethodError)

[% neo@argentum|06:27PM Sun 31/Aug (+0800)][(pagination-on-maintentanance-parts-used-77776734*)(ruby-2.1.1@airdrilling)]
[~/workspace/OpsManager]
git finish
Connecting with Pivotal Tracker
Use standard finishing commit message: [y/N]?
/Users/neo/.rvm/gems/ruby-2.1.1@airdrilling/gems/story_branch-0.2.4/lib/story_branch.rb:194:in `story_finish': undefined method `StringUtils' for "pagination-on-maintentanance-parts-used":String (NoMethodError)
    from /Users/neo/.rvm/gems/ruby-2.1.1@airdrilling/gems/story_branch-0.2.4/bin/git-finish:4:in `<top (required)>'
    from /Users/neo/.rvm/gems/ruby-2.1.1@airdrilling/bin/git-finish:23:in `load'
    from /Users/neo/.rvm/gems/ruby-2.1.1@airdrilling/bin/git-finish:23:in `<main>'
    from /Users/neo/.rvm/gems/ruby-2.1.1@airdrilling/bin/ruby_executable_hooks:15:in `eval'
    from /Users/neo/.rvm/gems/ruby-2.1.1@airdrilling/bin/ruby_executable_hooks:15:in `<main>'

Allow the user to define the preferred word for git finish

Currently git finish uses Finishes as the default word. It's not always the case in everyones workflow.
I'd propose that setting the preferred expression is allowed in .story_branch file.
e.g

api: 123892138021
project: 123312
finish_tag: Resolves

Git finish is broken

Connecting with Pivotal Tracker
Use standard finishing commit message: [y/N]?
/Users/neo/.rvm/gems/ruby-2.2.1@airdrilling/gems/story_branch-0.2.6/lib/story_branch.rb:245:in `undashed': undefined method `underscore' for "inventory-audits-validation-errors-cause-undefined-alert":String (NoMethodError)
    from /Users/neo/.rvm/gems/ruby-2.2.1@airdrilling/gems/story_branch-0.2.6/lib/story_branch.rb:189:in `story_finish'
    from /Users/neo/.rvm/gems/ruby-2.2.1@airdrilling/gems/story_branch-0.2.6/bin/git-finish:4:in `<top (required)>'
    from /Users/neo/.rvm/gems/ruby-2.2.1@airdrilling/bin/git-finish:23:in `load'
    from /Users/neo/.rvm/gems/ruby-2.2.1@airdrilling/bin/git-finish:23:in `<main>'
    from /Users/neo/.rvm/gems/ruby-2.2.1@airdrilling/bin/ruby_executable_hooks:15:in `eval'
    from /Users/neo/.rvm/gems/ruby-2.2.1@airdrilling/bin/ruby_executable_hooks:15:in `<main>'

Support JIRA workflows

Once JIRA implementation is taken care of, allowing us to immediately progress in the JIRA workflow without needing to log in the platform might be quite useful. For JIRA, might make sense to have a "progress in workflow" method that would display the current state of the chosen ticket and the possible next states to choose one from.
this feature of progressing in the flow should definitely be possible to disable in case the user does not want to change the state via the terminal

Support multiple projects in the same repository

Before submitting an issue, please be sure to update to the latest Gem version

Describe the steps to reproduce

Some users have two separate trackers but the codebase all in one repo.
E.g.
Backend and Frontend have different projects in Pivotal Tracker but the code is all under one repository.

What did you expect to happen?

Story Branch should be able to support multiple tracker project ids in one folder.

What happened instead?

Additional information

If there is no config file it crashes

If the file exists and does not have the key everything works fine, but if one of the files does not exist and it tries to read it, an exception will be thrown.

Need to handle file not found exception properly

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.