timvink / mkdocs-git-revision-date-localized-plugin

MkDocs plugin to add a last updated date to your site pages
https://timvink.github.io/mkdocs-git-revision-date-localized-plugin/index.html
MIT License
198 stars 40 forks source link

v1.0.1 creates git log warnings that fail mkdocs strict mode #89

Closed andrewthauer closed 2 years ago

andrewthauer commented 2 years ago

After upgrading to v1.0.1 we started seeing build failures with the following:

WARNING  -  [git-revision-date-localized-plugin] Unable to read git logs of '/input/docs/.../my-doc.md'. Is git log readable? Option 'fallback_to_build_date' set to 'true': Falling back to build date

Is it possible #88 is causing these issues? It's a bit odd since we do fetch the entire history, but the warning says it's falling back to the build date for some reason. In any case, since it's a warning, if you are using mkdocs build --strict it will fail.

timvink commented 2 years ago

Thanks for reporting, will look into it in 1-2 weeks or so (currently on holiday)

andrewthauer commented 2 years ago

Thanks. I am now thinking this might be unrelated and just a coincidence. I'll verify and close once I confirm.

timvink commented 2 years ago

Did you verify yet?

You mentioned "build failures" but you are showing a warning (it shouldn't break the build).

andrewthauer commented 2 years ago

@timvink - Sorry, I wasn't able to track down the root cause yet, but I'm pretty sure it's not related to the `v1.0.1 change. I'll close this and re-open if needed.

You mentioned "build failures" but you are showing a warning (it shouldn't break the build).

This fails a build only used with the mkdocs --strict flag, since all warnings are treated as failures. We've temporarily disabled strict mode to workaround this.

ssbarnea commented 1 year ago

@andrewthauer @timvink Why is this ticket closed as the current bug prevents people from using strict mode in their pipelines, something that is known to be a good practice.

andrewthauer commented 1 year ago

@ssbarnea I wasn't able to confirm the issue was related to this plugin. Can you reproduce and confirm it is?

ssbarnea commented 1 year ago

Yes. I disabled the plugin for now.

andrewthauer commented 1 year ago

It could also be an issue with how mkdocs treats warnings in newer versions. If I recall there didn't seem to be any code changes to this plugin that seemed like they would have caused this. Disabling the plugin might be a red herring. But again, not entirely sure.

ssbarnea commented 1 year ago

I did not use mkdocs for very long time, so I cannot say if they changed something recently. Still, I almost always tried to run tools with strict mode (like sphinx), so I would not miss problems. Still, gue to the nature of this plugin, if you add strict: true you will not be able to test locally as it will cause failures for any uncommitted change that you have.

How this can be sorted? I am not sure. Maybe there is an info/notice level that does not become an error when you run in strict?

For the moment I disabled the plugin because it did not add essential functionality for me. For me it was more important to be able to have a default strict mode.

timvink commented 1 year ago

FYI, this issue will be picked up in #108

timvink commented 1 year ago

Fixed, new v1.2.0 version is now on pypi. You can now add the following, and the logger will use info instead of warning level.

plugins:
  - git-revision-date-localized:
      strict: false