Repository navigation
Description
Update 2026-11-26 (infra move): the Grafana values are now in dan-petty/homelab.
The Infinity datasource, its allowedHosts and its token are configured there (homelab follow-up of #4597). This item keeps the insights route and the Project brain row of the product dashboard in k8s/devops/dashboards/. The table works only after the datasource exists.
Problem
The project brain plan of 2026-11-11 (#4624) added three parts for the project insights:
- the insights route of the read-only API (scope comment on feat(service): serve a read-only roadmap API with OpenAPI #4586)
- a "Project brain" row in the roadmap-pipeline dashboard (feat(monitoring): a project brain dashboard and alerts #4699, after feat(roadmap): a dashboard and alerts for the pipeline #3655)
- the table "Project insights" in that row, through the Infinity datasource (scope comment on feat(monitoring): read the Service API with the Infinity datasource #4597)
The designs of #4586 and #4699 do not deliver these parts now, and #4597 leaves its table to this item. So no other item delivers them. The Service dashboard cannot show a list of insights from Prometheus, because #3851 does not permit an id label.
Scope
- Route
GET /api/v1/roadmap/repos/{owner}/{name}/insights?limit=20in the read-only API of feat(service): serve a read-only roadmap API with OpenAPI #4586: aValkeyReaderoverroadmap:v1:brain-insights:<owner>/<name>and the insight hashes. No insight hash exists yet: feat(roadmap): keep alternatives results in a brain index #4676 (feat(roadmap): keep alternatives results in a brain index #7320) wrote the kindsbrain-item,brain-tool,brain-ref,brain-eventsandbrain-synconly. The insights and the keybrain-insightscome with feat(roadmap): run brain repair, consolidate and evaluate daily #4687 and feat(roadmap): the brain files project insights through intake #4693.- Fields: id, title, kind, score, state, member count, issue link,
as_ofand links. No body text (docs(service): decide the roadmap Service read API #4581). - 503 when
valkey-roadmapis down. A cursor, and alimitof at most 50.
- Fields: id, title, kind, score, state, member count, issue link,
- A collapsed row "Project brain" in
k8s/devops/dashboards/roadmap-pipeline.jsonof feat(roadmap): a dashboard and alerts for the pipeline #3655. The row has Prometheus stats, a Loki audit panel, and a link to dashboarddevops-project-brainthat keepsrepo. - A table "Project insights" in that row. It reads the insights route through the Infinity datasource of feat(monitoring): read the Service API with the Infinity datasource #4597.
allowedHostsholds the in-cluster Service URL only. The read token is thegrafanakey ofservice.api.tokens(feat(service): serve a read-only roadmap API with OpenAPI #4586).
Acceptance criteria
- Test first: a test with a fakeredis brain gets 20 insights in score order, with
as_ofand no body text. The test fails on the base. - A test gets 503 while Valkey is down.
- The OpenAPI document lists the route.
- Live check after the release: the table shows the insights of the repository that
reposelects. While the API is down, the table shows no data, and no other panel fails.
Dependencies
- feat(roadmap): keep alternatives results in a brain index #4676
- feat(roadmap): the brain files project insights through intake #4693 (it writes the insights that the route reads; feat(roadmap): keep alternatives results in a brain index #4676 holds none)
- feat(service): serve a read-only roadmap API with OpenAPI #4586
- feat(monitoring): read the Service API with the Infinity datasource #4597
- feat(roadmap): a dashboard and alerts for the pipeline #3655
Source
Source: #4624
Alternatives check of 2026-12-01: in-use.
The item already names this tool.
Tool: Infinity datasource (https://github.com/grafana/grafana-infinity-datasource), Apache-2.0, last activity 2026-12-01, maintained.
Reason: The Infinity datasource covers only the table panel that reads the insights route; the route over Valkey with its score order, limit cap, cursor and 503, and the dashboard row, stay project code.
Covers:
- Reads a JSON HTTP route into a table panel
- Sends the configured reader token to the route
- Restricts reachable hosts through allowedHosts
- Needs no custom plugin code to build
Lacks:
- The insights route over ValkeyReader
- Score order, limit cap of 50 and cursor paging
- The collapsed Project brain row with Prometheus and Loki panels
- The insight field schema and the no-body-text rule
Proposed design
Problem statement
The read-only API of #4586 has no insights route, so no reader can list the project insights of a repository. The roadmap-pipeline dashboard of #3655 has neither a Project brain row nor a Project insights table, and #3851 stops a Prometheus panel from listing insights because it permits no id label. No other item delivers these three parts. This item adds the route, the row and the table in one pull request. #4693 writes the insights and the key roadmap:v1:brain-insights:<owner>/<name> that the route reads, and the table shows data once the Infinity datasource exists in dan-petty/homelab.
Acceptance criteria
Requirement: insights-route-list
The read-only API SHALL serve GET /api/v1/roadmap/repos/{owner}/{name}/insights from the insight hashes of the repository.
Scenario: Twenty insights in score order
- WHEN A test seeds a fakeredis brain with 20 insight hashes under
roadmap:v1:brain-insights:<owner>/<name>and requests the route withlimit=20. - THEN The answer holds
as_ofandlinksand 20 insights in descending score, each with id, title, kind, score, state, member count and issue link, and no body text.
Requirement: insights-route-limit-cap
The insights route SHALL return at most 50 insights for one request.
Scenario: A limit above the cap
- WHEN A test requests the route with
limit=100over 60 insight hashes. - THEN The answer holds 50 insights and a
links.nextcursor.
Requirement: insights-route-cursor
The insights route SHALL return a cursor that reads the next page.
Scenario: The second page
- WHEN A test reads the first page with
limit=20and then requests the route with thecursorvalue fromlinks.next. - THEN The second answer holds the next 20 insights in score order and no insight of the first page.
Requirement: insights-route-valkey-down
The insights route SHALL answer 503 when the connection to valkey-roadmap fails.
Scenario: Valkey is down
- WHEN A test makes the Valkey reader raise a connection error.
- THEN The route answers 503 and returns no insight.
Requirement: insights-route-openapi
The OpenAPI document of the read-only API SHALL list the insights route.
Scenario: The OpenAPI document
- WHEN A test builds the API application and reads its OpenAPI document.
- THEN The document holds the path
/api/v1/roadmap/repos/{owner}/{name}/insightswith thelimitandcursorparameters.
Requirement: dashboard-project-brain-row
The roadmap-pipeline dashboard SHALL hold a collapsed row named Project brain with a Prometheus stats panel, a Loki audit panel and a link to the devops-project-brain dashboard that keeps the repo variable.
Scenario: The dashboard passes the dashboard lint
- WHEN A person runs
uv run devops grafana dashboards lint k8s/devops/dashboards/roadmap-pipeline.jsonon the branch that changes the file. - THEN The command reports 0 errors.
Requirement: dashboard-insights-table
The Project insights table SHALL read the insights route through the Infinity datasource with the in-cluster Service URL and the repo variable in the path.
Scenario: The dashboard passes the dashboard lint
- WHEN A person runs
uv run devops grafana dashboards lint k8s/devops/dashboards/roadmap-pipeline.jsonon the branch that changes the file. - THEN The command reports 0 errors.
Requirement: Pending a person after the merge
The row and the table SHALL show the insights of the repository that repo selects on the cluster after the release.
Scenario: The live dashboard after the release
- WHEN A person opens the roadmap-pipeline dashboard after the release with
reposet for a repository that has insights, and then stops the read-only API. - THEN The
Project brainrow is collapsed, its stats and audit panels show their data, the table lists the insights in score order, the link opensdevops-project-brainwith the samerepovalue, and while the API is down the table shows no data and no other panel fails.
Existing Tool Considered
The Grafana Infinity datasource (grafana/grafana-infinity-datasource, Apache-2.0, maintained, last activity 2026-11-24) covers the Project insights table: it reads a JSON HTTP route into a table panel, sends a token, limits the reachable hosts, and needs no plugin code to build. The alternatives block of 2026-11-24 gives the verdict partly and lists what the tool lacks; this item builds those parts. The insights route is project code over the Valkey reader of #4586: about 120 lines of handler, response model and tests, with a written cost of about 25,000 tokens and 3 hours to build, keep and fix. The row, its Prometheus stats panel and its Loki audit panel are dashboard JSON of this repository.
Key questions
- Which envelope does the insights answer use?: The answer uses the envelope of ADR 0029:
as_of,linksand oneinsightslist. (best practice) [sources: docs/adr/0029-the-roadmap-service-serves-a-read-only-api.md:50]- Chosen: The ADR 0029 envelope. ADR 0029 line 50 requires
as_of,linksand one list or object field on each answer. - Rejected: A bare list of insights. ADR 0029 line 50 states that no route returns a bare list.
- Chosen: The ADR 0029 envelope. ADR 0029 line 50 requires
- How does the insights route order, cap and page its results?: The route reads the insights in descending
score, withidas the tie-break. It returns 20 by default and clamps a largerlimitto 50. It pages with an opaque cursor of the last(score, id)pair inlinks.next, and the next page starts after that pair. (best practice) [sources: docs/adr/0029-the-roadmap-service-serves-a-read-only-api.md:50]- Chosen: Cursor on score and id. The order is total when scores tie, and the page stays stable while insights change.
- Rejected: Offset paging. A new insight shifts every later page, so the table shows an insight twice or misses one.
- Rejected: Reject a limit above 50 with 422. A read-only dashboard must not fail on its own parameter, and the cap is enough.
- How does the insights route report that
valkey-roadmapis down?: The route answers 503 with no insight. It sends noRetry-After, because it cannot estimate a recovery time. CL4 names each dependency and its failure behavior, DEP-1 asks for a test of that behavior, and ADR 0029's health route already reports the Valkey connection. (best practice) [sources: docs/adr/0029-the-roadmap-service-serves-a-read-only-api.md:34, docs/SERVICE_PATTERNS.md:99, docs/guidelines/production-readiness.md:172]- Chosen: 503. The route cannot serve, and the client can retry after the dependency returns; MDN defines 503 as a temporary unavailability of a server.
- Rejected: An empty list with 200. It hides the outage from the reader.
- Rejected: 500. The fault is a dependency of the route, not a defect of the route.
- How does the
Project insightstable read the insights route?: Through a Grafana Infinity panel that requests the in-cluster Service URL of the insights route withlimit=20and therepovalue in the path. The datasource, itsallowedHostsand its token are configured in dan-petty/homelab (the homelab follow-up of feat(monitoring): read the Service API with the Infinity datasource #4597), so this item writes only the panel and sets no host list. (best practice) [sources: docs/adr/0029-the-roadmap-service-serves-a-read-only-api.md:62, k8s/devops/dashboards/kustomization.yaml:2, k8s/devops/dashboards/kustomization.yaml:4]- Chosen: The Infinity datasource. ADR 0029 names Grafana's Infinity data source as a reader, the alternatives block records the tool as
partly, and it reads a JSON route into a table with no plugin code. - Rejected: A Prometheus panel. test(roadmap): compare each dashboard panel value with roadmap explain #3851 does not permit an
idlabel, so a metric cannot name an insight. - Rejected: A custom Grafana plugin. It adds a plugin to build, ship and keep for one table.
- Chosen: The Infinity datasource. ADR 0029 names Grafana's Infinity data source as a reader, the alternatives block records the tool as
- Which token does the
Project insightstable use?: Thegrafanareader token of ADR 0029 section 7, which feat(service): serve a read-only roadmap API with OpenAPI #4586 holds underservice.api.tokens. The settings module'sGrafanaConfigholds only the Grafana URL, so this item mints no new secret; the datasource in dan-petty/homelab holds the token value. (best practice) [sources: docs/adr/0029-the-roadmap-service-serves-a-read-only-api.md:66, docs/guidelines/production-readiness.md:132, src/devops_cli/config/settings.py:400]- Chosen: The existing
grafanatoken. One token rotates in one place, ADR 0029 already namesgrafanaas a reader, and ACC-10 asks a datasource that anonymous viewers read to use a read-only token. - Rejected: A new token for the table. It adds a second secret to mint, store and rotate.
- Chosen: The existing
- Which dashboard does the
Project brainrow link to?: It links todevops-project-brain, the dashboard of feat(monitoring): a project brain dashboard and alerts #4699, which becomes a dependency. The link follows the product dashboards' own pattern: the target/d/devops-project-brainwithincludeVarstrue, which carries therepovalue to the other dashboard. (best practice) [sources: k8s/devops/dashboards/devops-cli.json:13, k8s/devops/dashboards/devops-cli.json:20]- Chosen: Link to
devops-project-brainof feat(monitoring): a project brain dashboard and alerts #4699. The body names that dashboard, the product dashboards link by uid withincludeVars, and feat(monitoring): a project brain dashboard and alerts #4699 becomes a dependency of this item. - Rejected: Link to a new dashboard. It adds a second dashboard to build and keep, and feat(monitoring): a project brain dashboard and alerts #4699 already creates the brain dashboard.
- Rejected: No link. The row then gives no way to reach the brain.
- Chosen: Link to
- Does this item configure the Infinity datasource and its token?: No. The Grafana values are in dan-petty/homelab, which the dashboard kustomization names as the environment tree that applies these dashboards, and this repository holds no
k8s/monitoringvalues folder. The panel that names the datasource and the route is the only part here. [sources: k8s/devops/dashboards/kustomization.yaml:4, src/devops_cli/config/settings.py:400] - Does this item amend the route table of ADR 0029?: No. ADR 0029 is an accepted record and its body does not change: an agent never edits the body of an accepted record. The issue records the new route, as the contributing guide asks a design decision to be recorded in the issue or in an ADR. (best practice) [sources: docs/adr/README.md:50, CONTRIBUTING.md:26, docs/adr/0029-the-roadmap-service-serves-a-read-only-api.md:30]
- Chosen: Record the route in the issue. The body of an accepted record does not change, and the contributing guide accepts the issue as the record of a decision.
- Rejected: Add the route to the ADR 0029 route table. The body hash of an accepted record is checked again, so an edit of the body fails the ADR check.
- Do the insight hashes that the route reads exist today?: No. The brain index writes the kinds
brain-item,brain-tool,brain-ref,brain-eventsandbrain-synconly, so the insights and the keybrain-insightscome with feat(roadmap): the brain files project insights through intake #4693. [sources: src/devops_cli/roadmap/brain_index.py:56]
Fit
Fits in one pull request.
Suspected block
The Infinity datasource, its allowedHosts and its grafana token in dan-petty/homelab (the homelab follow-up of #4597); the Project insights table shows no data until that repository applies them.
Activity
dan-petty commentedon Nov 21, 2026
Both items use the Infinity datasource, but 4597 adds the datasource and the candidate adds the insights route and table.devops-cli-service commentedon Nov 22, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 24, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (7)
Tools considered:
Searches run:
Sources:
dan-petty commentedon Nov 27, 2026
Design check, 2026-11-26
Body, 2 corrections
brain-item,brain-tool,brain-ref,brain-eventsandbrain-synconly (src/devops_cli/roadmap/brain_index.py:56-60).brain-insights.Refine block
k8s/monitoring/grafana-values.yaml:124. This repository does not hold that file..github/renovate.json:22. That line is the rule of the Python version.Place: the route and the dashboard row stay here. The Infinity datasource is in dan-petty/homelab, as the update says.
Dependencies: #4676 is closed. #4693, #4586, #4597 and #3655 are open.
src/has noapi/v1/roadmappath yet.Open question: the row links to the dashboard of #4699 (open).
devops-cli-service commentedon Nov 27, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Dec 1, 2026
The result in the alternatives block of the issue body changed. Before this check:
partly, tool https://github.com/grafana/grafana-infinity-datasource. A person decides what the new result means for the item.Searches (7)
Tools considered:
Searches run:
Sources: