Skip to content

Webpage Integration: GitHub Activity Pipeline #2583

Description

@henryajisegiri

Goal

Build the end-to-end pipeline to fetch store, and display a user's Boost GitHub activity on their profile page.

Figma Link

Important References
Spike Reference
Draft PR


Scope

GraphQL helper, data model and Celery sync task.


Background

The GitHub activity card on the user profile currently renders hardcoded placeholder content. Activity data should be sourced from GitHub using the existing app-level token (GITHUB_TOKEN) via GraphQL — not per-user OAuth — since Boost and cppalliance repositories are public and we already authenticate with a shared app token. Data is fetched for the boostorg org only.

Activity data is stored in the database and refreshed daily via a Celery task, so profile loads never call GitHub live.


Acceptance Criteria

GraphQL helper and activity fetcher

  • A graphql(query, variables) method is added to GithubAPIClient, posting to the GitHub GraphQL endpoint using the app token (settings.GITHUB_TOKEN).
  • A boost_activity(login) function runs the contributionsCollection query scoped to the boostorg org and returns the following:
    • Total commit count and number of repositories
    • Total repositories created
    • Total PRs opened and number of repositories
    • Total PR reviews and number of repositories
    • Featured PR (highest comment count): repository name, URL, and comment count
  • The boostorg org node ID is stored as a settings constant to avoid resolving it on every call.
  • A GraphQL or API error raises an exception rather than returning partial data silently.

Data model

  • A GithubActivity model is added with a one-to-one relationship to User, storing the computed activity numbers, featured PR fields, and a last_synced timestamp.
  • An upsert helper creates or updates the row for a given user.
  • The model is visible in the Django admin for debugging.

Refresh task

  • GitHub activity data is not refreshed by a scheduled nightly task for all users.
  • When a user connects their GitHub account for the first time, the system performs an initial fetch of that user’s GitHub activity and stores it locally.
  • When a profile page is opened, the system checks the stored GitHub activity record’s last-synced timestamp.
  • If the stored data is not stale, the profile displays the existing stored GitHub activity without triggering a refresh.

Note: Stale = >24hours

  • If the stored data is stale, the system triggers a refresh of that user’s GitHub activity and updates the stored record when the refresh completes.
  • When a refresh is in progress, the UI shows a refreshing/loading indicator associated with the GitHub activity card.
  • In the non-JS experience, the card shows the last updated state and communicates that a page refresh may be needed to see the newest data.
  • When a user disconnects their GitHub account, the system deletes that user’s stored GitHub activity data.

Card display

  • The GitHub activity card on the profile page reads from the stored GithubActivity row in the database. The page load does not call the GitHub API — all data is pre-fetched and stored by the background Celery task.
  • If the user has no linked GitHub account, a connect prompt is shown on the card.
  • Clicking "View on GitHub" CTA, redirects to the user's profile.

FE/BE Actions

Description URL
Fetch stored GitHub activity for a user
Trigger single-user activity refresh on connect
Schedule daily activity sync task (Celery Beat)

Out of Scope

  • Account connections card, connect/disconnect flows
  • Per-user OAuth token storage
  • Account connections card
  • Email claim / commit author verification

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions