Skip to content

Conversation

@amrit110
Copy link
Member

This pull request introduces a complete workflow for collecting and deploying analytics for Coder workspaces and templates, including cloud storage integration and deployment automation. The main changes are the addition of two GitHub Actions workflows for scheduled data collection and automated deployment, a new analytics collection script, and supporting configuration updates for the analytics service.

New GitHub Actions workflows:

  • Added .github/workflows/collect-coder-analytics.yml to automate collection of Coder workspace and template analytics every 6 hours and on manual trigger, with results uploaded to a Google Cloud Storage bucket and a summary generated in the workflow output.
  • Added .github/workflows/deploy-analytics.yml to build, test, and deploy the analytics dashboard to Google Cloud Run on pushes and pull requests affecting the analytics service, including health checks and deployment summaries.

Analytics collection and storage:

  • Introduced scripts/collect_coder_analytics.py, a Python script that uses the Coder CLI to fetch workspace and template data, creates a timestamped JSON snapshot, and uploads it to a GCS bucket with lifecycle management.
  • Updated pyproject.toml to add google-cloud-storage as a dependency for GCS integration in the analytics collection script.

Configuration and environment updates:

  • Added .env.example for local development and deployment, detailing required environment variables and GitHub secrets for GCP, OAuth, and Coder API integration.
  • Added .dockerignore to exclude unnecessary files from analytics service Docker builds.
  • Added .eslintrc.json to configure ESLint for the Next.js analytics service.

Coder service configuration:

  • Updated coder/deploy/startup.sh to set CODER_MAX_TOKEN_LIFETIME=8760h, allowing longer-lived tokens for API access.

@amrit110 amrit110 self-assigned this Dec 10, 2025
@amrit110 amrit110 added the enhancement New feature or request label Dec 10, 2025
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.09%. Comparing base (b42613a) to head (3d70e7e).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #41   +/-   ##
=======================================
  Coverage   88.09%   88.09%           
=======================================
  Files           3        3           
  Lines         462      462           
=======================================
  Hits          407      407           
  Misses         55       55           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amrit110 amrit110 merged commit b6e4f05 into main Dec 10, 2025
10 checks passed
@amrit110 amrit110 deleted the add_analytics_page branch December 10, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants