GithubHelp home page GithubHelp logo

spyder-ide / loghub Goto Github PK

View Code? Open in Web Editor NEW
41.0 41.0 11.0 260 KB

Changelog generator based on github milestones or tags.

License: MIT License

Python 100.00%
changelog generator github github-api productivity python zenhub zenhub-api

loghub's People

Contributors

ccordoba12 avatar djhoese avatar dopplershift avatar fpliger avatar goanpeca avatar xlotlu 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loghub's Issues

Bug: No issues found for -ilg group creates error

When -ilg returns nothing then this error is thrown:

Traceback (most recent call last):
  File "/Users/jdetlefs/miniconda3/envs/anaconda-platform/bin/loghub", line 11, in <module>
    sys.exit(main())
  File "/Users/jdetlefs/miniconda3/envs/anaconda-platform/lib/python3.5/site-packages/loghub/cli/main.py", line 29, in main
    parse_arguments(skip=False)
  File "/Users/jdetlefs/miniconda3/envs/anaconda-platform/lib/python3.5/site-packages/loghub/cli/main.py", line 187, in parse_arguments
    show_prs=options.show_prs)
  File "/Users/jdetlefs/miniconda3/envs/anaconda-platform/lib/python3.5/site-packages/loghub/core/formatter.py", line 257, in create_changelog
    filter_issues_fixed_by_prs(filtered_issues, filtered_prs)
  File "/Users/jdetlefs/miniconda3/envs/anaconda-platform/lib/python3.5/site-packages/loghub/core/formatter.py", line 56, in filter_issues_fixed_by_prs
    for matches in pattern.finditer(body):
TypeError: expected string or bytes-like object

I can make a PR to try and fix this issue later today or this week.

Release 0.3.2

I need the fix in PR #86 for Spyder.

I'm doing the release right now.

Batch processing breaks on python 3

Reversing a zip iterator in python 3 is not allowed: https://github.com/spyder-ide/loghub/blob/master/loghub/core/formatter.py#L225

Actual error when running with batch tags:

Traceback (most recent call last):
  File "/Users/davidh/anaconda/envs/polar2grid_py36/bin/loghub", line 11, in <module>
    sys.exit(main())
  File "/Users/davidh/anaconda/envs/polar2grid_py36/lib/python3.6/site-packages/loghub/cli/main.py", line 29, in main
    parse_arguments(skip=False)
  File "/Users/davidh/anaconda/envs/polar2grid_py36/lib/python3.6/site-packages/loghub/cli/main.py", line 187, in parse_arguments
    show_prs=options.show_prs)
  File "/Users/davidh/anaconda/envs/polar2grid_py36/lib/python3.6/site-packages/loghub/core/formatter.py", line 225, in create_changelog
    for (milestone, since_tag, until_tag) in reversed(items):
TypeError: 'zip' object is not reversible

Simple test in ipython:

In [1]: reversed(zip([1,1,1], [2,2,2]))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-ac0cda3ccbba> in <module>()
----> 1 reversed(zip([1,1,1], [2,2,2]))

TypeError: 'zip' object is not reversible

Add ability to group pull requests by labels

My projects tend to have a lot of pull requests for new features and bug fixes that don't get a corresponding issue created. It seems loghub only groups issues. I'm willing to add this feature if it is something you are willing to add to the project.

It might be easiest as a single flag to say "include pull requests in groups".

Output examples

It lacks the links to output examples to fully understand what it produces. =)

template file missing

@goanpeca with Win 10, Py2.7 getting this error

Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\loghub.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\loghub\cli\main.py", line 29, in main
    parse_arguments(skip=False)
  File "c:\python27\lib\site-packages\loghub\cli\main.py", line 187, in parse_arguments
    show_prs=options.show_prs)
  File "c:\python27\lib\site-packages\loghub\core\formatter.py", line 193, in create_changelog
    show_prs=show_prs)
  File "c:\python27\lib\site-packages\loghub\core\formatter.py", line 237, in render_changelog
    with open(filepath) as f:
IOError: [Errno 2] No such file or directory: 'c:\\python27\\lib\\site-packages\\loghub\\templates\\changelog.txt'

Add option to disable related issues and PRs

Sometimes relationships between PRs and issues can get complicated or a user may not want to list the related PRs/issues next to the entry for an issue/PR. I'd like to propose a command line flag to simply turn off this additional information. Essentially turning off the call to filter_issues_fixed_by_prs(filtered_issues, filtered_prs) in the formatter.py code.

It could alternatively be passed to the template so it could decide not to show the relationships.

Support hidden password

ATM user needs to specify their password for private repos using the -p argument when calling the script. This is not option for security reasons since user password is easily exposed (when working in public spaces, in system history, etc...). It'd be beneficial to ask the user with python getpass module.

