Skip to content

Conversation

@williamjallen
Copy link
Collaborator

The Project model 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 projectrobot table and associated code since it is currently impossible to add new data to the projectrobot table, 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.

@williamjallen williamjallen force-pushed the eloquent-project-model branch from af08ed3 to ea1b956 Compare July 12, 2023 14:10
@williamjallen williamjallen marked this pull request as draft July 12, 2023 21:13
@williamjallen
Copy link
Collaborator Author

I have marked this PR as a draft because it should not be merged until after the CDash 3.2 release is created.

@williamjallen williamjallen force-pushed the eloquent-project-model branch from ea1b956 to 6c61a9a Compare July 20, 2023 12:01
@williamjallen williamjallen force-pushed the eloquent-project-model branch from 6c61a9a to 74fe199 Compare August 14, 2023 16:34
@williamjallen williamjallen marked this pull request as ready for review August 14, 2023 16:35
@williamjallen
Copy link
Collaborator Author

The CDash 3.2 release branch has been created, and we can now proceed with CDash 3.3 PRs such as this one.

@williamjallen williamjallen force-pushed the eloquent-project-model branch 2 times, most recently from 070487a to 17884eb Compare August 15, 2023 22:36
Copy link
Member

@josephsnyder josephsnyder left a 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

@williamjallen williamjallen force-pushed the eloquent-project-model branch from 17884eb to 963cfd4 Compare August 17, 2023 19:05
Copy link
Member

@josephsnyder josephsnyder left a comment

Choose a reason for hiding this comment

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

Much better. Some inconsistent behavior if one tries to visit the pages without any projects created at all:
image

but I'm not going to lose any sleep over that,

@josephsnyder josephsnyder enabled auto-merge August 17, 2023 19:28
@josephsnyder josephsnyder added this pull request to the merge queue Aug 17, 2023
Merged via the queue into Kitware:master with commit f3bb624 Aug 17, 2023
@williamjallen williamjallen deleted the eloquent-project-model branch August 17, 2023 20:34
github-merge-queue bot pushed a commit that referenced this pull request Sep 1, 2023
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.
github-merge-queue bot pushed a commit that referenced this pull request Sep 8, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants