Skip to content

[RI-50004] Expose Workflow value to apply (breaking) #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

square-tomb
Copy link
Contributor

This is an alternative implementation of #259 that includes breaking changes, which would require a major version bump and for all declarations of types conforming to WorkflowAction to be updated.

@square-tomb square-tomb changed the title [WIP] Expose Workflow value to apply (breaking) [WIP] Expose Workflow value to apply (breaking) Jan 2, 2024
@square-tomb square-tomb closed this Aug 3, 2024
@square-tomb square-tomb reopened this Mar 3, 2025
@square-tomb square-tomb force-pushed the tomb/workflow-in-apply-breaking branch from 6927506 to 7f970d8 Compare March 21, 2025 19:20
Replace

```
func apply\(toState ([a-zA-Z0-9_]+): inout ([a-zA-Z0-9_\.<>, ]+|\(\))\) -> ([a-zA-Z0-9_\.<>, ]+)\?
```

with

```
func apply(toState $1: inout $2, workflow: WorkflowType) -> $3?
```
@square-tomb square-tomb force-pushed the tomb/workflow-in-apply-breaking branch from 7f970d8 to 0207e16 Compare March 21, 2025 19:22
@square-tomb square-tomb force-pushed the tomb/workflow-in-apply-breaking branch from 0207e16 to 5fb03fa Compare March 21, 2025 20:09
@square-tomb square-tomb force-pushed the tomb/workflow-in-apply-breaking branch from 949f919 to 1f239e2 Compare March 21, 2025 22:47
@square-tomb square-tomb requested a review from a team March 22, 2025 04:06
Comment on lines +286 to +289

private let workflow = AuthenticationWorkflow(
authenticationService: AuthenticationService()
)
Copy link
Contributor Author

@square-tomb square-tomb Mar 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: make this an ivar with setup/teardown in case AuthenticationService is stateful

withState: .authorizingTwoFactor(
twoFactorCode: "twoFactorCode",
intermediateSession: "intermediateSession"
)
workflow: workflow,
state: .authorizingTwoFactor(twoFactorCode: "123456", intermediateSession: "session")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: preserve original parameter values

func apply(toState state: inout ___VARIABLE_productName___Workflow.State) -> ___VARIABLE_productName___Workflow.Output? {
func apply(toState state: inout ___VARIABLE_productName___Workflow.State, workflow: WorkflowType) -> ___VARIABLE_productName___Workflow.Output? {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

func apply(toState state: inout ___VARIABLE_productName___Workflow.State) -> ___VARIABLE_productName___Workflow.Output? {
func apply(toState state: inout ___VARIABLE_productName___Workflow.State, workflow: WorkflowType) -> ___VARIABLE_productName___Workflow.Output? {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

func apply(toState state: inout ___VARIABLE_productName___Workflow.State) -> ___VARIABLE_productName___Workflow.Output? {
func apply(toState state: inout ___VARIABLE_productName___Workflow.State, workflow: WorkflowType) -> ___VARIABLE_productName___Workflow.Output? {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

@square-tomb square-tomb changed the title [WIP] Expose Workflow value to apply (breaking) [RI-50004] Expose Workflow value to apply (breaking) Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant