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

Refactor project put method to a single route #1634

Merged
merged 7 commits into from
Feb 2, 2023

Conversation

Pezmc
Copy link
Contributor

@Pezmc Pezmc commented Feb 1, 2023

Description

Refactors the unwieldy Project update endpoint to have a single implementation for updating a project.

Three key objectives:

  • Easier to maintain code
  • Clearer overview of what is legacy
  • Improved failure state handling (transactions) - previously errors would leave projects in a half updated state

There are two subtle API changes as a result, the rest of the API behaves the same as previously (including the legacy setting of stack and type):

  • The changeProjectDefinition flag is no longer needed to change a projects time
  • Changing a projects type now returns early and completes the reboot of the project async

Related Issue(s)

Replaces #1623
Follow up to #1631

Checklist

Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

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

From my PoV, anything that helps us as devs on a growing code base is good.
The re-ordering of code is definitely better (even if the PUT route is still rather large and could/should? be further refactored to encapsulate functionality) it is a good step.

The adoption may come down to effort vs benefit & from a consumer there may be no discernible improvements - however from a dev perspective: I think the answer here is yes - considering things are only going to get more complicated as the code base grows.

You have my stamp of approval ;)

@Pezmc Pezmc merged commit 700b279 into main Feb 2, 2023
@Pezmc Pezmc deleted the refactor-project-put-method branch February 2, 2023 15:26
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.

4 participants