Skip to content

fix(reports): propagate force flag to dashboard permalink report URLs - #38691

Draft
ferjanin wants to merge 4 commits into
apache:masterfrom
europace:fix-dashboard-report-force-permalink
Draft

ferjanin wants to merge 4 commits into
apache:masterfrom
europace:fix-dashboard-report-force-permalink

Conversation

@ferjanin

@ferjanin ferjanin commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

User description

fix(reports): propagate force flag in dashboard permalink report URLs

SUMMARY

This PR fixes dashboard report cache bypass behavior when Ignore cache when generating report is enabled.

In the report execution flow, dashboard URLs generated through the permalink/tab path were not propagating the force query parameter to the dashboard permalink URL. As a result, dashboard report rendering could proceed without the expected cache-bypass signal, unlike chart report flow where force is propagated correctly.

This change updates dashboard permalink URL generation in report execution to include force=true|false based on force_screenshot, aligning dashboard reports with chart reports.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A (backend URL generation + unit-test coverage change)

TESTING INSTRUCTIONS

  1. Run unit tests:
    SUPERSET_HOME=/tmp/superset_test pytest -q tests/unit_tests/commands/report/execute_test.py
  2. Manual validation (optional):
    1. Create or edit a dashboard report with Ignore cache when generating report enabled.
    2. Trigger report execution.
    3. Inspect worker/web logs and verify permalink/report requests include force=true in dashboard permalink flow.

ADDITIONAL INFORMATION


CodeAnt-AI Description

Include the cache-bypass setting in dashboard report links

What Changed

  • Dashboard report links now carry the cache-bypass setting in the permalink URL, so scheduled dashboard reports follow the chosen "Ignore cache when generating report" option.
  • When cache bypass is off, dashboard report links now include force=false; when it is on, they include force=true.
  • Existing report tests were updated to check for the new query parameter in dashboard report URLs.

Impact

✅ Correct cache-bypass behavior in dashboard reports
✅ Fewer stale dashboard screenshots
✅ Clearer report URL checks

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@bito-code-review

bito-code-review Bot commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #2d67aa

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 7506c46..7506c46
    • superset/commands/report/execute.py
    • tests/unit_tests/commands/report/execute_test.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codeant-ai-for-open-source codeant-ai-for-open-source Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Mar 17, 2026
@dosubot dosubot Bot added alert-reports Namespace | Anything related to the Alert & Reports feature change:backend Requires changing the backend labels Mar 17, 2026
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

Sequence Diagram

This PR updates dashboard report URL generation so the force flag is always appended to permalink based report URLs. The report executor now propagates force_screenshot as force true or false, ensuring dashboard rendering follows the intended cache bypass behavior.

sequenceDiagram
    participant Scheduler
    participant ReportExecutor
    participant PermalinkService
    participant DashboardWebApp

    Scheduler->>ReportExecutor: Trigger dashboard report execution
    ReportExecutor->>ReportExecutor: Read force screenshot setting
    ReportExecutor->>PermalinkService: Create dashboard permalink key
    PermalinkService-->>ReportExecutor: Return permalink key
    ReportExecutor->>DashboardWebApp: Request permalink URL with force true or false
    DashboardWebApp-->>ReportExecutor: Render dashboard using matching cache mode
Loading

Generated by CodeAnt AI

@codecov

codecov Bot commented Mar 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.29%. Comparing base (1c8224f) to head (69f4aef).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #38691      +/-   ##
==========================================
- Coverage   65.10%   64.29%   -0.81%     
==========================================
  Files        1819     2532     +713     
  Lines       72670   129770   +57100     
  Branches    23222    29986    +6764     
==========================================
+ Hits        47312    83441   +36129     
- Misses      25358    44875   +19517     
- Partials        0     1454    +1454     
Flag Coverage Δ
hive 40.58% <0.00%> (?)
mysql 61.56% <100.00%> (?)
postgres 61.63% <100.00%> (?)
presto 40.60% <0.00%> (?)
python 63.24% <100.00%> (?)
sqlite 61.27% <100.00%> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes dashboard report cache-bypass behavior by ensuring the force query parameter (driven by ReportSchedule.force_screenshot / “Ignore cache when generating report”) is propagated when dashboard report URLs are generated via the dashboard permalink/tab flow.

Changes:

  • Add force=true|false to dashboard permalink URLs generated for tab/permalink-based dashboard report execution.
  • Update unit tests to assert the force query param is present in generated dashboard permalink URLs (including force=false when bypass is not enabled).
  • Add targeted unit test coverage for the force=true permalink case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
