Skip to content

Refactor states/status - #4857

Merged
SchrodingersGat merged 74 commits into
inventree:masterfrom
matmair:refactor-states
Jun 9, 2023
Merged

SchrodingersGat merged 74 commits into
inventree:masterfrom
matmair:refactor-states

Conversation

@matmair

@matmair matmair commented May 19, 2023 •

Copy link
Copy Markdown
Member

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
Comment thread InvenTree/InvenTree/context.py Resolved
@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

matmair commented Jun 5, 2023

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
Member

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

@SchrodingersGat SchrodingersGat left a comment

Copy link
Copy Markdown
Member

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

wolflu05 commented Jun 5, 2023 •

Copy link
Copy Markdown
Member

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

@matmair

matmair commented Jun 5, 2023 •

Copy link
Copy Markdown
Member Author

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

@matmair
matmair force-pushed the refactor-states branch from 919b80d to e93eee4 Compare June 6, 2023 21:33
@matmair

matmair commented Jun 8, 2023

Copy link
Copy Markdown
Member Author

Hopefully the upstream fixes make the CI go through now

@matmair

matmair commented Jun 8, 2023

Copy link
Copy Markdown
Member Author

@SchrodingersGat this would be ready for review and merge

@SchrodingersGat
SchrodingersGat merged commit 5d1d8ec into inventree:master Jun 9, 2023
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