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 states/status #4857

Merged
merged 74 commits into from
Jun 9, 2023
Merged

Conversation

matmair
Copy link
Member

@matmair matmair commented May 19, 2023

Refactor for generic StatusCode definition. The goal is to make the code self-sufficient, 100% covered by unit tests and easy to use in any place needed (including plugins).

Specific changes:

  • factors state/status out to generic method
  • makes API endpoint safer to use
  • switches StatusCode to enums - making the definition less repetitive and shorter

@matmair matmair self-assigned this May 19, 2023
@matmair matmair marked this pull request as ready for review June 5, 2023 05:37
@matmair matmair added this to the 0.12.0 milestone Jun 5, 2023
@matmair matmair mentioned this pull request Jun 5, 2023
2 tasks
@matmair
Copy link
Member Author

matmair commented Jun 5, 2023

@SchrodingersGat this would be ready for a review. I moved the database additions to a new PR as this one is becoming big and hard to review with the database components intertwined.

@SchrodingersGat
Copy link
Member

@matmair looking now, sorry I didn't respond to your previous ping.

Copy link
Member

@SchrodingersGat SchrodingersGat left a comment

Choose a reason for hiding this comment

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

LGTM in general, but there's a lot of files touched :)

@wolflu05
Copy link
Contributor

wolflu05 commented Jun 5, 2023

Does this trick also work with now autogenerated new migrations or is there some manual adjustment needed afterwards before committing the migration files?

@matmair
Copy link
Member Author

matmair commented Jun 5, 2023

If you change the method used for choices you will have to adjust it again.

@matmair
Copy link
Member Author

matmair commented Jun 8, 2023

Hopefully the upstream fixes make the CI go through now

@matmair
Copy link
Member Author

matmair commented Jun 8, 2023

@SchrodingersGat this would be ready for review and merge

@SchrodingersGat SchrodingersGat merged commit 5d1d8ec into inventree:master Jun 9, 2023
@SchrodingersGat
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants