Giter Club home page Giter Club logo

fotingo's People

Contributors

alanpearce avatar dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar lkroner avatar llosimura avatar m-artin-t avatar mack1070101 avatar semantic-release-bot avatar tagoro9 avatar tobyoconnell avatar toolo avatar xerxesdgreat avatar ysun62 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

Watchers

 avatar  avatar  avatar  avatar

fotingo's Issues

Proper error messaging when git push fails.

When remote push is rejected (If your local branch is behind, for example), I'm getting a ssh key error.

DEBUG="fotingo:*" fotingo review ANDROID-774 -b i/oauth 
[1/7] ๐Ÿš€  Initializing services...
  fotingo:github Initializing Github api +0ms
  fotingo:github User token is present. Using current authentication +4ms
  fotingo:git Initializing /Users/carlos/code/marvin repository +440ms
  fotingo:jira Initializing Jira api +3ms
  fotingo:http Performing GET https://team-turo.atlassian.net/rest/api/2/myself?expand=groups  +2ms
[2/7] โฌ†๏ธ  Pushing 'f/android-774_handle_access_token_retrieval_by_client_credentials' to Github...
  fotingo:git Getting authentication from SSH agent +495ms
error ๐Ÿ’ฅ  It looks like you haven't added you ssh key. Remember to `ssh-add -k path_to_private_key` so we can communicate with the remote repository.

Transition infer process is wrong for in review state

If there is a done and in review transitions if will set the first one that it finds without giving preference to the in review status.

This ends up in setting issue to the wrong workflow state (done instead of in review).

Add unit tests

Test should be added ASAP. As new features are added, it will become more difficult to add all the needed tests.

Handle creation of duplicated issues nicely

This is the current output, which could be clearer or clever about it.

[1/4] ๐Ÿš€  Initializing services...
[2/4] ๐Ÿ›  Getting issue from jira...
[3/4] ๐Ÿ”–  Updating issue status...
[4/4] ๐ŸŽ‰  Creating branch to work on issue...
error ๐Ÿ’ฅ  Error: Failed to write reference 'refs/heads/b/dunlop-767_org-hibernate-exception-genericjdbcexception_in_-api-login': a reference with that name already exists.
error ๐Ÿ’ฅ  I DON'T KNOW HOW TO HANDLE THIS ERROR

Start should take multiple issues

There is no problem with the -n option, but if this is not passed, then there should be an option that allows to specify the branch name.

Can't extract branch name when using custom branch template

With a branch template of simply {issue.key}, fotingo review can't extract the branch name.

It seems like the problem is the regex here:

R.match(/\w\/(\w+-\d+)/),

I'm not sure, but I had a thought about how to fix it: transform the keys used inside the template to matching regex fragments, leaving any symbols as they are (as anchors), so {issue.key} would be replaced with (\w+-\d+)

Error: credentials callback returned an invalid cred type

This is my first time using fotingo, so there may be some user error involved. Here are my current steps to reproduce:

  1. Have an in-progress JIRA ticket.
  2. Run fotingo start TICKET_NUMBER.
  3. Witness following output:
dmarr@MacBook-Pro-3 ~/code/schumacher (react-storysource) $ DEBUG=fotingo:* !!
DEBUG=fotingo:* fotingo start SCHU-1436
[1/4] ๐Ÿš€  Initializing services...
  fotingo:github Initializing Github api +0ms
  fotingo:github User token is present. Using current authentication +0ms
  fotingo:git Initializing /Users/dmarr/code/schumacher repository +0ms
  fotingo:jira Initializing Jira api +0ms
  fotingo:http Performing GET https://team-turo.atlassian.net//rest/api/2/myself?expand=groups  +0ms
[2/4] ๐Ÿ›  Getting 'SCHU-1436' from jira...
  fotingo:jira Getting issue from jira +0ms
  fotingo:http Performing GET https://team-turo.atlassian.net//rest/api/2/issue/SCHU-1436?expand=transitions +0ms
