chore(__future__): Drop the AnonymousUser asserts and the strict log assertions - #8308
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
📝 WalkthroughWalkthroughThe change adds Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to Production behavior is unchanged, but one integration test can pass without verifying the event generated by the tested update request because it may match an earlier setup event. The PR is mergeable with explicit owner follow-up to restore the event boundary or assert the newly generated event. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8308 +/- ##
==========================================
- Coverage 98.78% 98.78% -0.01%
==========================================
Files 1604 1605 +1
Lines 64426 64417 -9
==========================================
- Hits 63642 63633 -9
Misses 784 784 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19451 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-16 — run #19451 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #19451 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #19451 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #19448 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19448 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19444 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #19444 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #19444 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #19448 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #19448 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-16 — run #19444 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
9d15706 to
edf5f8b
Compare
edf5f8b to
83e1f4c
Compare
83e1f4c to
5a325c7
Compare
5a325c7 to
649a5ce
Compare
649a5ce to
d54e52f
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
api/tests/integration/features/future/test_flag_endpoint.py (1)
1238-1238: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRetain a log boundary for this test.
The setup
PATCHand the testedPUTboth emitflag.updatedwith the same identity fields and emptysegment_overrides__*__segment__idsvalues. After the reset at Line 1238 was removed, the assertion in Lines 1263-1273 can match the setup event. The test can pass without verifying thePUTevent.Restore
log.events.clear()after the setup response, or assert a newly captured event after thePUT.Suggested fix
assert setup_response.status_code == 200 + log.events.clear() # WhenAlso applies to: 1263-1273
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e9f70ce7-8676-43ae-b485-2cd09b6961a5
📒 Files selected for processing (4)
api/core/types.pyapi/features/future/views.pyapi/tests/integration/features/future/test_flag_endpoint.pydocs/docs/deployment-self-hosting/observability/_events-catalogue.md
Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.
docs/if required so people know about the feature.Changes
Cleanup only — no behaviour changes.
In this PR, we remove the
not isinstance(request.user, AnonymousUser)littered across the codebase in favour of a centralisedAuthenticatedRequesttype, and migrate most of the logging assertions tolog.hasto avoid having to calllog.events.clear()in the functional tests' fixtures.Stacked on #8307.
How did you test this code?
Green CI is sufficient.