Repository navigation
refactor(models): pass session into WorkflowAppLog accessors - #41440
Merged
asukaminato0721 merged 1 commit intoAug 28, 2026
Merged
asukaminato0721 merged 1 commit into
asukaminato0721 merged 1 commit into
Conversation
Contributor
Pyrefly Type Coverage
|
asukaminato0721
enabled auto-merge
August 28, 2026 14:30
asukaminato0721
approved these changes
Aug 28, 2026
This was referenced Sep 1, 2026
3 of 5 tasks
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.
Important
WorkflowAppLogslice in this comment).Summary
Part of #40372, follow-up to #41370.
Converts the two
WorkflowAppLog@propertyaccessors inapi/models/workflow.pythat reach for the globaldb.sessioninternally into plain methods takingsession: Sessionexplicitly, per the pattern established in #40370 / #40797:WorkflowAppLog.created_by_account— nowdef created_by_account(self, session) -> Account | None.WorkflowAppLog.created_by_end_user— nowdef created_by_end_user(self, session).Unlike the zero-call-site slices, these two accessors are read implicitly (
from_attributes=True) byWorkflowAppLogPartialResponsein both the console and service_api workflow-app-log endpoints. Both endpoints already serialize inside an explicitsessionmaker(...).begin()block and already wrap each row in theLogViewview object, so the session is threaded throughLogView(following the session-carrying wrapper pattern ofSegmentWithSummaryfrom #36522):LogViewnow takes the querysessionand exposescreated_by_account/created_by_end_useras properties that resolve through it; all other attributes keep proxying to the underlyingWorkflowAppLog.Not touching
Workflow.*(claimed by another contributor on the issue),WorkflowRun.*, orWorkflowNodeExecutionModel.*.Tests
api/tests/unit_tests/models/test_workflow_app_log_models.py: exercises both accessors against the realsqlite_sessionfixture, covering the role-based dispatch (ACCOUNT vs END_USER) and the None paths, mirroringtest_trigger_models.pyfrom refactor(models): dep-inject Session on remaining @property accessors #40797.test_workflow_app_service_metadata.py: adapted to the newLogViewsignature and extended with a test asserting the accessors resolve through the session the view was built with.Screenshots
N/A (backend-only refactor).
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint godsFrom Claude Code