Conversation
Contributor
Pyrefly Type Coverage
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-08-09 04:14:00.763733415 +0000
+++ /tmp/pyrefly_pr.txt 2026-08-09 04:13:51.064722925 +0000
@@ -2075,7 +2075,7 @@
ERROR Argument `Literal['account']` is not assignable to parameter `created_by_role` with type `CreatorUserRole` in function `models.model.UploadFile.__init__` [bad-argument-type]
--> tests/unit_tests/controllers/console/datasets/test_datasets_segments.py:1102:29
ERROR Object of class `FunctionType` has no attribute `assert_called_once_with` [missing-attribute]
- --> tests/unit_tests/controllers/console/explore/test_trial.py:215:5
+ --> tests/unit_tests/controllers/console/explore/test_trial.py:226:5
ERROR Argument `str` is not assignable to parameter `view` with type `(InstalledApp) -> str` in function `controllers.console.explore.wraps.decorator` [bad-argument-type]
--> tests/unit_tests/controllers/console/explore/test_wraps.py:73:18
ERROR Argument `str` is not assignable to parameter `view` with type `(InstalledApp) -> str` in function `controllers.console.explore.wraps.decorator` [bad-argument-type]
|
5 tasks
hjlarry
marked this pull request as ready for review
August 9, 2026 06:06
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.
Summary
Part of #39993.
This is PR 2 of the recommended-app controller stack. Its Git base is #40207.
Move recommended trial-app usage writes out of
RecommendedAppServiceand behind a persistence-neutral application service plus a SQLAlchemy repository.Why this layer
The previous implementation accepted the controller's request
Sessionand calledcommit()fromRecommendedAppService.add_trial_app_record(). That coupled the application behavior to SQLAlchemy and could commit unrelated pending work owned by the request.This PR gives usage accounting its own repository-owned transaction:
app_idandaccount_id;TrialAppUsageServicedefines the application boundary;TrialAppUsageRepositoryowns the model query and transaction;Intentional boundaries
This is deliberately not the complete recommended-app migration:
RecommendedAppService.get_app()remains because runtime trial admission is a separate flow.RecommendedAppService.is_trial_app_enabled()remains the deployment-level policy source.current_user,RequestContext,setup_required, and admission decorators are unchanged.These boundaries keep the transaction-ownership change independently reviewable. Runtime admission and the remaining legacy catalog adapters can move in later stack layers.
Verification
From Codex