-
Notifications
You must be signed in to change notification settings - Fork 80
Migrate backend of Project model to Eloquent
#1556
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
Migrate backend of Project model to Eloquent
#1556
Conversation
af08ed3 to
ea1b956
Compare
|
I have marked this PR as a draft because it should not be merged until after the CDash 3.2 release is created. |
ea1b956 to
6c61a9a
Compare
6c61a9a to
74fe199
Compare
|
The CDash 3.2 release branch has been created, and we can now proceed with CDash 3.3 PRs such as this one. |
070487a to
17884eb
Compare
josephsnyder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of issues with the whole "start with the only project selected" capabilities, but otherwise looks good
17884eb to
963cfd4
Compare
963cfd4 to
2b4f928
Compare
josephsnyder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We eventually want to convert all of the models to Eloquent. The `Build` model is the largest, and most complicated, model in the CDash codebase, and it is not feasible to simply swap it out for an Eloquent-based model. In preparation for a gradual conversion to an Eloquent backend via the adapter pattern used in #1556, I have tightened the parameter and return type constraints on the legacy Build model wherever possible. By ensuring that all of the parameter and return types are known, the process of converting individual methods to Eloquent equivalents will be easier and less bug prone. While the automated test suite passes, and I didn't see any issues during some manual testing, it is quite possible that bugs associated with this PR will pop up. By opening this PR early in the release cycle, I hope to be able to catch any resulting bugs before the CDash 3.3 release comes out.
This PR is part of our ongoing effort to switch all of our models to Laravel's Eloquent ORM library. The legacy `SubProject` model has been turned into an adapter for the Eloquent-based model, using the same approach taken in #1556.

The
Projectmodel is one of the largest models in the CDash codebase, and it would be completely impractical to convert the entire thing to Eloquent at one time. Instead, I have taken an "adapter" approach similar to the approach taken in #1539, in which the public-facing interface of the old project class remains (mostly) the same, while the business logic of most methods is outsourced to the new Eloquent-based project model.In addition to switching the code to use the Eloquent-based project when possible, I have also undertaken a general refactor of the model, deleting unused code, simplifying parameters and return types, converting all database queries to Laravel's query system, and other general maintenance tasks.
I have also completely eliminated the
projectrobottable and associated code since it is currently impossible to add new data to theprojectrobottable, and the existing data is not used for anything.Given how large of a refactor this is, this PR should not be merged until after the 3.2 release branch is created.