How Prism reads GitHub (and what the token needs)
Written for whoever owns your GitHub org and whoever issues the credential. Short version: your users never generate GitHub traffic, the background sync is a single serial rate-capped job, and the token it needs is read-only.
For the procedure of turning the source on, see Take a source live. This page is what to hand your platform and security teams before you get there.
1. Users never touch GitHub
When someone asks Prism a question, the agent answers from a local read-only copy of the GitHub fields it needs, held in Prism's own Postgres. It does not call GitHub at query time for counts, rankings or per-person breakdowns.
One optional exception, off by default: the live drill-down
(mcps.githubLive.enabled), which reads a specific pull request on demand —
never a population. It is bounded on purpose: enumeration stops after three
pages, and one turn may open a limited number of distinct pull requests before
further reads are refused. See Limits.
2. The sync is one background job
A single scheduled job refreshes that copy — by default every 6 hours. It runs one request in flight at a time: no parallelism, no fan-out, no burst. The GitHub and Jira syncs are offset so they never run together.
3. It's incremental
After a one-time initial load (INGEST_BACKFILL_DAYS, default 90), every
subsequent run pulls only what changed since the last run, using GitHub's
updated: search qualifier — normally a small delta of a few pages.
Issues reach back a year, once the engine is ingesting GitHub
ingest.backfillDays sets how far back the pull request walk goes. The
issue walk has a floor of its own: it reaches back at least 365 days,
whatever ingest.backfillDays says. Lowering ingest.backfillDays cannot
shorten it.
On a source the engine has not ingested before. The floor is applied only
where the engine finds no recorded issue horizon. On an install where the
legacy GitHub lane has already run, that lane's horizon is already in the
shared ingest_state row, the engine reads it, and the engine therefore
keeps the depth you already had rather than deepening to a year. ingest.github.rewalkFrom is the lever that recovers it —
see §9 for what a re-sweep costs.
365 days is a floor on the issue walk, not a cap. Set ingest.backfillDays
to 365 or more and the issue lane walks the whole window with the pull-request
lane — at 1095 both reach back three years. The manifest figure decides how
deep the issue lane goes only while it is the deeper of the two.
That is a deliberate answer to a question people ask constantly and could not get: how much of the backlog is still open, year to date. A window of 90 or 180 days does not reach January from August, so the answer came back correctly labelled as covering less than was asked for — honest, and no use. A year covers year-to-date on any date, including 31 December.
It is affordable because the walk skips what it does not need. The two searches
share one calendar-day-at-a-time walk, and a day older than the pull-request
window is walked by the issue search alone, with no pull-request search
over it and no GraphQL enrichment, which is the expensive half of a busy day.
What that costs: the issue search pages per 100 results, so a deep day is one
search request per organisation per 100 issues updated that day — one for a
quiet day, two at the density the sizing measurement saw (14,386 issues over 90
days is about 160 a day), at most ten before the walk subdivides the bucket.
At the default cap of 30 requests per minute that is roughly 9–18 extra
minutes for one organisation on the default 90-day pull-request window (275
extra days at one to two requests each; the measured density sits at the top of
that range), proportionally less on a 180-day one, and nothing at all once
ingest.backfillDays reaches 365 — there are no days the issue search walks
alone then, and the whole walk is already the one the
sizing table covers. It is proportional
to the number of organisations, like the rest of the walk.
Two consequences worth knowing before you plan a first install:
- Lowering
ingest.backfillDaysfor a fast first pass no longer shortens the issue walk. 7 days of pull requests still comes with 365 days of issues, which on its own is roughly 12–24 minutes per organisation at the default cap (358 issue-only days at one to two requests each, by the same arithmetic as above). Raising it past 365 does still lengthen the issue walk, because the manifest figure is a floor and not a cap — atingest.backfillDays: 1095both lanes walk three years, and the issue lane costs a full bucket per day, exactly as the pull-request lane does.
And one asymmetry to know about, because nothing labels it yet: the link
between an issue and the pull request that closes it is collected from the
pull request side, so it exists only for pull requests inside
ingest.backfillDays. Counts, ages and states of older issues are complete;
"is this issue linked to a pull request" is not, for issues whose only pull
request is older than the pull-request window. Raise ingest.backfillDays if
that question matters to you as much as the backlog one does.
4. It's scoped, lightweight, and read-only
Prism reads, and stores, only these:
| Field | Source | Why |
|---|---|---|
| Repo, PR number, state, title | PR object | Grouping, keys, display |
| Author login | PR object | Attribute output to a developer |
| Created / merged / closed timestamps | PR object | "Merged in window", cycle time |
| Additions, deletions, changed files | GraphQL PullRequest | PR size as an effort proxy — counts only, never the diff |
| Reviewer login, review outcome, timestamp | GraphQL PullRequest.reviews | Review load, time to first review — outcome and time only, never the review text |
| Ready-for-review timestamp | GraphQL ReadyForReviewEvent | When the review clock starts on a draft |
| Issue repo + number, state, state reason, timestamps | /search/issues (type:issue) | Bug-backlog questions; open vs. closed, completed vs. dropped |
| Issue author login, assignees | same | Who reported it, who is carrying it |
| Issue title, labels, comment count | same | Display, classification (priority is a label) — the count only, never the comment text |
| Issue type | same | Bug questions across both classification axes — your organisation's own type names (Task, Bug, …), stored verbatim as it wrote them |
| Which issues a PR closes | GraphQL closingIssuesReferences | Tie a fix back to the bug it closed |
| Commit author email + the login GitHub matched it to | GraphQL PullRequest.commits | Join a Jira assignee (known by email) to a GitHub author (known by login) — off unless you list your domains, see below |
What Prism does not read, and does not need:
- Source code, file contents or diffs. It takes the numbers, never the code.
- Review or comment bodies. Outcome and timestamp only.
- Any write. No creating or editing pull requests, comments, statuses or branches.
- Admin, org settings, secrets, Actions, packages or webhooks.
What your GitHub must expose for people to be correlated
Everything above is about pull requests, reviews and issues, and none of it depends on this. This part is about people, and it is a prerequisite rather than a tuning option: no setting on our side substitutes for it.
Every GitHub record Prism stores names a person by their GitHub login and by nothing else — author, reviewer, assignee, issue reporter. No GitHub dataset carries an email address. Jira, by contrast, knows a person by their corporate email address, and Agent Router spend is resolved to a person through your directory. So something has to say that a login and an address are the same person, and there are exactly three places that can come from. An installation needs at least one of them, and on a stock 0.11 install it has route C without doing anything.
| Route | What it needs from you | If it is absent |
|---|---|---|
| A — your directory carries the login | The source you designate as the organizational context stream holds a GitHub login per person, beside their email | Prism cannot invent it. Nothing else it reads knows who a login belongs to |
| B — the commit-author harvest | Developers commit with a corporate address, GitHub matched that address to an account, the address is not a @users.noreply.github.com one, and you have listed the domain in the source's identity_email_domains | No email-to-login evidence is ever collected, so there is nothing to build a crosswalk from later either |
| C — the profile sweep (0.11, on by default) | Your members publish an address on their GitHub profile, and your credential carries Members: Read. Nothing else — it runs on the ingest tick, and needs no identity_email_domains (empty admits every published address; a value you set on the source narrows the sweep to those domains) | The sweep records nothing, and route C contributes nothing. It is the route most installations will actually be resolving through, so this is worth checking rather than assuming |
Route C is the one a stock install has, and route A is the one to plan for — it is the record once you designate a stream, and the only route that resolves somebody who has published no address anywhere. They add up rather than compete.
Route B is not the fallback it looks like. It is off until you name domains, and it reads addresses out of commit metadata rather than out of your own organisation's records. Anything below that describes "what a GitHub instance yields on its own" is now route C's job; route B is a supplement to it, on an install that has deliberately turned it on.
The two ADDRESS routes converge on a requirement that is easy to miss: B and C resolve a person only where the address they find is one your designated directory already holds. A perfect sweep against a directory spelling the domain differently resolves nobody. If your yield is low, compare the domains first — a local-part mismatch is rare and a domain mismatch is not.
Route A is the exception, and it is most of why it is worth planning for: a directory that carries the login states the fact outright, so nothing has to match on an address at all.
What you lose if none of the three holds. Not "some answers get less accurate" — these have no answer at all, and Prism says so rather than producing one:
- anything that puts a person's GitHub work beside their Jira work — pull requests merged against issues closed, review load against story points;
- anything that puts a person's GitHub work beside their Agent Router spend;
- every team-shaped GitHub question — a team is a property of a person in your directory, so with no route from a login to a person there is no route from a login to a team either.
GitHub-only answers are unaffected: counts, rankings, cycle time, review latency and the issue backlog all work, grouped by GitHub login. What you do not get is a person behind that login.
The estate-wide blocker to check for first. GitHub's "Keep my email
address private" setting rewrites every commit that user makes to a
@users.noreply.github.com address. Such an address resolves to a login
perfectly well, which is exactly why Prism drops it: it joins to nothing a
person is known by anywhere else. An organisation where that setting is on by
default harvests zero pairs, and no configuration on our side changes that.
The same applies to a GitHub Enterprise Server instance running the feature,
which issues the equivalent addresses under its own host name.
Find out before you commit to a route. prism-ingest check github measures
route B against your own instance — how many sampled commit authors carry an
address at all, how many of those GitHub resolved to an account, and how many
fall inside the domains you configured — as counts, without recording a single
address. Zero in the first of those and route B is dead on this instance
whatever else you set. See Self test for where the verdict
appears, and the sections below for what each number means.
It does not yet measure route C, which is the one on by default — so there
is no way to predict the sweep's yield before turning it on, and the place to
read what it actually produced is the self test's identity crosswalk line
afterwards. Tracked; until it lands, treat a low github_login:observed count
as the measurement.
Email addresses: nothing is recorded until you say which domains may be
That is route B, and Prism derives it from the commits it already fetches: a git commit carries its author's email address, and GitHub tells us which account it matched that address to. It records none of it by default.
Set the domains on the github context stream itself: Admin → Context
streams → github → Edit parameters… → identity_email_domains. Empty (the
default) records no address. Give it your own domain(s) — acme.com, acme-labs.com; a leading @ is fine — and Prism records an address only when
all of these hold:
- the domain is one you listed. Subdomains are not implied: list
contractor.acme.comseparately if you want it; - GitHub resolved the address to an account. An address it could not place is
a string somebody typed into
git config, and Prism will not guess who it belongs to; - and it is not one of GitHub's own
@users.noreply.github.comaddresses.
The chart value ingest.github.identityEmailDomains is removed. Nothing
reads it, and the chart does not render while it is present, even empty. See the
release notes.
What lands is evidence, not a decision: a table of "this address was seen against this login, this many times". An address seen against two different logins stays two rows — the disagreement is preserved rather than resolved, because nothing here can tell which of the two is the person. Prism records the pairs and acts on none of them by itself: nothing is renamed, nothing is merged, and no record you keep elsewhere is changed.
Measure before you turn it on. How much this yields depends entirely on
your instance: whether your developers commit with their corporate address, and
whether GitHub has that address registered against their account.
prism-ingest check github reports exactly that — how many sampled commit
authors carry an address, how many are in your domains, and how many resolve to
an account — as counts, without recording a single address. The
Self test page shows the verdict.
The ingest engine runs it. The manifest engine reads five commits on each
pull request's enrichment call, applies the rules above and the stream's
identity_email_domains, and records the pairs. Two things to know:
- It does not reach back. Setting the domains changes what the next walk
records, and the walk resumes from its watermark. To harvest the pull requests
already in your mirror, set a re-sweep date at the same time
(
ingest.github.rewalkFrom, see Widen the window later); without one, people are resolved as they open or touch pull requests. - Where its counts are. Each run's log line and the
identity_evidenceblock of thegithubrow iningest_stategive how many pairs were kept and how many were dropped by each rule, as for GitLab.
Erasing one person's evidence, and how long it is kept
To erase someone, for example someone who has left and asked for their data to be deleted, use Erase identity evidence on App users. It works for anyone, including someone who never used Prism. Type their address (or their GitHub login or GitLab username), choose which it is, and Prism shows how many evidence rows name it and which logins or addresses it was seen with. You choose whether those are erased too: a pair can be wrong, for example a commit made under someone else's address, and an erased value is never recorded again for whoever it belongs to. Confirm by typing the value again. Prism then:
- deletes every evidence row that names any of those values, from both the commit harvest and the profile sweep;
- records each value on an exclusion list, so no later walk records them again. That includes a re-walk of the days their commits are on, a resumed backfill, and the profile sweep, which stops looking up an erased login.
The exclusion list holds a salted hash of each value, never the value. Someone reading the list cannot see which addresses are on it. Someone who can read the database and has a guess can still check the guess.
The audit log records the erase as identity_evidence_erased, with counts only.
It does not reach their pull requests, issues, commits and reviews, which are your source systems' data; the organizational stream's row for them; the audit log; log lines; or backups. A row a walk wrote while the erase was running is deleted at the next tick, and the crosswalk never resolves it in the meantime. An erase cannot be undone from the page.
To age the evidence out, set ingest.identityEvidence.retentionDays. The
default, 0, keeps every pair for ever. With a number of days set, each tick
deletes every pair that no walk or sweep has seen for that long. A person whose
pairs are deleted stops resolving until a walk or sweep sees them again: their
older pull requests are then not counted as theirs. Seen again means seen by a
walk, so a re-walk of old days counts. Keep it longer than
ingest.github.profileSweepTtlDays: the sweep sees a member again only when it
next looks them up, and the tick's log says so if it is shorter.
Automation accounts: name them, or name their pattern
GitHub already marks its own bots, and they are left out of every person figure with no setting. What GitHub cannot tell from a colleague is a CI or service account driven by a personal access token: it is a real user account. Name those on Admin → Context streams → Automation accounts, the section under the list of streams, one entry per line.
- An entry is an exact login, or a pattern in which
*matches any run of characters:svc-*covers every login that startssvc-. Every other character is literal. Case does not matter. - An entry that is only
*is refused, because it would make everybody automation. - A pattern covers more than you may expect:
svc*also covers a person whose login issvcmorrison. Prefer a prefix that ends in the separator your naming convention uses (svc-*). Each stream's Automation tab shows what every entry matches on that stream: how many accounts and rows, and the most active few, so you can see a pattern that covers a person. - A list with patterns costs one pass over a stream's stored rows for each person field a question reads. Each server process runs the pass after each run of that stream, and then reuses it. While a stream is ingesting, its questions each take that pass over their own rows instead, as do a stream's questions once its pass has run out of query time. A list with no pattern costs nothing extra. A few prefixes are better than many patterns.
- It is one list for the whole installation: GitHub pull requests, issues and reviews, and GitLab merge requests (How Prism reads GitLab). A stream's tab only shows it.
- A save applies from the next question, to rows already stored as well. A question that names one of these accounts counts it.
- On every other stream that names a person (a service-desk copy's
assignee, Jira's assignee, commit authors, GitLab approvers, GitHub Actions
run actors), the list removes no rows. Accounts on it are counted under one
labelled row,
(automation accounts), in every breakdown of a person field, unless the question names the account, so the rows still add up to the total. A count of distinct people leaves them out, and the answer says how many it left out and which of your entries matched. A display name the stream declares as the name of an account (name_of), such as Jira's assignee name, is grouped on that account, alone or beside it. On a stream with one account column, a display name with noname_ofshown beside that column takes the same label. Any other display name is not grouped, because nothing says which account it belongs to. A directory of people is not changed.
Upgrading from ingest.github.botLogins. The chart value is removed.
Nothing reads it, and the chart does not render while it is present, even
empty. See the
release notes.
5. What the token needs
A fine-grained token, or a GitHub App, is strongly preferred — see the warning under "classic" below. The permission list is the same for both; what differs is how the credential is configured and whose visibility decides its scope. A fine-grained token scoped to All repositories covers an organisation of any size; an App is preferable at any size because the grant is the scope rather than a person's visibility, and because it carries no user seat and higher rate limits — see Widen a source's scope, which is where the App's three values go and why it is not a token you paste.
Changing this credential's reach does not change the history already mirrored. Re-scoping a token from a hand-picked list to All repositories, or swapping a token for an App installed across the organisation, takes effect from the next sweep onward. Every day already walked keeps the scope it was walked under, no ordinary run revisits it, and nothing turns red — the two verdicts that mark an incomplete day,
capped_daysandunenriched_days, both describe rows the walk knew it missed, and these are rows it never knew existed. Recovering the history is a one-offingest.github.rewalkFrom, and the procedure is Widen a source's scope.
Fine-grained PAT, or a GitHub App installed on the org
-
Repository access: the in-scope repositories, or org-wide.
-
Repository permissions:
- Metadata: Read — mandatory baseline.
- Pull requests: Read — the core permission. Covers the PR list, review outcomes, and additions/deletions/changed-files.
- Issues: Read — required since Prism began answering bug-backlog questions. Without it the pull-request half still works and the issue half ingests nothing.
- Contents: Read — required for commits (§10): GitHub groups commit search under it, and without it private repositories' commits come back empty with no error. Prism never reads file contents. (The live drill-down needs it too — see below.)
-
Organization permissions: Members: Read — required since 0.11.0, and the only org-scoped grant Prism asks for.
ONE call needs it: the identity sweep's
GET /orgs/<org>/members, which lists the logins whose public profile address is then read one at a time (ingest.github.profileEmailSweep, on by default).The other org-scoped call,
GET /orgs/<org>, is a reachability pre-flight and a fine-grained token can still make it with no organization permission at all — that was measured, and this page said so before the sweep existed. It is spelt out again here because an earlier draft of this section quietly folded the pre-flight in with the sweep, which would have had a reader believe the grant was needed for more than it is.Without it the ingest still works and the answers get worse in a way that is hard to see. Pull requests, reviews and issues all mirror normally; what fails is the join from a GitHub login to a person, so any question scoped to a team, a manager's organisation or a named individual resolves to nobody. The sweep reports the refusal in the ingest tick's log and nowhere else.
Set
ingest.github.profileEmailSweep: falseif you would rather not grant it. That is a supported configuration — it trades per-person attribution for one less permission — and turning it off is louder than being refused, because the tick then says on every run that no login will be resolved.
If the optional live drill-down MCP is on (mcps.githubLive.enabled), by
default this same token serves it — the ingest and the live MCP both read secret
key github-token, and compose gives both GITHUB_TOKEN. It opens one named pull
request on request and can return that PR's diff, changed files, comments and CI
checks, so add three grants to the list above, all Read: Contents,
Checks, Commit statuses. The last two are what the CI-checks view
needs — they are separate GitHub permissions, and without them that view fails
with Resource not accessible by personal access token while everything else
works. Trimming the list the other way — to what the live MCP alone needs — is
what drops Issues: Read and empties the issue half. To keep this token to
the list above, give the live MCP a token of its own with
secrets.githubLiveToken
(What the GitHub credential needs says how).
Classic PAT
read:org plus repo read — read:org covers both the org-scoped search and,
since 0.11.0, the member listing the identity sweep needs. On a classic token
that one scope carries both, so there is nothing extra to add. On private repositories,
"repo read" is the broad
repo scope, which also grants WRITE. There is no read-only classic scope for
private repos. If your security review requires a genuinely read-only
credential — and for most organisations it does — use a fine-grained token or a
GitHub App instead.
Two things that are easy to miss
- If the org enforces SAML SSO, the token must be SSO-authorized for that org, or it will authenticate and then see nothing.
- A fine-grained token returns no
x-oauth-scopesheader at all, so an empty header is not evidence of a problem. Verify a credential by hand has commands that test what the credential can actually reach, which is the check that matters.
6. Where it connects
| Deployment | REST | GraphQL |
|---|---|---|
| github.com / Enterprise Cloud | https://api.github.com | https://api.github.com/graphql |
| Enterprise Server (self-hosted) | https://<your-host>/api/v3 | https://<your-host>/api/graphql |
Prism polls on a schedule; no inbound webhook is required. It needs egress to that endpoint from where it runs — see Egress.
GraphQL is a separate hop, and an Enterprise Server can serve REST while
blocking it. If that happens you get pull requests with no size or review data
rather than an outright failure, so it is worth testing both. The run names the
days it could not enrich, in unenriched_days — see
Verify a credential by hand. On such a day the ingest
engine in its default mode also records the size columns as withheld, so an
answer over lines changed says how many of its pull requests have no recorded
size.
7. There's a hard rate cap
ingest.github.maxRequestsPerMinute sets a fixed ceiling on calls to
GitHub. Because the sync is already serial, this is a true requests-per-minute
limit — no burst can exceed it, and retries and back-offs are counted against
it too, so a job being throttled upstream cannot speed up.
# values.yaml
ingest:
github:
maxRequestsPerMinute: 30 # the shipped default; 0 disables the cap
The default of 30/min sits at GitHub's tightest documented budget for the search endpoint the walk uses. Set it lower if your platform team asks you to — it costs the first backfill time, not data. Limits has the detail.
8. What happens when a backfill is interrupted
Relevant if you have set a low rate cap, because a slow backfill is a long one.
Progress is kept. The job records how far it got after each completed day of history, and a later run picks up from there — it does not start again and it does not re-truncate what it already fetched. A pod killed mid-run, an evicted node, or a run that hits its deadline all resume from the last completed day.
One org that does not answer does not stop the others. An org fails when
every retry of one of its requests fails, or when GitHub answers 404 for it.
That org is dropped for the rest of the run, and the other orgs walk every day.
The run completes as partial, and failed_partitions in the source's
ingest_state names the org. Each org records the last day it walked to the
end. The next run starts that org there, unless a re-sweep or a change to the
source resets the progress. Commits start seven days before that day, because
a commit can arrive days after its date. An org records a day only after all
three searches have started. On a first backfill, issues start earlier than
pull requests and commits, so those earlier issue days are walked again on
every run until one run gets past them. The source records no watermark until
every org finishes in one run. If every org fails, the run fails.
Two consequences worth planning for:
- The first live run empties the table before it refills it, so that a deployment moving off seeded demo data does not serve a mix of the two. Until the backfill completes, Prism answers from a partial mirror and says so — coverage and staleness are reported with the answer.
- Do not change
ingest.github.orgswhile the first backfill is running. Progress is only trusted for the orgs that produced it, so adding one correctly discards it — and starts the backfill over, truncation included.
If you want an interrupted backfill to resume sooner, shorten the schedule.
Do not shorten ingest.runDeadlineSeconds. A resumed run re-walks the last
day it completed before moving on — deliberately, because a day finished at
14:00 does not yet hold what was updated later that day — so each run needs long
enough for two busy days of history, not one. Below that the job restarts
for ever and the backfill never finishes.
The shipped default (24 hours) has hours of headroom at any sane rate cap, so this is a warning about lowering it rather than a reason to raise it. If a backfill is not completing, the tell is that the day it resumes from stops changing between runs — the row count and the logs otherwise look like ordinary interruptions.
9. Issue types, and the one upgrade that needs a re-sweep
From this release the issue mirror also holds GitHub's issue type — the
org-level classification (Task, Bug, Feature, or whatever your org
configured) that sits beside labels rather than among them.
It matters because a question about bugs means both axes at once. An
organisation that turned issue types on typically stopped applying the bug
label, and one that never turned them on still uses it, so where an
organisation uses both, counting either axis alone undercounts the backlog —
on the repository this was found in, the labelled issues were a minority of the
union. Where an organisation never enabled types, the label axis alone is the
whole backlog and nothing is missing; gh api orgs/<org>/issue-types tells you
which case you are in, and is worth running before you act on any of this. Prism answers a bug question as
the union of the two and reports which axis found each issue, so an answer
reads "N open bugs: X typed, Y labelled, Z both" rather than a bare number.
Answering across both axes is the semantic query MCP's. The union, and the "which axis found it" breakdown, are served only by that component, which every install has. The re-sweep below fills the column durably — it is stored, not computed at question time.
This one field is not recoverable from what is already stored. Every issue already in the mirror carries an empty type until the lane fetches it again, and an empty type is indistinguishable from a repository that has none — so until the re-sweep below has been all the way round, the typed half of a bug figure is missing or short. Nothing in the answer says so: a bug figure taken part way through the sweep reads exactly like a complete one, so treat the typed half as partial until you know the sweep has finished.
To fill it in, re-walk the issue history once with the standard re-sweep lever (Widen the window later has the full procedure):
# values.yaml
ingest:
github:
rewalkFrom: "2026-03-01" # a date at or before the issue horizon
Two things to get right:
-
Know what your date buys. A date at the mirror's issue horizon re-fetches everything already mirrored and fills in its types — the complete type re-sweep. A date earlier than the horizon does more, not nothing: it widens the mirror itself, pulling in issues last touched back then that the mirror never held at all, at the same per-day request cost — that is the Widen the window later procedure, and it is a coverage decision, not part of the type refresh. The issue horizon is recorded separately from the pull-request horizon that Admin → Self test and Admin → Context streams report.
GET /api/admin/sourcesgives it as thehorizonof thegithub_issuesstream in the source'sfirst_backfill(Read it from the API), or read it from the mirror directly:kubectl exec -n <namespace> statefulset/<release>-postgres -- \psql -U postgres -d prism -c \"SELECT detail->>'issue_backfill_horizon' FROM ingest_state WHERE source = 'github';" -
A re-sweep costs what the original backfill cost, so give it the same room: check
ingest.github.maxRequestsPerMinuteandingest.runDeadlineSecondsbefore you start, and expect it to take hours at a low cap. Nothing is truncated and no coverage already earned is given up.
The value is carried out once per date — the run that performs the re-sweep records the date, so leaving it in your values file does not re-walk the same months at every firing of the schedule.
If you would rather not spend the requests, nothing breaks — but the figures
do not stand still either. The label axis is the floor, not a resting state:
every ordinary scheduled run writes the type on each issue it touches, so the
typed half fills in gradually as issues see activity, so an un-re-swept bug
figure may drift upward over the following weeks for a bookkeeping reason as
well as a real one — and the delta on its own does not say which. If the
organisation does not use types there is no drift from this cause at all. The answer will not tell you any of this — it
carries no warning about an empty or part-filled type column, so the figure
reads as complete whatever state the column is in. That makes two things yours
to hold, not Prism's: knowing whether this re-sweep has run, and never taking a
typed count of zero as a finding about the repositories — an organisation that
never enabled issue types, one that has them on but leaves bugs to the label,
one whose bug type is named something else (type names are org-defined free
text, and this axis matches the literal bug, so a Defect or Incident type
reads as zero with a fully populated column), and a column the sweep has not
reached yet all produce the same zero, and the column cannot tell you which you
are looking at. gh api orgs/<org>/issue-types is what tells you.
10. Commits (new in this release)
Prism now reads commits from GitHub, as well as pull requests and issues. A commit is one saved change to code. Prism reads the commits on each repository's main branch. GitHub calls it the default branch.
This answers questions like "who is writing code?", including people whose work does not show up as pull requests.
You do not have to do anything
Commits are part of the GitHub source you already have. You do not add, paste or click anything.
When you upgrade, three things happen on their own:
- Prism updates its saved copy of your GitHub source. This happens when Prism starts. Your settings, your token, the name you gave the source, and whether it is switched on all stay the same.
- Admin → Context streams now lists GitHub commits under your GitHub source.
- The next GitHub read fetches the commits from before the upgrade. By
default that is 90 days back from the day you upgrade (the
ingest.backfillDayssetting). After that, each read fetches new commits, and looks back a week for late ones.
The first read takes longer than usual, and slows other GitHub data while it runs. Prism reads the older commits first. Until that read finishes, new pull requests and issues wait their turn, so on the first day their answers can be a few hours out of date. Answers about commits say they are incomplete until the first read is done.
It counts as one more context stream
A context stream is one kind of data Prism answers questions about. Your licence covers a number of them. After the upgrade, GitHub commits counts as one more. You cannot switch it off on its own in this release.
If your licence covered exactly the streams you had before, the count on Admin → Context streams will show you are one over. Ask Tetrate to raise your entitlement. Prism keeps working while it shows over.
What the token needs
Commits need one more permission on your GitHub token.
- If you use a fine-grained token or a GitHub App: ask the person who looks after GitHub to add Contents: Read on the same repositories. You do not need to type the token into Prism again.
- If you use a classic token: you do not need to change anything.
Without Contents: Read, GitHub sends no commits from private repositories, and it does not say why. Prism never reads your files. GitHub just puts commit search under that permission.
Check that it worked
-
Open Prism.
-
Click Admin, then Context streams.
-
Find your GitHub source. It should list GitHub commits.
-
Wait for the next GitHub read to finish. It can take a few hours the first time.
-
Ask Prism this question, exactly as written:
How many commits landed on default branches in the last 30 days, how many did not resolve to a GitHub account, and how many different accounts committed?
It worked if you get three numbers.
To be sure, pick one busy repository. On GitHub, count the commits on its main branch for one day. Prism's number for that repository and day should match.
If the total is zero for a time when people were working, the token probably lacks Contents: Read. See above.
If GitHub commits does not appear on the admin page
Prism only updates its saved copy when that copy is one Prism itself made. If someone changed your GitHub source's definition by hand, Prism leaves it alone.
You can tell, because the self test shows a warning on its recipe drift line that names your GitHub source. Questions about commits still work: Prism answers them from its current definition either way. Only the admin page and the count of context streams are out of date.
To fix the admin page, follow the self test's warning. It tells you whether deleting the source brings it back by itself, or whether you will need to add it again. Either way, a token stored on that source is deleted with it, so have it ready.
What a commit count can and cannot say about a person
A commit records an email address, not a GitHub account. GitHub links a commit to an account only when that email belongs to one. Commits GitHub could not link are kept and counted as unresolved commits. They belong to somebody, but not to anyone Prism can name.
So when you ask who made no commits, Prism does not name anyone. It tells you how many commits in the period were unresolved, and that the person's commits may be among them.
If you ask about one person directly ("how many commits did Sam make last week?"), Prism can answer 0. Treat that 0 as "none that Prism could link to Sam", not as "Sam made none". If that number is large, ask your GitHub users to add their work email to their GitHub account (Settings → Emails). Their commits from then on will be linked.
Other limits:
- Only the main branch is read. Work on a branch that has not been merged is not counted.
- A pull request merged with Squash and merge counts as one commit.
- Prism looks back seven days on every read. A commit that reaches the main branch more than seven days after it was made is missed. That happens with a pull request merged with Create a merge commit after being open for more than a week. So a person's count is a minimum.
- A pull request merged with Create a merge commit also adds one more commit, made by whoever clicked Merge. That person is counted for it.
- Commits in forks of your repositories are not included.
- Bot accounts are left out.
- Only the source named
githubgets commits. A second GitHub source you added under another name does not. - Ask about unresolved commits without naming a person or team. Once a question is about a person or team, Prism cannot see the unresolved commits at all, so it cannot tell you how many there are.
How to undo it
You cannot switch off commits on their own. They are part of the GitHub source. Your choices are:
- Leave them. Pull request and issue answers are the same as before, once the first read has finished.
- Go back to the previous release. The previous release does not read or answer about commits. Its admin page will show your GitHub source as needs setup and manifest invalid, because the saved copy was already updated to this release's definition. Pull request and issue answers keep working. The admin page is correct again when you upgrade. If you upgrade again later, commits made more than a week before that upgrade, while you were on the older release, are not fetched.
Do not take Contents: Read off the token as a way to switch commits off. Prism would keep counting, but private repositories would show no new commits, so the numbers would look like people stopped working.
For your technical team: commits are read by the ingest engine
(components/source-manifest/manifests/github.yaml, stream commits). They
are collected on every install, since GitHub runs on the engine.
11. Review history, and the re-sweep that reads it again
Prism now records, for each pull request, when it last read all of that pull request's reviews. An answer about reviews uses this record. Beside each count of unreviewed pull requests, the answer says how many of them Prism has not read in full. For those, nobody knows whether they were reviewed, and the answer says so. While a floor on counts is on, Prism does not list the rows behind that second count.
After the upgrade, no pull request already in the mirror has this record. Prism wrote them before it kept one. So an answer about an older window says that Prism has not read the reviews of those pull requests in full. It stays that way until Prism reads their reviews again.
A scheduled run does not go back for them. Each run reads only the pull requests that GitHub shows as updated since the last run. An old pull request that nobody touches is never read again by a scheduled run.
To read them all again, run one re-sweep (Widen the window later has the full procedure):
-
Find the date to sweep from. It is the oldest creation date among the pull requests whose reviews Prism has not read in full:
kubectl exec -n <namespace> statefulset/<release>-postgres -- \psql -U postgres -d prism -c \"SELECT min(created_at)::date, count(*) FROM pull_requests WHERE reviews_read_at IS NULL;" -
Set
ingest.github.rewalkFromto that date and runhelm upgrade. Copy now on the stream starts the re-sweep at once. -
When the re-sweep has finished, run the query again. The count falls to the pull requests Prism still cannot read in full.
Prism reads the first 50 reviews of a pull request with the rest of the pull request. When GitHub reports more than 50, Prism reads all of them again in a second step. The pull request counts as read in full only when that second step returns at least as many reviews as GitHub reported. If the second step stops early, or the run skips it, the pull request stays unread. If GitHub reports no total, the pull request also stays unread. The second step costs one more request for each 100 reviews.
What the re-sweep costs. Prism reads reviews 100 pull requests at a time,
in one GraphQL call. GitHub reports the cost of that call as 4 points, and a
token gets 5,000 points an hour. So 40,000 pull requests cost at least 400
calls and 1,600 points. Each call follows one search, and GitHub allows 30
searches a minute, so those 400 calls take at least 14 minutes. A day of
history with fewer than 100 pull requests still costs one call and one search,
so a re-sweep over 500 days costs at least 500 of each. The re-sweep also
re-reads the issues and the other pull request fields over the same days, and
ingest.github.maxRequestsPerMinute counts every request. Section 9
has what else to check before you start.
If you do not re-sweep, nothing breaks. Answers about older windows keep saying that Prism has not read the reviews of those pull requests in full. As pull requests see new activity, scheduled runs read them, and the count falls.
What that means in practice
- Steady state: each run fetches only what changed — a handful of requests.
- Initial backfill: one org over 90 days is on the order of a thousand requests; at the default cap, tens of minutes. At a low cap, plan in hours, and see §8.
- Peak concurrency against GitHub: one request. Not one per user, not one per page in parallel — one, full stop.
You hold the levers: the org scope (ingest.github.orgs), the backfill window
(ingest.backfillDays), the schedule, and the hard cap
(maxRequestsPerMinute). If you want it gentler, turn any of them down.