Repository navigation
Fixes #35965: Ingest PowerBI report pages as charts of their report - #35970
Conversation
PowerBI dashboards carried their tiles as charts, but reports had none.
Each page of a report now becomes a chart under its PowerBIReport
dashboard, named `{report_id}_{page.name}`: page names such as
`ReportSection` repeat across reports, so the report id keeps chart
FQNs unique within the service.
The Get Pages In Group response is fetched once per report and memoised
in WorkspaceState for the workspace, so the chart stage and the report
url share one call. `_get_report_url` becomes a pure builder that takes
the page to open on, and tiles and pages share one chart helper.
`fetch_report_pages` now always returns a list (a null page list used
to come back as None) and logs at debug when the API returns no pages.
A failed Get Pages In Group read answered the same empty list as a report without pages, so a transient error soft-deleted the report's page charts under markDeletedCharts and emptied its chart list, only for the next good run to restore them. fetch_report_pages now answers None when the read fails and [] only for a response with no pages. WorkspaceState memoises a failed read as well, and for such a report the chart stage keeps the charts the server already lists under it in the run's live set and in the report. Also records the page-chart naming in a decision record, adds tests for the chart error path (on main an untitled tile that failed raised from the error handler and aborted the chart stage), and drops a filter in _get_chart_fqns that could never remove a chart.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
When a report's pages could not be read and the server could not list its stored charts either, the report was still sent with no charts and its charts were left out of the run's live set, so the run emptied the report and markDeletedCharts soft-deleted the charts; with pages that fail every run, later runs then found nothing left to keep. Such a report's charts are now unknown: the report is registered but not sent, so the server keeps its chart links, and the stale-chart pass is skipped for the run, since a failed discovery must not drive deletion. The failure is still reported for the report.
The double-failure test dropped the dashboards it ingested, so turning the unknown-report `continue` into a `return` passed every test while leaving every later report in the workspace unsent and unregistered.
Code Review ✅ Approved🟡 Medium risk · Ingesting PowerBI report pages as charts changes report metadata; mistaken page results could create incorrect charts or soft-delete existing ones. Ingests each Power BI report page as a chart under its parent report, named by report ID and page name, with URLs that open the specific page. No open issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Fixes #35965
PowerBI dashboards carried their tiles as charts, but reports (
dashboardType: Report) had none. Each page of a report is now ingested as a chart under its report, and the report URL is built from the same pages response, so ingestion makes no extra API call.Type of change:
Manual Testing
Before change
After change
High-level design:
_get_report_pagesfetches them on first use and memoises the response inWorkspaceState, which releases it when the workspace exits (the scope-limited cache the connector memory standard allows, likecache_dataflow_export)._get_report_urlbecomes a pure builder that takes the page to open on; a report still opens on its first page.{report_id}_{page.name}. Page names repeat across reports (the API example answersReportSectionandReportSection1), so a bare name would collide inservice.chartName. Grafana scopes its panels the same way ({uid}_{panelId}). Recorded in ADR:2026-10-22-powerbi-report-pages-are-charts-named-by-report-id-and-page-name._yield_chart(filter, request, record under the parent, progress, error) and_get_chart_fqns(the parent'schartslist) replace a second copy of the tile loop. Only charts that were yielded are listed, because the server resolves every listed chart FQN and fails the dashboard on a missing one.fetch_report_pagesanswers[]only for a response with no pages, andNonewhen the read fails (an error status, whichREST.getturns intoNonebecause Power BI nests the errorcodeundererror; a transport error; an unreadable body). Both are logged at debug. For a failed read, the chart stage reads the report back from the server and keeps the charts it already lists, in the run's live set (somarkDeletedChartsdoes not soft-delete them) and in the report'scharts; otherwise a transient failure would delete the page charts and the next run restore them. When the server cannot list those charts either, the report's charts are unknown: the report is registered but not sent (a PUT replaces its chart links,nullincluded), andPowerbiSource.mark_charts_as_deletedskips the stale-chart pass for the run, so a failed discovery never drives deletion. The step is not failed for a failed pages read: with the admin APIs the service principal often cannot open a workspace, so its reports' pages fail on every run. An answer with no pages lets the old page charts go.chartFilterPatternapplies to page display names; a page without anameis skipped with a warning; a report excluded bydashboardFilterPatternstill makes no pages call.StackTraceError(name=None)from inside the error handler, which aborted the chart stage for the rest of the workspace. Errors are now named by the chart's display name.markDeletedCharts, like tiles. No schema or migration change.yield_dashboard_chart_lineagestage draws Dashboard→Chart lineage edges only for the last dashboard yielded per workspace (context.dashboardis upserted), which already applies to tiles and now applies to pages too; thechartslist itself is set for every report. In non-admin mode a failed tiles read (fetch_all_org_tiles) still empties a dashboard's tiles, as before this PR.Tests:
Use cases covered
ReportSectionget distinct charts.chartFilterPatterndrops a page from the charts while the report still opens on it.charts.charts), with a page-less URL, after one call; a report not ingested before keeps nothing.rdlreportsprefix for their pages and the report.dashboardFilterPatternmakes no pages call.Unit tests
ingestion/tests/unit/topology/dashboard/test_powerbi_report_pages.py, which runs the real producer, chart stage and dashboard stage with only the PowerBI REST GET mocked.test_powerbi_client.py(fetch_report_pagestells no pages from a failed read, and its debug logs),test_powerbi_workspace_state.py(pages memo lifecycle, failed reads included),test_powerbi.py(test_get_report_urlfor the pure builder).PYTHONPATH=src:test_connection.py39,test_powerbi_filter_query.py10,test_powerbi_table_measures.py13,test_dashboard_owned_connection.py5,test_powerbi.py59,test_powerbi_client.py14,test_powerbi_metrics.py22,test_powerbi_report_pages.py17,test_powerbi_workspace_state.py12,test_powerbi_resilience.py17 — 208 passed, 0 failed.pytest-cov): every changed executable line is covered, 81/81 (metadata.py58/58,client.py6/6,workspace_state.py17/17). File totals:workspace_state.py100%,metadata.py65%,client.py45%; the rest is untouched auth, scan and lineage code.charts, chart registration formarkDeletedCharts, keeping the stored charts on a failed read, telling a failed read from no pages, and, when the stored charts are unknown, not sending the report and skipping the stale-chart pass.test_failed_tile_without_a_title_is_reported_by_its_idfails onmain's chart stage with theStackTraceError(name=None)ValidationError.Backend integration tests
Ingestion integration tests
tests/integration/powerbi/— 1 passed. No integration test was added: the pages call is a per-report REST GET, covered at the REST boundary by the stage tests above.Playwright (UI) tests
Manual testing performed
Ran against a live Power BI tenant with
useAdminApis: true, ingesting it into two new services:before_changeswithmain,after_changeswith this branch.ReportSection"count of status by year",ReportSection6937772d99d42eb76e55"sum of customers") now lists two charts,3c8875f2-***_ReportSectionand3c8875f2-***_ReportSection6937772d99d42eb76e55, shown by those display names, each with a source URL that opens its page (.../reports/3c8875f2-***/ReportSection6937772d99d42eb76e55?experience=power-bi). Onmainit lists none. The report still opens onReportSection, its first page.main's (name, display name, URL, chart type, dashboard), and so is every report URL.maineither: their report URL has no page in both runs. They still have no charts.mainingested (the upgrade path), and excluding a page withchartFilterPatternto see its chart soft-deleted.UI screen recording:
Not applicable — ingestion-only change; the existing Charts tab renders the new charts.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: I updated the migration scripts or explained why it is not needed. Not applicable: no schema change.
For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.Pass 1 on
f10427e1836: 🔴 a failed pages read soft-deleted the report's page charts, and 🔴 the decision record was not committed; both fixed in3f011e540a8, with tests. 🟡 a filter in_get_chart_fqnsthat could never drop a chart: removed. 🟡 Dashboard→Chart lineage reaching only the last dashboard per workspace: pre-existing (Fixes 5952: [Lineage] Draw Dashboard to Chart edges in the shared dashboard topology #34985), left out of scope (see "Not changed"). Pass 2 on3f011e540a8: 🔴 when the stored charts could not be read either, the report was still sent withcharts=[]and its charts soft-deleted; fixed in6d1327b3ada, with tests (Greptile's P1 is the same finding). Pass 3 on6d1327b3ada: no 🔴. Its one withheld nit, that the double-failure test dropped the dashboards so acontinue→returnregression passed, is fixed inad871935579, a test-only change that the same mutant now fails.Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under
docs/decisions/(see itsREADME.md). This description is gone fromgit logafter the squash-merge.The issue properly describes why the new feature is needed, what's the goal, and how we are building it.
I have updated the documentation. Not done: the connector docs live in the docs repository.
I have added tests around the new logic.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
PowerBI report pages become charts under their report. The connector reuses one pages response for charts and report URLs.
Reviews (3) · Last reviewed commit: "test(powerbi): assert the next report is..." · Reviewed by Greptile