Skip to content

fix(gtf): address GAQ→GTF interim-review findings - #43532

Merged
villebro merged 4 commits into
apache:gaq-to-gtffrom
villebro:gaq-gtf-review-fixups
Aug 26, 2026
Merged

villebro merged 4 commits into
apache:gaq-to-gtffrom
villebro:gaq-gtf-review-fixups

Conversation

@villebro

Copy link
Copy Markdown
Member

SUMMARY

Follow-up hardening for the GAQ→GTF epic (#43407), addressing findings from an interim review of the feature branch. No behavior change for existing deployments; the async path remains opt-in.

  • update_task(immediate=True) — new keyword-only flag on the task context (superset_core abstract + TaskContext) that bypasses progress-update throttling and writes synchronously. The async chart-data task now publishes its result cache key with immediate=True, so a chained contribution query reading that key via get_dependency_payloads() can't observe a throttle-buffered write. Today this publish is the task's only update_task call, so it was race-free by accident; this makes it race-free by contract before any future progress reporting is added.
  • DRY contribution-totals normalization — QueryContext._normalize_contribution_totals and QueryContextProcessor._prepare_contribution_totals were byte-for-byte duplicates that both had to be kept in sync (drift would diverge sync vs async totals cache keys). Both now call a single normalize_contribution_totals() helper. Removed the unused contribution_queries / contribution_totals_idx instance state (only the returned tuple is ever consumed).
  • Docs — documented the remaining removed config keys (GLOBAL_ASYNC_QUERIES_REDIS_STREAM_LIMIT, …_REDIS_STREAM_LIMIT_FIREHOSE, …_REGISTER_REQUEST_HANDLERS) in UPDATING.md, and added a note that the realtime websocket transport is opt-in (WEBSOCKET_ENABLE=False) and experimental — polling remains the correctness path.
  • Relocated the misplaced, unlinked WEBSOCKET_K8S_OPERATOR_REQUIREMENTS.md out of the repo root.
  • Tests — added coverage for guest subscriber key derivation (the guest cross-tenant isolation boundary), the AsyncModeSection dashboard control, and the update_task immediate-write throttle bypass.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

pytest tests/unit_tests/tasks/test_guest.py tests/unit_tests/tasks/test_context.py \
  tests/unit_tests/tasks/test_async_queries.py \
  tests/unit_tests/common/test_query_context_processor.py \
  tests/unit_tests/common/test_query_serialization.py -q
npm run test -- src/dashboard/components/PropertiesModal/sections/AsyncModeSection.test.tsx

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: GLOBAL_ASYNC_QUERIES (no new flags)
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API (adds immediate kwarg to the task-context update_task API)
  • Removes existing feature or API

Targets the gaq-to-gtf epic branch. Part of #43407.

- update_task(immediate=True) bypasses throttling; use it for the async
  totals cache-key publish so a dependent contribution query can read it
- deduplicate contribution-totals normalization behind a shared helper and
  drop the unused contribution_queries/contribution_totals_idx state
- document the remaining removed GLOBAL_ASYNC_QUERIES_* config keys and note
  the realtime websocket transport is opt-in/experimental in UPDATING.md
- relocate the misplaced WEBSOCKET_K8S_OPERATOR_REQUIREMENTS.md out of the repo
- add tests: guest subscriber key derivation, AsyncModeSection, update_task
  immediate-write throttle bypass
@dosubot dosubot Bot added change:backend Requires changing the backend global:async-query Related to Async Queries feature labels Aug 26, 2026
@bito-code-review

bito-code-review Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

@codecov

codecov Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.02%. Comparing base (3a9392c) to head (f1abb86).
⚠️ Report is 1 commits behind head on gaq-to-gtf.

Files with missing lines Patch % Lines
superset/common/query_context_processor.py 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           gaq-to-gtf   #43532      +/-   ##
==============================================
+ Coverage       78.97%   79.02%   +0.04%     
==============================================
  Files            2885     2890       +5     
  Lines          165820   166435     +615     
  Branches        38342    38338       -4     
==============================================
+ Hits           130956   131523     +567     
- Misses          32390    32442      +52     
+ Partials         2474     2470       -4     
Flag Coverage Δ
hive 38.04% <7.40%> (+<0.01%) ⬆️
javascript 74.36% <ø> (+<0.01%) ⬆️
mysql 57.61% <48.14%> (-0.07%) ⬇️
postgres 57.64% <48.14%> (-0.07%) ⬇️
presto 39.96% <33.33%> (-0.01%) ⬇️
python 83.61% <96.29%> (+<0.01%) ⬆️
sqlite 57.33% <48.14%> (-0.07%) ⬇️
superset-extensions-cli 90.57% <ø> (?)
unit 73.83% <96.29%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@netlify

netlify Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 586db2d
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a8e64d53512c7000837566a
😎 Deploy Preview https://deploy-preview-43532--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@villebro

Copy link
Copy Markdown
Member Author

/review

@github-actions github-actions Bot added the doc Namespace | Anything related to documentation label Aug 26, 2026

@bito-code-review bito-code-review Bot 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.

Code Review Agent Run #8e41b5

Actionable Suggestions - 1
  • tests/unit_tests/tasks/test_guest.py - 1
    • Incomplete scope-affecting claim coverage · Line 89-95
Review Details
  • Files reviewed - 10 · Commit Range: 986a092..c73c371
    • superset-core/src/superset_core/tasks/types.py
    • superset-frontend/src/dashboard/components/PropertiesModal/sections/AsyncModeSection.test.tsx
    • superset/common/query_context.py
    • superset/common/query_context_processor.py
    • superset/tasks/async_queries.py
    • superset/tasks/context.py
    • tests/unit_tests/common/test_query_serialization.py
    • tests/unit_tests/tasks/test_async_queries.py
    • tests/unit_tests/tasks/test_context.py
    • tests/unit_tests/tasks/test_guest.py
  • Files skipped - 3
    • UPDATING.md - Reason: Filter setting
    • WEBSOCKET_K8S_OPERATOR_REQUIREMENTS.md - Reason: Filter setting
    • docs/developer_docs/extensions/tasks.md - Reason: Filter setting
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

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

  • /review - Manually triggers an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines +89 to +95
for claim, value in (
("rls_rules", [{"clause": "tenant_id = 2"}]),
("resources", [{"type": "dashboard", "id": "xyz"}]),
("datasets", [3]),
("rev", 2),
("exp", 3000),
):

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.

Incomplete scope-affecting claim coverage

The test_scope_affecting_claims_change_the_key test covers only 5 of the 8 claims used in key derivation (lines 89-95). Three claims are omitted: aud, iat, and user. These claims are included in the message dict in superset/tasks/guest.py (lines 56-64) and could cause key collisions if they differ between tokens but aren't tested. Complete the coverage loop to include these claims.

Code Review Run #8e41b5


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

@villebro
villebro merged commit 426d453 into apache:gaq-to-gtf Aug 26, 2026
26 checks passed
@villebro
villebro deleted the gaq-gtf-review-fixups branch August 26, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:backend Requires changing the backend doc Namespace | Anything related to documentation global:async-query Related to Async Queries feature size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant