Code

The Code section's seven pages on the BlockoutGames GitHub organization, how often GitHub is collected, and how its numbers are counted.

Panel

The Code section shows the BlockoutGames GitHub organization's work: commits, pull requests, reviews and releases across every repository, and each person's share. Every signed-in member can read all of it. It opens from the Code pill in the top bar (or g then c); its pages are in the rail beside the page.

The Code section's pages

  • Code overview

    /code: the range's headline numbers, throughput, the activity calendar, what waits for review and what shipped.

  • Pull requests

    /code/pull-requests: every pull request, filtered and sorted, with sizes and cycle times.

  • Reviews

    /code/reviews: the review queue, longest wait first, and how fast reviews come back.

  • Releases

    /code/releases: what shipped, how often each repository ships, every release with its notes.

  • Trends

    /code/trends: lines changed, cycle time, cumulative flow, the weekly rhythm, the backlog over time.

  • Repositories

    /repositories: every repository, and a page for each one.

  • Members

    /members: the team person by person, the most active first.

  • A member's page

    /members/<login>: one person's pull requests, reviews, commits and lines.

The rail lists them in this order: Overview, Pull requests, Reviews, Releases, Trends, Repositories, Members. The old addresses /pull-requests and /releases open Pull requests and Releases; /people opens Members.

Who can see the Code section

Every signed-in member of the studio reads every Code page; there is nothing to switch on. Owners see three things more: the technical message of a failed GitHub run, a button to the GitHub collection settings on Admin, Integrations, and each member's two-factor status on Members. The panel only reads GitHub; nothing on these pages changes anything on GitHub.

The range on Code pages

Each Code page has one range switch in its header, and every chart on the page follows it. The overview, Pull requests, Reviews, Releases, Trends and a repository's page offer 30 days, 90 days (the default), 1 year and all. Members and a member's page also offer 7 days, which is their default. The range is kept in the address (?range=1y), so a link opens the same view.

Weekly charts count whole weeks: a week that overlaps the start of the range is counted entire. All starts at the first week with a recorded commit, pull request or release.

How often GitHub is collected

The worker reads the organization every 30 minutes. Collection is incremental: each run asks GitHub again only about pull requests that changed since they were last read, and every request is conditional, so an unchanged answer costs nothing against GitHub's limit. Member profiles are refreshed once a day and contributor statistics once an hour. A run may use up to 2,200 of the requests GitHub charges and 25 minutes; a run that runs out keeps what it read, and the next run continues from there.

Each Code page's header ends with Collected … ago: when the snapshot it shows was taken. Nothing on a Code page asks GitHub itself; every page reads the latest stored snapshot.

What one GitHub collection run does

Each run, on the worker's github-organization queue, goes through the same steps:

  1. It loads the saved credential (the deployment token, or the GitHub App saved on Admin, Integrations). With none, there is no run. While GitHub's rate-limit cooldown is running, each run stops here without asking GitHub.

  2. It lists the organization's members (profiles at most once a day) and its repositories.

  3. It reads each repository in turn: open issues, the pull requests that changed since the last run, releases and contributor statistics.

  4. A repository it cannot read, or that the run's budget does not reach, keeps its data from the previous snapshot; the run is then partial and says which repositories were carried over.

  5. Statistics GitHub answered "still computing" (202) are asked once more at the end of the run.

  6. The new snapshot is stored, and every Code page reads it from then on.

A GitHub collection run. Every 30 minutes the worker loads the saved GitHub credential, lists the organization's members and repositories, then reads each repository's issues, changed pull requests, releases and statistics. Repositories it cannot read or reach keep their previous data. Statistics still being computed are asked again at the end. The snapshot is stored, and the Code pages read only that stored snapshot.
What stops a GitHub run early
  • Budget: a run may send 2,200 requests GitHub charges against its 5,000-an-hour limit, and receive up to 4,000 "not modified" (304) answers, which GitHub does not charge. Two runs an hour leave 600 charged requests for everything else.

  • Time: a run stops after 25 minutes. A run that read pull requests but finished no repository stores nothing and counts as progress: the next run continues from there.

  • Pace: requests are at least 125 ms apart (at most 480 a minute), each waits up to 30 seconds, and a timeout, lost connection or 5xx answer is tried 3 times.

  • GitHub failing: three repositories failing in a row stop the run. Two runs in a row stopped that way open a circuit: the next runs are skipped for 30 minutes, doubling up to 2 hours, without sending a request.

  • Rate limits: when GitHub refuses for its limits, the run stops and stores a cooldown as long as GitHub asks (a minute when it does not say); runs before it ends stop without asking GitHub.

Each run is written to the collector's run log with its requests and unchanged answers, which Admin, Integrations shows as Last GitHub run.

When GitHub data is behind or missing

Collected … ago

A green dot when the last run finished, an amber one when it did not.

GitHub sync is behind — showing data from

The last run failed; the page shows the snapshot of that date. It tries again every 30 minutes. Owners can unfold the run's own message and open the collection settings.

GitHub is still computing contribution statistics for N repositories

GitHub has not built its commit counts yet; commits are estimated meanwhile (below).

Connect GitHub collection

Before the first collection, no credential is saved: an owner must configure a read-only token or App on Admin, Integrations. Members are told to ask an owner.

Waiting for the first collection

A credential is saved and the first run has not stored a snapshot yet.

A chart with nothing to show says why in one line, the collection's state first, then the range ("Try a longer range").

How Code numbers are counted

Lines

The additions and deletions of merged pull requests, by merge date. Work pushed straight to a branch, without a pull request, is not counted anywhere.

Bots

GitHub logins ending in [bot], such as dependabot[bot], are left out of every count, chart and table. The one exception is the Pull requests list, which has an Include bots box.

Commits

GitHub's default-branch commits (merge and empty commits left out) when every repository has statistics. Otherwise every commit count is estimated from merged pull requests, never a mix.

Weeks

Start on Sunday 00:00 UTC, as GitHub counts them; they are not studio weeks.

Days

For the calendars and weekday charts, UTC days.

The same explanation is folded under Members and a member's page as Reading contribution numbers. Every Code number is defined once on Code metrics.

What "Estimated from merged pull requests" means

BlockoutGames is on GitHub's free plan, and GitHub often answers its commit statistics empty or "still being computed". When any repository lacks them, every commit count in the Code section is worked out from merged pull requests instead: each merged pull request counts its commits in the week it merged, under its author and repository. Every tile and chart that uses the estimate says Estimated from merged pull requests under it.

The estimate misses work pushed without a pull request, counts every commit of a squash-merged pull request though it lands as one, and credits all of a pull request's commits to its author.

Adding a Code chart to your home page

Most Code charts and tile rows have a small grid button beside their title: Add to a page. It puts that chart, with its range, on one of your home pages. The button appears once you have a home page.

Code pages on a phone

Below 768 pixels wide the tiles sit two to a row (one to a row on the narrowest phones), and every chart takes the full width, one under another, in the order of the desktop page. Tables keep all their columns and scroll sideways inside their card, with the first column (the pull request, repository or member) held at the left edge. The section's pages are chips under the top bar.

Notifications from Code

You are told when someone requests your review, when a pull request you opened is merged or gets changes requested, and when a release is published. See Notifications.

Related: Collector and data freshness, Sign-in and access.

Updated