superset/commands/report/execute.py Propagates force into Superset.dashboard_permalink URL generation for dashboard report permalink/tab rendering.
tests/unit_tests/commands/report/execute_test.py Updates expectations and adds coverage to verify force is included in generated dashboard permalink URLs.

You can also share your feedback on Copilot code review. Take the survey.

@codeant-ai-for-open-source codeant-ai-for-open-source Bot added size:M This PR changes 30-99 lines, ignoring generated files and removed size:M This PR changes 30-99 lines, ignoring generated files labels Mar 19, 2026
@netlify

netlify Bot commented Mar 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 4fca250
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69c67562b9af6700073f110c
😎 Deploy Preview https://deploy-preview-38691--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@msyavuz msyavuz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this one! Just a small nit

"""
Get one tab url
"""
force = "true" if self._report_schedule.force_screenshot else "false"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we can dry this up a bit now with the same thing existing in L:219

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @msyavuz , I'm working on resolving your suggestion but i have a quick question on local lint behavior.

I’m seeing a pre-commit/pylint mismatch: .pylintrc enables json-import, but superset/extensions/pylint.py only registers disallowed-sql-import and consider-using-transaction.
Local pylint then reports:

Unknown option value for '--enable' ... 'json-import'

I can reproduce this on current master, so it looks independent of this report fix.
Can you confirm the intended rule name/config here?

@bito-code-review

Copy link
Copy Markdown
Contributor

The diff shows adding a 'force' parameter in _get_tab_url, but without the full file or InlineCode for line 219, I can't verify if there's duplication to refactor.

@bito-code-review

bito-code-review Bot commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #6de687

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 7506c46..69f4aef
    • tests/integration_tests/reports/commands/execute_dashboard_report_tests.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codeant-ai-for-open-source codeant-ai-for-open-source Bot added size:M This PR changes 30-99 lines, ignoring generated files and removed size:M This PR changes 30-99 lines, ignoring generated files labels Mar 27, 2026
@rusackas

Copy link
Copy Markdown
Member

@ferjanin the fix is right, but two things before this can merge. First, it's conflicting with master now, so needs a rebase. Second, @msyavuz's nit still stands — force = "true" if self._report_schedule.force_screenshot else "false" already lives in _get_url, so computing it again in _get_tab_url duplicates it. It'd be worth pulling that into a shared helper. On the pylint json-import question, that's a separate config thing, doesn't need to block this PR in my opinion.

@rusackas

Copy link
Copy Markdown
Member

Happy to push some commits here if I can help this across the finish line :D

@rusackas

Copy link
Copy Markdown
Member

@ferjanin still conflicting with master, and the dedup ask from March never landed. force = "true" if self._report_schedule.force_screenshot else "false" in _get_url (superset/commands/report/execute.py) is now computed a second time, verbatim, in _get_tab_url. Worth pulling into one helper (or just passing it down from _get_url) before this merges. I'll see if I can help with a rebase here to start...

@rusackas

Copy link
Copy Markdown
Member

I can't push to this branch, so can't rebase for you... hope you can help get it across the finish line.

@rusackas

Copy link
Copy Markdown
Member

Converting to draft... I might adopt this eventually, or we might close it if it remains inactive.

@rusackas
rusackas marked this pull request as draft July 24, 2026 01:27
@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Aug 1, 2026
@rusackas

Copy link
Copy Markdown
Member

This is a real, still-live bug — _get_tab_url in execute.py still doesn't propagate force to the dashboard permalink, so "Ignore cache when generating report" is a no-op for dashboard reports (chart reports already do this correctly). Small, clean fix with test coverage, closes #38672. It's just gone stale — no activity since March and it's conflicting with master now.

Seeing about adopting this one...

@rusackas

Copy link
Copy Markdown
Member

No word from @ferjanin since March, and I still can't push to this branch (fork, no maintainer edits). The bug's still live on master, _get_tab_url never picked up force, so I'll bring this forward on a fresh PR I can push to, and fold in msyavuz's dedup suggestion while I'm at it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alert-reports Namespace | Anything related to the Alert & Reports feature change:backend Requires changing the backend requires:rebase Requires rebasing on top of current master review:draft size/M size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ignore cache when generating report” does not propagate force to /api/v1/chart/data for dashboard reports (cached results still used)

5 participants