feat: scheduled canvas PDF export - #9770
Open
nishantmonu51 wants to merge 4 commits into
Open
Conversation
Adds scheduled PDF exports for canvas dashboards, reusing the Report resource end-to-end. A canvas PDF report has export format 'pdf', a 'canvas' annotation, and no query; the reconciler emails the usual link-only report email, and the export page renders the canvas in the recipient's browser (via magic token) and generates the PDF with the existing client-side pipeline. Canvas filter/time state captured at scheduling time is stored in web_open_state and replayed on the export and open pages.
Shows the canvas filter bar (time range, comparison, and filter pills) in the canvas variant of the scheduled report dialog, matching the filters section in explore scheduled reports. The bar is backed by the live canvas store, which edits the page URL: the dialog snapshots the URL when it opens (replaying the report's stored state in edit mode), captures the edited state into web_open_state on submit, and restores the original URL when it closes so the dashboard behind the dialog is left unchanged.
Collaborator
Author
|
@codex: review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0673f3588
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
pjain1
reviewed
Jul 30, 2026
Member
I believe this is done? |
Collaborator
Author
Yes, I tested it manually. |
- Bake the canvas's filters into the report's security rules: the dialog captures per-metrics-view filter expressions (metrics_view_filters in ReportOptions), the admin server stores them in a report annotation, and the report reconciler converts them to row-filter rules so magic-token recipients cannot query data beyond the report's filters. - Remove the pdf_include_filters/pdf_all_tabs proto fields and annotations; the PDF options are now stored as extra params in web_open_state, which is only read by the UI. - GenerateReportYAML: emit canvas/explore annotations and canvas state so generated canvas PDF report YAML passes parser validation. - Report/canvas reconcilers: use the controller directly instead of re-fetching it; propagate canvas lookup errors other than not-found. - Rename the share popover button to "Create scheduled export..." since scheduled exports deliver to Slack as well as email.
AdityaHegde
requested changes
Jul 30, 2026
…ion time - The canvas filter bar in the scheduled report dialog is now read-only (report forms must not change the underlying dashboard view); editing returns once unified filters support in-memory editing. - Anchor relative time ranges at the report's execution time on the export page: TimeManager gains an executionTimeStore that TimeState passes through deriveInterval to MetricsViewTimeRanges' execution_time, which replaces now/latest/watermark server-side. This keeps the rendered data consistent with the scheduled run for every range format, across all of the canvas's metrics views.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds scheduled PDF exports for canvas dashboards, reusing the scheduled-reports machinery end-to-end. Recipients get the usual link-only report email; clicking "Download PDF file" opens the report export page, which renders the canvas in the browser (authenticated by the report's magic token) and generates the PDF with the existing client-side pipeline.
Reportwithexport.format: pdf, acanvasannotation, and nodata/query(nothing executes server-side at send time). NewEXPORT_FORMAT_PDFenum value; parser and admin server validate the combination.ReportReconciler.ResolveTransitiveAccessnow reuses the canvas transitive-access logic (extracted ascanvasTransitiveConditionResources) so magic-token recipients can query the canvas's components and metrics views.web_open_stateannotation and replayed on the export and open pages; PDF options are persisted aspdf_include_filters/pdf_all_tabsannotations (newReportOptionsfields).ScheduledReportDialog(schedule, recipients, PDF options; no query fields), a canvas-PDF branch on the report export page (CanvasPdfReportExport), and canvas support on the report open/metadata pages.TestReportCanvasResolveTransitiveAccess), and unit tests for the report form utils.