[3/4] ๐Ÿ”–  Setting 'SCHU-1436' in progress...
  fotingo:jira Updating issue status to IN_PROGRESS +0ms
  fotingo:http Performing POST https://team-turo.atlassian.net//rest/api/2/issue/SCHU-1436/transitions with body {
  fotingo:http   "transition": {
  fotingo:http     "id": "31"
  fotingo:http   },
  fotingo:http   "fields": {}
  fotingo:http } +0ms
[4/4] ๐ŸŽ‰  Creating branch 'c/schu-1436_on_the_vehicles_page_if_a_host_has_already_listed_a_vehicle__can_we_make'...
  fotingo:git Creating branch for issue +0ms
  fotingo:git Fetching data from remote +0ms
  fotingo:git Getting authentication from SSH agent +0ms
error ๐Ÿ’ฅ  Error: credentials callback returned an invalid cred type

Fotingo release -n parameter is not working

According to the documentation:

โฏ fotingo release -h

  Usage: fotingo-release [options]

  Options:

    -n, --no-branch-issue  Do not pick issue from the branch name
    -i, --issue [issue]    Specify more issues to include in the release (default: )
    -h, --help             output usage information

it seems that -n and --no-branch-issue are equivalent. However, if I execute

โฏ fotingo release -n -issue_1 release_1
[1/5] ๐Ÿš€  Initializing services...
error ๐Ÿ’ฅ  You haven't made any changes to this branch

Using --no-branch-issue seem to be working correctly

Installing via new yarn blocked by engines spec

> yarn global add fotingo
yarn global v0.23.2
warning No license field
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
error [email protected]: The engine "yarn" is incompatible with this module. Expected version "^0.19.1".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

It can be worked around, though:

yarn global add --ignore-engines fotingo

Store default labels for PRs

It happens that in most PRs for a project there may be a set of labels that are applied to most of the, so let's save some time and store them in the config files.

fotingo review fails with `not found` error

I don't know how reproducible this is:

  1. I successfully checked out code via fotingo start DUNLOP-4560
  2. I committed new code
  3. I typed fotingo review
  4. I saw the following error
[1/7] ๐Ÿš€  Initializing services...
  fotingo:github Initializing Github api +0ms
  fotingo:github User token is present. Using current authentication +0ms
  fotingo:git Initializing /Users/kiwi/dkr/dkr-httpd-dunlop repository +0ms
  fotingo:jira Initializing Jira api +0ms
  fotingo:http Performing GET https://****.atlassian.net/rest/api/2/myself?expand=groups  +0ms
[2/7] โฌ†๏ธ  Pushing 'c/dunlop-4560_update_apache_image_to_use_new_paths_for_static_content' to Github...
  fotingo:git Getting authentication from SSH agent +0ms
[3/7] ๐Ÿ”Ž  Extracting issue from branch...
  fotingo:git Extracting issue from current branch +0ms
[4/7] ๐Ÿ›  Getting 'DUNLOP-4560' from jira...
  fotingo:jira Getting issue from jira +0ms
  fotingo:http Performing GET https://****.atlassian.net/rest/api/2/issue/DUNLOP-4560?expand=transitions  +0ms
[5/7] ๐Ÿ“š  Getting your commit history...
  fotingo:git Getting branch commit history +0ms
[6/7] ๐Ÿ”ˆ  Creating pull request...
  fotingo:git Created history walker. Latest common commit: 68a17f****1039056 +0ms
error ๐Ÿ’ฅ  {"message":"Not Found","documentation_url":"https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository"}

I ran an update and tried again with the same result:

npm -g update fotingo
/Users/kiwi/.nvm/versions/node/v8.3.0/bin/fotingo -> /Users/kiwi/.nvm/versions/node/v8.3.0/lib/node_modules/fotingo/lib/fotingo.js
+ [email protected]

Add option to add review requests to a PR

The api should be something like:

fotingo review -a tagoro9 -a <github username>

or

fotingo review -a 'tagoro9,<githubusername>'

Either way, it should somehow check that these are valid github users and that have access to the repo. Probably the api will do this for us, so the only need is to differentiate among the returned error codes to show the proper message.

