π Summary
v0.2.4 makes the MkDocs Ultralytics plugin more reliable and stable by fixing a GitHub author resolution race condition and modernizing the CI workflow dependencies. π§±β¨
π Key Changes
-
π§΅ Race-condition fix for GitHub authors (PR #177 by @glenn-jocher)
- GitHub author info is now resolved once in the main process via
resolve_all_authors()before any multiprocessing begins. - Worker processes now only read precomputed author data from
git_dataβthey no longer write to the author cache. - The previous global, thread-locked cache has been replaced with a clear load / resolve / save flow using:
load_author_cache()resolve_github_user()/resolve_all_authors()save_author_cache()
processor.get_git_info()andprocess_html()are simplified: they no longer acceptdefault_authorand repo-specific author parameters, and now just read pre-resolvedauthors.
- GitHub author info is now resolved once in the main process via
-
πΎ Safer and more robust author caching logic
- Author cache is stored in a single YAML file:
mkdocs_github_authors.yaml. - Cache is now updated once per run in the main process, avoiding concurrent writes and file corruption.
- A new helper
get_default_avatar()lazily fetches and caches the GitHub default avatar URL, with timeouts and fallbacks for network errors.
- Author cache is stored in a single YAML file:
-
π More resilient GitHub API calls
- All GitHub-related HTTP calls now use a fixed timeout to prevent hangs.
- Graceful fallbacks:
- If avatar resolution fails, the plugin falls back to a safe default avatar URL.
- If GitHub user lookup fails, authors are still rendered with sensible defaults (e.g., repo URL instead of profile URL).
-
π§Ή Codebase cleanup and simplification
- Utility functions simplified and tightened:
get_youtube_video_ids()signature and docstring streamlined.
get_git_info()now clearly:- Uses precomputed
creation_dateandlast_modified_date. - Reads
authorsdirectly from the already-resolvedgit_data.
- Uses precomputed
- Utility functions simplified and tightened:
-
βοΈ CI workflow updates for GitHub Actions
actions/checkoutupgraded from v5 β v6.actions/upload-artifactupgraded from v5 β v6.actions/download-artifactupgraded from v6 β v7.- These updates move the workflows to Node.js 24βbased actions, keeping the release pipeline modern and compatible with the latest GitHub infrastructure.
π― Purpose & Impact
-
π« Eliminates intermittent build failures
- The previous design allowed multiple parallel workers to write to
mkdocs_github_authors.yamlat the same time, causing race conditions and occasional cache corruption. - By resolving authors once in the main process and making workers read-only, v0.2.4 removes this entire class of errors.
- The previous design allowed multiple parallel workers to write to
-
β More reliable documentation builds
- MkDocs sites using this plugin (especially with multiprocessing enabled) will now build more consistently and predictably, with fewer hard-to-reproduce failures.
- Teams running CI builds or automated doc deployments benefit from higher stability and less flakiness.
-
π§ Simpler mental model for contributors
- Author resolution now follows a straightforward pipeline:
- Build git map.
- Pre-resolve all authors in the main process.
- Save a single cache file.
- Let workers consume read-only
git_data.
- This makes the code easier to understand, maintain, and extend for future features.
- Author resolution now follows a straightforward pipeline:
-
π Better behavior in real-world environments
- Network errors, slow GitHub responses, or avatar resolution issues are now handled gracefully with timeouts and fallbacks, avoiding long hangs or crashes during docs builds.
-
π Future-proof CI & tooling
- Updating to the latest
actions/*versions means:- Continued support for GitHub-hosted runners and modern Node.js versions.
- Fewer surprises as older action versions are deprecated.
- This keeps the publish pipeline for the plugin secure, current, and maintainable.
- Updating to the latest
Overall, v0.2.4 is a stability and robustness release: no user-facing configuration changes are required, but your MkDocs builds using the Ultralytics plugin should now be more dependable and less error-prone. ππ
What's Changed
- Bump actions/checkout from 5 to 6 in /.github/workflows by @dependabot[bot] in #174
- Bump actions/download-artifact from 6 to 7 in /.github/workflows by @dependabot[bot] in #176
- Bump actions/upload-artifact from 5 to 6 in /.github/workflows by @dependabot[bot] in #175
- Fix race condition on GitHub authors by @glenn-jocher in #177
Full Changelog: v0.2.3...v0.2.4