8000 Regression: Hide GitHub Stats for Private Repositories · Issue #2081 · squidfunk/mkdocs-material · GitHub
[go: up one dir, main page]

Skip to content

Regression: Hide GitHub Stats for Private Repositories #2081

@NJAldwin

Description

@NJAldwin

I've found a bug and checked that ...

  • ... the problem doesn't occur with the default MkDocs template
  • ... the problem is not in any of my customizations (CSS, JS, template)
  • ... the documentation does not mention anything about my problem (it confirms it -- see below)
  • ... there are no open or closed issues that are related to my problem (there is a closed issue that I think is related -- see below)

Description

This bug concerns the visibility of the X Stars • X Forks statistic.

I am wondering if the behavior change resulted from the fix for #1864.

Expected behavior

Previously (we had been on 5.1.0), the stats were hidden for private repositories -- only the GitHub logo was shown. This is confirmed to be expected by the docs:

Additionally, for GitHub and GitLab, the number of stars and forks is automatically requested and rendered for public repositories.

(Emphasis in original) [link]

Actual behavior

Now, 0 Stars • 0 Forks is shown when given a private repository (regardless of the actual number of stars or forks).

Steps to reproduce the bug

  1. Provide a value for repo_url that points at a private GitHub repository (or a nonexistent repo).
  2. Build and serve the site.
  3. Browser: clear session storage.
  4. Navigate to the site with the console open.
  5. Observe a GitHub API request sent for the repo; for a private repo, GH returns a 404.
  6. Observe that the GitHub icon has "0 Stars 0 Forks" underneath it.
  7. Observe in session storage, the following value is set: ["0 Stars","0 Forks"].

Package versions

  • Python: 2.7.4
  • MkDocs: 1.1.2
  • Material: 6.1.6

Project configuration

... # somewhere in mkdocs.yml

repo_url: https://github.com/some-repo-that-is/private-or-does-not-exist

... # rest of file

System information

(should be irrelevant for this issue)

  • OS: macOS 10.13.6 / site built with docker python:3.7 image
  • Browser: Chrome 86

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0