Skip to content

feat: add static analytics site generator for HCA Data Portal#3034

Merged
NoopDog merged 3 commits intomainfrom
mim/3033-analytics-static-site
May 5, 2026
Merged

feat: add static analytics site generator for HCA Data Portal#3034
NoopDog merged 3 commits intomainfrom
mim/3033-analytics-static-site

Conversation

@MillenniumFalconMechanic
Copy link
Copy Markdown
Contributor

Ticket

Closes #3033

Summary

  • Add analytics/generate_static_site.py script that calls the shared analytics package to generate a static HTML dashboard with GA4 data for the HCA Data Portal
  • Add GitHub Actions workflow to deploy the generated site to GitHub Pages
  • Add .credentials/ to .gitignore and update analytics package dependency to include static site support

The script uses the hostname filter (data.humancellatlas.org) to scope data to the portal only (the GA4 property is shared with the explorer), with an analytics start date of 2024-02-01 when the hostname split became reliable.

Test plan

  • Generated site locally and verified dashboard renders correctly
  • Verify GitHub Pages deployment works via workflow_dispatch

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a static analytics dashboard for the HCA Data Portal, checks in a generated site snapshot, and introduces GitHub Pages deployment for publishing the dashboard.

Changes:

  • Add analytics/generate_static_site.py to build a portal-branded static analytics site from the shared analytics package.
  • Commit the generated site HTML plus JSON data artifacts for the current report snapshot.
  • Add a Pages deployment workflow, ignore local credentials, and update the analytics package dependency.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
analytics/site/index.html Static dashboard shell and client-side rendering logic.
analytics/site/data/search_queries.json Generated search-query analytics snapshot.
analytics/site/data/pageviews.json Generated top-page analytics snapshot.
analytics/site/data/outbound_links.json Generated outbound-link analytics snapshot.
analytics/site/data/monthly_traffic.json Generated monthly traffic history snapshot.
analytics/site/data/meta.json Generated report metadata for the snapshot.
analytics/site/data/filter_selected.json Generated filter-event data snapshot.
analytics/site/data/file_downloads.json Generated direct-download data snapshot.
analytics/site/data/file_download_events.json Generated file-download event totals snapshot.
analytics/site/data/custom_events.json Generated custom-event summary snapshot.
analytics/site/data/config.json Runtime branding/config for the static site.
analytics/site/data/access_requests.json Generated access-request data snapshot.
analytics/requirements.txt Updates the shared analytics package source.
analytics/generate_static_site.py New script to generate the static site.
analytics/constants.py Advances analytics reporting month constants.
.gitignore Ignores local credentials directory.
.github/workflows/deploy-analytics.yml Adds GitHub Pages deployment workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread analytics/site/index.html Outdated
Comment thread analytics/requirements.txt
Comment thread analytics/generate_static_site.py
Comment thread analytics/site/index.html
Comment thread analytics/site/data/monthly_traffic.json
Comment thread analytics/site/data/outbound_links.json
Comment thread analytics/site/data/search_queries.json
Comment thread analytics/site/data/outbound_links.json
Comment thread analytics/site/data/outbound_links.json
Comment thread analytics/site/index.html
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread analytics/generate_static_site.py
Comment thread analytics/site/data/pageviews.json
Comment thread analytics/site/data/pageviews.json
Comment thread analytics/site/data/search_queries.json
Comment thread analytics/site/index.html
Comment thread analytics/generate_static_site.py
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@NoopDog NoopDog merged commit 95af303 into main May 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add static analytics site generator for HCA Data Portal

3 participants