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 API components into kernelci-core #279

Closed
r-c-n opened this issue Nov 29, 2023 · 1 comment · Fixed by kernelci/kernelci-api#433
Closed

Refactor API components into kernelci-core #279

r-c-n opened this issue Nov 29, 2023 · 1 comment · Fixed by kernelci/kernelci-api#433

Comments

@r-c-n
Copy link

r-c-n commented Nov 29, 2023

The pydantic models for the new API are currently defined in the kernelci-api. In other parts of the project (pipeline and helpers/libs in kernelci-core) there are ad-hoc implementations of data checkers and sanitizers that could be replaced by the proper use of pydantic model validators, but in order to do that they'd need to be in a place that's accessible by all the project components.

This was already discussed in past conversations, the consensus is that there are some bits of the api that could be refactored into kernelci-core and then imported by either kernelci-api or kernelci-pipeline as needed. This would reduce code duplication and future maintenance problems.

@gctucker
Copy link
Contributor

gctucker commented Dec 1, 2023

Yes, and also it's important to make it clear that only the models that are used in the client-facing API endpoints should be defined in the kernelci common package. The API implementation can have its own set of internal models for the data stored in the database (that's already the case with users).

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 a pull request may close this issue.

2 participants