Comment out broken Unique Visitors chart (#12823)#12831
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR appears to disable the “Unique Visitors” chart on the home stats page and stop fetching visitor counts from Graphite, with corresponding updates to the i18n message template.
Changes:
- Commented out the “Unique Visitors” chart and its graph JSON payload in
home/stats.html - Disabled Graphite-backed visitor count retrieval in
openlibrary/core/admin.py(now returns an empty list) - Updated
messages.potto reflect removed/changed translatable strings and source references
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| openlibrary/templates/home/stats.html | Comments out the visitors chart block and its JSON graph data script |
| openlibrary/i18n/messages.pot | Removes/adjusts message entries/source refs to match template/code changes |
| openlibrary/core/admin.py | Replaces Graphite fetch implementation with a hardcoded empty result |
| #: databarHistory.html databarView.html | ||
| #, python-format | ||
| msgid "Last edited by %(author_link)s" |
444fef9 to
2f4f439
Compare
|
Thank you for the PR, @Sadashii! A reviewer must first be assigned. There are currently 14 open PRs of equal or higher priority ahead of yours. PR triage checklist (maintainers / Pam)
Note This comment was automatically generated by Pam, Open Library's Project AI Manager, on behalf of @mekarpeles. Pam is designed to provide status visibility, perform basic project management functions and relevant codebase research, and provide actionable feedback so contributors aren't left waiting. |
|
This PR needs significant work and as is implemented I believe creates work for us. It partially un-implements a feature, while leaving some pieces intact and fully removing other parts, resulting in an incoherent solution that will not be accessible to others maintaining the project. The code should simply be updated such that:
Also, please kindly provide a screenshot in the PR to give reviewers confidence so we can put it on testing. |
2f4f439 to
f9ed54a
Compare
|
Updated so when there is valid result the visual are shown, when the response is missing, the visual is also hidden. |
f9ed54a to
0767328
Compare
for more information, see https://pre-commit.ci
Closes #12823
Dynamically hides the Unique Visitors stats charts on the homepage and the admin dashboard when visitor counts data is not available (such as when the upstream archive.org Graphite pipeline is down).
Technical
openlibrary/templates/home/stats.htmland on the admin stats pageopenlibrary/templates/admin/index.htmlwith a$if stats["visitors"].get_summary(28):template conditional.$# Conditional check since the graphite source is currently unreliable, hiding the stat when it returns nothing.timeout=5parameter to the Graphite request inopenlibrary/core/admin.pyto prevent hangs when the Graphite server is down.Testing
Verify style checks:
Screenshot
With valid response,

With missing/invalid response,

(Note: To be updated by the reviewer/submitter with a screenshot from local testing environment showing the homepage stats blocks cleanly rendered without the Unique Visitors chart).
Stakeholders
@mekarpeles