git-changelog
git-changelog copied to clipboard
Trying to generate a change log results in an AttributeError.
$ git-changelog -t keepachangelog .
Traceback (most recent call last):
File "/Users/dsully/.local/bin/git-changelog", line 10, in <module>
sys.exit(main())
File "/Users/dsully/.local/lib/python3.7/site-packages/git_changelog/cli.py", line 91, in main
changelog = Changelog(args.repository, style=args.style)
File "/Users/dsully/.local/lib/python3.7/site-packages/git_changelog/build.py", line 179, in __init__
versions = self.group_commits_by_version(dates)
File "/Users/dsully/.local/lib/python3.7/site-packages/git_changelog/build.py", line 284, in group_commits_by_version
version.url = self.provider.get_tag_url(tag=commit.version)
AttributeError: 'NoneType' object has no attribute 'get_tag_url'
Thank you @dsully for taking the time to report this. Hopefully I'll finally have some time tomorrow to fix that :slightly_smiling_face:
Can you link to the project causing this issue? I'm particularly interested in the output of this comand: git config --get remote.origin.url
which is used to get the provider URL (github.com, gitlab.com, etc.). Also currently it will only work for GitHub and GitLab :sweat_smile:
It points to an internally hosted URL at my company, that happens to be Gerrit.
So it sounds like another provider would need to be implemented.
Yep, exactly. This project is still very young, I'm not sure what would be the best way to quickly give users the ability to use it with other providers. Either we add support directly in the code, or we make a plugin architecture.
I would suggest a plugin architecture. With Python 3's __init_subclass__
it's pretty easy to do.
I didn't know about __init_subclass__
. Would you happen by chance to have an example/tutorial on how to use __init_subclass__
to builld a plugin architecture :sweat_smile:?
http://musings.tinbrain.net/blog/2019/mar/20/plugins-and-auto-discovery-python/ is pretty good.
Thank you, I'll try this!
Hello, I have the same issue, I use self-hosted gitlab-ce. Any suggestions ? Thanks
Hello 🙂
I don't have much time to implement this plugin structure, but maybe you'd like to contribute and send a PR for it? If so, I'll be available to review it of course. The linked tutorial above seems to be a great starting point.