The relevant APIs are here.

Hardcoded branch name in getBranchInfo

When getting the commit information and doing a merge base, origin/master is hardcoded. Which means that if someone has a different remote or base branch, then the commit information will be wrong.

Add option to label the created PRs

The api should be something like:

fotingo review -l 'feature request' -l 'semver minor'

Probably if there is a typo in the label, a new label will be created and that is not desired. It should get the labels for the repo and verify that they exist before submitting the change.

Relevant api is here. I thought that PRs needed to be linked to an issue but I was wrong, a PR is a superset of an issue, so all the APIs are compatible.

Add a command to update base branch

It could be useful to have a quick way to change the base branch, for example, when you're working with integration branches and want to branch off them.

  • It could be a parameter in the existing commands (fotingo start ISSUE-X -b "branch-name")
  • A config command could be added to easily modify the .fotingo config file (fotingo config -b "branch-name")

Better error handling when adding a reviewer with no permissions

Right now the error message is this one:

{"message":"Reviews may only be requested from collaborators. One or more of the users you specified is not a collaborator of the tagoro9/fotingo repository.","documentation_url":"https://developer.github.com/v3/schema/pull-request-review-request"}

Branch name created as with "undefined/" prefix

I wanted to start an issue of type Improvement. This created a branch name like "undefined/XXXX-1234โ€ฆ"

Looking at git/util.js, it seems as though the ISSUE_TYPES mapping doesn't handle this and doesn't have a fallback.

I see a few ways to solve this:

  • Add a fallback (perhaps a dynamic one, to the first character of the issue type, lowercased)
  • Move ISSUE_TYPES into user configuration
  • A hybrid of the two above:
    1. Query JIRA issue types
    2. Take the properties from the current ISSUE_TYPES that match those from JIRA
    3. For the rest, create a mapping to the first character, lowercased (or some other logic)
    4. Save to configuration
  • Allow the branch name format to be configured, such that the issue type prefix could be removed. This seems like a bit more work though.

I can work on this myself if that's helpful (I'm familiar with Ramda), I would just like to know which approach is preferred.

Remove secrets from configuration

It's generally accepted that keeping secrets on disk in unencrypted files is a _Bad Idea_โ„ข. Having secrets inside the fotingo configuration keeps me from publishing it alongside my other dotfiles.

There are probably multiple ways to approach the issue. What I think would make sense is the ability to specify a program to fetch the JIRA password/github API key. A user could then use e.g. pass ,
command-line access to the system keychain (e.g. for macOS) or any other tool that outputs the password to stdout.

Another option would be to read from environment variable, like the AWS command-line tools.

Either way, fotingo wouldn't have to deal with any cryptographic operations

There are probably other approaches, but these ones consistent with what I've seen in other command-line tools.

I looked at the code, and it seems like it would be easier to use environment variables, or read the secrets via command once and keep them in memory. However, It would be more secure to use the command approach and call the command each time, but that would require some changes in http-client. I would think that auth.password would therefore have to be a function, which would either be R.always(pass) for a string password, or a function that calls the specified command (child_process.execSync). The configuration format would then need some way of indicating whether the password is a string or command. Perhaps the command could be specified as an object, then the decision to use string/command processing would be based on the type?

I think I could probably work on this.

Improve jira login error messaging

I had my credentials changed on Jira but not on Fotingo. When performing a fotingo start, it to provide a login and password as if it was a first-time installation. It would be nice to have a message saying that the stored credentials are no longer valid.

Improve transitions setup

It should infer the different transition ids given the transition names. Fallback to the question (better phrased) if it is unable to find all the ids.

Improve error handling when performin a release

When I perform a release with no release name the command goes through without any warning until it fails.

So, if I do:

fotingo release

I got:

screen shot 2017-12-20 at 9 53 17 am

The real issue comes when there are multiple related issues -i and no release name

Example

screen shot 2017-12-20 at 9 43 22 am

IMO this problem can be solved just by enforcing a release name to exist. Any thoughts on it?
P.S: I โค๏ธ fotingo

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.