Templates not included in pip package

After a pip install, there are no templates in `.../loghub/templates':

$ ls site-packages/loghub/templates/
__init__.py  __pycache__/

This leads to a FileNotFoundError in render_changelog

`None` issue number causing TypeError

When running (and any command really):

loghub pytroll/satpy -ilg bug enhancement --since-tag v0.8.0 -u davidh-ssec

it ends with:

Traceback (most recent call last):
  File "/Users/davidh/anaconda/envs/polar2grid_py36/bin/loghub", line 11, in <module>
    sys.exit(main())
  File "/Users/davidh/anaconda/envs/polar2grid_py36/lib/python3.6/site-packages/loghub/cli/main.py", line 29, in main
    parse_arguments(skip=False)
  File "/Users/davidh/anaconda/envs/polar2grid_py36/lib/python3.6/site-packages/loghub/cli/main.py", line 187, in parse_arguments
    show_prs=options.show_prs)
  File "/Users/davidh/anaconda/envs/polar2grid_py36/lib/python3.6/site-packages/loghub/core/formatter.py", line 257, in create_changelog
    filter_issues_fixed_by_prs(filtered_issues, filtered_prs)
  File "/Users/davidh/anaconda/envs/polar2grid_py36/lib/python3.6/site-packages/loghub/core/formatter.py", line 68, in filter_issues_fixed_by_prs
    issue_url = repo + issue_number
TypeError: must be str, not NoneType

Probably unrelated but I started getting this after having to switch to specifying my username since I hit the github query limit.

Repo name is incorrectly detected from pull request body

For example, for spyder-ide/spyder#6286, loghub is returning

* [PR 6286](https://github.com/spyder-ide/spyder/pull/6286) - PR: Install and run window manager in Travis to fix focus issues and unskip now-passing tests ([4151](https://github.com/similar issues with CircleCI in /issues/4151), [](https://github.com/a ton of frustration I'm having with a the tests in a number of recent PRs. First crack at it will just ensure the code runs without error, and then I'll try enabling tests that failed due to focus/issues/))

Support "all issues"

It'd be nice to be able to generate a changelog since the beginning without having to specify either ut or st for first time generation of projects that didn't start with a clear tagging/release policy from the start or just want to put all in the changelog

Support custom line formats [templates]

It'd be great to support custom formats (as cmd line argument string or as format template file) to let users change line format based on their needs. If users know the available env variables they can use it in their format specs.

The specific format I have in mind in this case includes the tags of the issue.

Related parts:

https://github.com/spyder-ide/loghub/blob/master/loghub/main.py#L177-L180
https://github.com/spyder-ide/loghub/blob/master/loghub/main.py#L22-L25

Maybe changing format_changelog to also accept formatter objects (instead of only format strings) would let users have custom format logic that can easily extend the custom behaviour?

Issue test

This issue was created to test loghub against this repo

ApiNotFoundError

Environment: Python 3.6, OSX, loghub==0.3.3, installed with Pip 9.0.1

loghub pydanny/cookiecutter-django --since-tag 1.11.10 --until-tag v2.0.2

LOGHUB: Querying issues since tag 1.11.10 until tag v2.0.2

Traceback (most recent call last):
  File "/Users/danielgreenfeld/.virtualenvs/coursebuilder/bin/loghub", line 11, in <module>
    sys.exit(main())
  File "/Users/danielgreenfeld/.virtualenvs/coursebuilder/lib/python3.6/site-packages/loghub/cli/main.py", line 29, in main
    parse_arguments(skip=False)
  File "/Users/danielgreenfeld/.virtualenvs/coursebuilder/lib/python3.6/site-packages/loghub/cli/main.py", line 187, in parse_arguments
    show_prs=options.show_prs)
  File "/Users/danielgreenfeld/.virtualenvs/coursebuilder/lib/python3.6/site-packages/loghub/core/formatter.py", line 241, in create_changelog
    since = gh.tag(since_tag)['tagger']['date']
  File "/Users/danielgreenfeld/.virtualenvs/coursebuilder/lib/python3.6/site-packages/loghub/core/repo.py", line 170, in tag
    return self.repo('git')('tags')(sha).get()
  File "/Users/danielgreenfeld/.virtualenvs/coursebuilder/lib/python3.6/site-packages/loghub/external/github.py", line 145, in __call__
    return self._gh._http(self._method, self._path, **kw)
  File "/Users/danielgreenfeld/.virtualenvs/coursebuilder/lib/python3.6/site-packages/loghub/external/github.py", line 303, in _http
    raise ApiNotFoundError(url, req, resp)
loghub.external.github.ApiNotFoundError: https://api.github.com/repos/pydanny/cookiecutter-django/git/tags/fe7c4aa815f6fce1e9a79f3449daf232dacc175d

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.