Skip to content

test(versioning): un-skip the two obsolete activity-view skips - #42710

Merged
rusackas merged 2 commits into
apache:masterfrom
mikebridge:versioning-unskip-activity-tests
Aug 3, 2026
Merged

test(versioning): un-skip the two obsolete activity-view skips#42710
rusackas merged 2 commits into
apache:masterfrom
mikebridge:versioning-unskip-activity-tests

Conversation

@mikebridge

Copy link
Copy Markdown
Contributor

SUMMARY

Two activity-view integration tests were skipped waiting on work that has since merged:

The retention test needed one substantive update beyond removing the decorator: it was written against an age-only prune, but the shipped prune preserves any transaction still anchoring an open shadow row (end_transaction_id IS NULL) — an entity's current state is never dropped, however old. The test's single edit created exactly that row, so the prune correctly removed nothing and the assertion could never pass. The test now edits the chart twice: the second edit closes the first edit's shadow row, making the first transaction genuinely prunable, and the assertions exercise the keep-live guard as a side effect (the live transaction survives despite being backdated past the cutoff).

Full file passes 40/40 against the integration SQLite DB.

Disclosure: this change was developed with AI assistance (Claude), on behalf of and reviewed by @mikebridge.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — test-only change.

TESTING INSTRUCTIONS

pytest tests/integration_tests/versioning/activity_view_tests.py

40 passed (was 38 passed, 2 skipped). The two un-skipped tests are TestDashboardActivityView::test_activity_excludes_records_after_retention_prune and TestDashboardActivityView::test_activity_surfaces_dashboard_restore_event.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Both skip reasons have been overtaken by merges:

- test_activity_excludes_records_after_retention_prune waited on the
  retention prune extracted to sc-111099; _prune_old_versions_impl is in
  superset/tasks/version_history_retention.py.
- test_activity_surfaces_dashboard_restore_event waited on the restore
  endpoint, which landed in apache#42469. It passes unchanged.

The retention test needed one substantive update beyond removing the
decorator: it was written against an age-only prune, but the shipped
prune preserves any transaction still anchoring an open shadow row
(end_transaction_id IS NULL) — an entity's current state is never
dropped, however old. The test's single edit created exactly that row,
so the prune correctly removed nothing and the assertion failed. The
test now edits the chart twice: the second edit closes the first row,
making the first transaction genuinely prunable, and the assertions
exercise the keep-live guard as a side effect.

Full file passes 40/40 against the integration SQLite DB.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bito-code-review

bito-code-review Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #019f4c

Actionable Suggestions - 0
Additional Suggestions - 1
  • tests/integration_tests/versioning/activity_view_tests.py - 1
    • BITO inline import violation · Line 530-530
      Move the `from datetime import datetime, timedelta` import from inside the test function to the top of the module, and remove the `# pylint: disable=import-outside-toplevel` comment. This aligns with the project’s policy against inline imports.
Review Details
  • Files reviewed - 1 · Commit Range: 17eb1b2..17eb1b2
    • tests/integration_tests/versioning/activity_view_tests.py
  • Files skipped - 0
  • 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 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

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.43%. Comparing base (06628bb) to head (006af63).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #42710   +/-   ##
=======================================
  Coverage   65.43%   65.43%           
=======================================
  Files        2810     2810           
  Lines      159528   159528           
  Branches    36410    36410           
=======================================
+ Hits       104380   104388    +8     
+ Misses      53102    53094    -8     
  Partials     2046     2046           
Flag Coverage Δ
hive 38.06% <ø> (ø)
mysql 57.78% <ø> (+0.01%) ⬆️
postgres 57.83% <ø> (+0.01%) ⬆️
presto 39.95% <ø> (ø)
python 59.21% <ø> (+0.01%) ⬆️
sqlite 57.45% <ø> (+0.01%) ⬆️
unit 100.00% <ø> (ø)

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.

…t transactions

Follow-ups from a clean-code + tidy-first review pass over this PR. Both
lenses independently flagged the same weakness: the retention assertions
(pruned_transactions >= 1, count decreased) could pass on this persistent
integration DB off a leftover old transaction from a prior run, while
this test's own backdated transaction survived — green for the wrong
reason.

The test now captures the two transaction ids its edits create and
asserts membership: the closed one is pruned, and the one anchoring the
chart's live row survives despite being equally old. That turns the
keep-live guard from docstring prose into an assertion.

Also: datetime.utcnow() (deprecated on 3.12+) swapped for the same
naive-from-aware derivation the prune impl uses; the duplicated two-edit
rationale collapsed to one authoritative statement in the docstring; and
the restore test's docstring no longer claims a ['__meta__', 'restore']
path — the assertion (and the listener) use ['__meta__'], with the verb
in action_kind.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 006af63
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a70b26f88857a00081c1c19
😎 Deploy Preview https://deploy-preview-42710--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.

@rusackas rusackas 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.

Thanks for chasing these down, @mikebridge! The retention test rewrite holds up against the actual keep-live guard in _prune_old_versions_impl, and the membership checks are a nice touch given this runs against a persistent DB. Bito's import nit doesn't hold up either. That pattern's already used elsewhere in this file for scoped test imports. LGTM!

@bito-code-review

bito-code-review Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #03cf80

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 17eb1b2..006af63
    • tests/integration_tests/versioning/activity_view_tests.py
  • Files skipped - 0
  • 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 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

@rusackas
rusackas merged commit db0b8b1 into apache:master Aug 3, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants