Skip to content
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

Move some cloud functions to an extension #130

Merged
merged 1 commit into from
Oct 15, 2023

Conversation

itowlson
Copy link
Contributor

This is a pure refactor - no behaviour changes. (Unless I messed up.)

While working on some reorganisation of the deploy module, I noticed we had some instance methods that didn't use self and in fact seemed more concerned with the CloudClient than with the DeployCommand. For me it felt more readable to pull them out as extension methods on the CloudClientInterface. (My main interest was in moving code out of DeployCommand, which could be done without traitifying. But this felt nicer.)

I also noticed that commands::get_app_id_cloud and DeployCommand::try_get_app_id_cloud did the same thing (modulo one anyhow::Context), so unified them.

I removed the _cloud suffixes which were inherited from earlier Spin code where they had to be distinguished from Platform (_hippo) versions of the operations. The suffix is no longer needed in the cloud-specific plugin. I also took the opportunity to change the argument order and make some strings into &str because reduced the need for repeated cloning.

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

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

Nice improvements and simplifications!

@itowlson itowlson merged commit a33d7d3 into fermyon:main Oct 15, 2023
8 checks passed
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