-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1706990 Extract non action-related fields in ActionContext to ne…
…w WorkspaceContext (#1652) Entity classes current have lots of static methods, which were added to support the v1 to v2 migration, but they have way too many parameters, so we want to allow calling these methods on entity instances. Right now, the only instance methods are `EntityAction` implementations, which represent the top-level actions that can be performed by these entities, but the static methods we want to convert to instance methods don't need to be `EntityAction` implementations (since they don't represent top-level operations). However, it would be useful for these methods to have access to utilities in the `ActionContext`, like `ctx.default_role` for example. Since these utilities are not really part of the action, let's extract them from `ActionContext` into a new `WorkspaceContext` that gets set as a field of the entity when instantiated by the `WorkspaceManager`.
- Loading branch information
1 parent
5b8b5d2
commit ad09ad9
Showing
6 changed files
with
89 additions
and
57 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.