Skip to content

Migrate ApprovalController to BaseControllerV2 #555

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

Merged
merged 13 commits into from
Aug 27, 2021

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Aug 10, 2021

This PR migrates the ApprovalController to BaseControllerV2. Its functionality is exactly the same as before, with the exception of some name changes for clarity, and the addition of controller messenger actions.

The method resolve has been renamed to accept, which is a breaking change.

@rekmarks rekmarks mentioned this pull request Aug 10, 2021
11 tasks
@rekmarks rekmarks self-assigned this Aug 10, 2021
@rekmarks rekmarks requested a review from Gudahtt August 10, 2021 03:30
@rekmarks rekmarks marked this pull request as ready for review August 10, 2021 03:31
@rekmarks rekmarks requested a review from a team as a code owner August 10, 2021 03:31
@rekmarks rekmarks force-pushed the migrate-ApprovalController branch 2 times, most recently from bcad6c7 to 2ecb8d3 Compare August 18, 2021 21:39
@rekmarks rekmarks requested a review from Gudahtt August 20, 2021 01:49
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

The two inaccurate comments should be cleaned up, but everything looks great otherwise!

}

// These signatures create a meaningful difference when this method is called.
/* eslint-disable @typescript-eslint/unified-signatures */
Copy link
Member

Choose a reason for hiding this comment

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

I think I lean more towards unified signatures here as well 🤔 The separate descriptions are kinda nice, but we could explain both origin and type in the unified signature. This seems like it would be more burdensome to maintain.

But I'd be OK with us trying this anyway if you'd prefer. I've never tried it before. Not a big deal 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

It may make it somewhat more burdensome to maintain, but I think it does make the method easier to use. We can always get rid of the signatures in the future, if it's too much. Since the implementation is very permissive with its parameters, it shouldn't be breaking.

@rekmarks rekmarks requested a review from Gudahtt August 21, 2021 19:21
@rekmarks rekmarks force-pushed the migrate-ApprovalController branch from f78d501 to 4d5be86 Compare August 23, 2021 17:58
@rekmarks
Copy link
Member Author

rekmarks commented Aug 23, 2021

I added events to be emitted when requests are approved or reject in the latest commit (4d5be86 at the time of writing). I'm not certain that we'll actually use them in practice, so I'm down to move them to a separate PR, or whatever we may desire.

Meh, I decided against it. The accept and reject signatures allow resolving any value and error, respectively, so there shouldn't be any contextual information that can't be passed to whoever is waiting on the approval promise resolution. That "whoever" can then emit more specific events.

@rekmarks rekmarks force-pushed the migrate-ApprovalController branch from 4d5be86 to 00e7f37 Compare August 23, 2021 22:57
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@rekmarks rekmarks merged commit 2c6392c into main Aug 27, 2021
@rekmarks rekmarks deleted the migrate-ApprovalController branch August 27, 2021 21:26
@adonesky1 adonesky1 mentioned this pull request Aug 27, 2021
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
This PR migrates the `ApprovalController` to `BaseControllerV2`. Its functionality is exactly the same as before, with the exception of some name changes for clarity, and the addition of controller messenger actions.

The method `resolve` has been renamed to `accept`, which is a breaking change.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
This PR migrates the `ApprovalController` to `BaseControllerV2`. Its functionality is exactly the same as before, with the exception of some name changes for clarity, and the addition of controller messenger actions.

The method `resolve` has been renamed to `accept`, which is a breaking change.
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.

2 participants