Skip to content

Repository files navigation

sai-project-tracker

Traffic-light tracker for student issue assignments in the S-AI-Projects GitHub org.

How it runs

  • Fetch data workflow: daily at 00:00 and 12:00 IST. Runs scripts/fetch-data.mjs and commits data/tracker.json to main.
  • Anyone logged in to GitHub can trigger it: the Refresh button opens a pre-filled Refresh data issue, and submitting it starts the workflow. The workflow comments and closes the issue.
  • Issue-triggered refreshes are limited to one every 15 minutes, measured from the last sync by anyone. Scheduled runs and manual runs (Actions > Fetch data > Run workflow) always run.
  • The app reads data/tracker.json straight from raw.githubusercontent.com at page load, so a data update needs no rebuild. GitHub caches raw files for up to 5 minutes.
  • Deploy workflow: rebuilds and publishes the UI on pushes to main that touch app code. Data, script and markdown changes do not trigger it.

Commits per day

  • The Activity tab shows a bar chart of commits per day across the org.
  • Students push to their own forks, so the count is the commits inside pull requests (open, merged or closed) to the org repos.
  • Each commit is counted once, on its author date in IST. Merge commits are excluded.
  • The chart starts at COMMITS_SINCE in scripts/fetch-data.mjs.
  • Commits that are pushed to a fork but not yet in a PR are not visible to the tracker.

Status rules

  • Green (merged): linked PR is merged.
  • Yellow (open): linked PR is open.
  • Red (none): no PR, or only closed-unmerged PRs (recorded with state closed).
  • A PR is linked to an issue by a closing reference in its body (Resolves S-AI-Projects/<repo>#7, Fixes #7, or the issue URL).
  • Fallback: Task ID in the PR title (R01-T002: ...), looked up in assignments.csv for that repo.
  • Several PRs on one issue: merged beats open beats closed.

Local dev

npm install
npm run dev                               # UI, reads the published data file
GITHUB_TOKEN=ghp_xxx npm run fetch-data   # optional, rewrites data/tracker.json locally
  • ONLY_REPOS=Bash-Oneliner npm run fetch-data limits the fetch, for testing.

Updating assignments

  1. In the assignment sheet, open the Task Issues tab, then File > Download > CSV. Save it as data/assignments.csv.
  2. Commit and push, then run the Fetch data workflow.

GitHub API limits

  • Requests time out after 20s and retry up to 4 times with backoff (1s, 2s, 4s).
  • Repos are fetched 5 at a time with a 500ms pause between batches.
  • On a rate limit the script waits for the reset if it is under 2 minutes, otherwise it fails and keeps the old tracker.json.
  • Without GITHUB_TOKEN the limit is 60 requests an hour, which is less than one full run.
  • Tune the constants at the top of scripts/fetch-data.mjs.

Releases

Packages

Contributors

Languages