-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated git-committers to 1.1.0 #4303
Conversation
Thanks! There are still some rough edges, see ojacques/mkdocs-git-committers-plugin-2#17 |
@squidfunk - should be good now with 1.0.1. |
Hmm, does caching still work? Do I need to configure something now? I'm seeing repeated calls in subsequent builds. |
I'm seeing this every time:
|
The way to get contributors has completely changed. The plugin does not anymore try to guess / match local git commits with users in github, but rather gets the information directly from GitHub, for each page. The drawback is that we have an http call now for each page. The benefit is that contributors are now accurate (at least match GitHub's perspective). Thinking of the caching aspect a bit further, it is possible to cache the results - but I am not sure still when to invalidate the cache for each page. Using the git log seems to be a way. Let me ask: do you have a big impact on your builds? |
Yes, I now need to disable the plugin each time I work on the project, because the build time went from 9s to 44s. I need to restart quite often, which is why I feel that removing caching is a step back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump to git-committers 1.1.0 to benefit from cache
I created a new version - 1.1.0 which re-introduces a cache, per page. In my tests:
Note: the message on the token is because you kept token as an attribute in Let me know how it goes. Sorry for back & forth! |
Thanks! I'll check it out this weekend. Yes, I know about the token setting, but I have pinned the plugin to <1 because of the missing dependency that broke the build earlier. Need to find some time to do the upgrade. |
This took some time, sorry for that – I had to fix a lot of bugs on the blog plugin 😅 If I update to 1.1.0 on Insiders, I'm now greeted with the following error message:
Any thoughts why this might be happening? If I disable the plugin, all works fine. Also, 0.4.4 still works without problems. |
Sorry to jump in, is the new version of |
@jasonren0403 this might be related to the fact that we're using 0.4.4 because of the errors reported in my last comment. It might be fixed in 1.1.0, but maybe @ojacques can clarify. |
@squidfunk - I found the issue, this is fixed in 1.1.1. Workaround is to delete the cache file. |
@jasonren0403 - yes. With version 1.x.x, the contributors you see on GitHub are the contributors you will get on the documentation. Previously, the plugin was trying to match local git committers with the one on GitHub, which could lead to false matches. The new version fetches directly the info from each file on GitHub. |
Thanks! Now, all avatar URLs are {
"squidfunk": {
"login": "squidfunk",
"name": "squidfunk",
"url": "#",
"avatar": "https://www.gravatar.com/avatar/174f624169542490d134f6ebfa6989f7?d=identicon"
}
} |
In the new version, the cache is named {
"cache_date": "2022-09-28",
"page_authors": {
"docs/index.md": {
"last_commit_date": "2020-03-26",
"authors": [
{
"login": "squidfunk",
"name": "squidfunk",
"url": "https://github.com/squidfunk",
"avatar": "https://avatars.githubusercontent.com/u/932156"
},
{
"login": "coliff",
"name": "coliff",
"url": "https://github.com/coliff",
"avatar": "https://avatars.githubusercontent.com/u/1212885"
},
{
"login": "Eskumu",
"name": "Eskumu",
"url": "https://github.com/Eskumu",
"avatar": "https://avatars.githubusercontent.com/u/21247241"
},
{
"login": "edmorley",
"name": "edmorley",
"url": "https://github.com/edmorley",
"avatar": "https://avatars.githubusercontent.com/u/501702"
}
]
},
"docs/alternatives.md": {
"last_commit_date": "2022-09-14",
"authors": [
{
"login": "squidfunk",
"name": "squidfunk",
"url": "https://github.com/squidfunk",
"avatar": "https://avatars.githubusercontent.com/u/932156"
},
{
"login": "pawamoy",
"name": "pawamoy",
"url": "https://github.com/pawamoy",
"avatar": "https://avatars.githubusercontent.com/u/3999221"
}
]
}
} For the names, the plugin now uses the login name. Getting the full name will require an API call which I don't think is necessary. |
I can confirm that it works now. Thanks for your patience and for your work on this great plugin! |
And thanks for your sponsorship! |
This PR updates the mkdocs-git-committers-2 plugin from 0.4.3 to 1.1.0.
Version 1.1.0 is a complete re-write. Please check the link to see what has changed.
The results will now be reliable, and this does not require a GitHub personal access token anymore.
I tested it successfully against the insiders repository.