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

Convert backend of SubProject model to Eloquent #1695

Merged

Conversation

williamjallen
Copy link
Collaborator

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.

@josephsnyder josephsnyder added this pull request to the merge queue Sep 8, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 8, 2023
@josephsnyder
Copy link
Member

@williamjallen, looks like it could use a rebase when you have the time:

Merge queue failed due to phpstan:

------ ----------------------------------------------------------------------- 
9:   Line   app/cdash/app/Model/SubProject.php                                     
9:  ------ ----------------------------------------------------------------------- 
9:          Ignored error pattern #^Method                                         
9:          CDash\\Model\\SubProject\:\:AddDependency\(\) throws checked           
9:          exception Illuminate\\Database\\Eloquent\\ModelNotFoundException but   
9:          it's missing from the PHPDoc @throws tag\.$# in path                   
9:          /cdash/app/cdash/app/Model/SubProject.php was not matched in reported  
9:          errors.                                                                
9:          Ignored error pattern #^Method CDash\\Model\\SubProject\:\:Delete\(\)  
9:          throws checked exception                                               
9:          Illuminate\\Database\\Eloquent\\ModelNotFoundException but it's        
9:          missing from the PHPDoc @throws tag\.$# in path                        
9:          /cdash/app/cdash/app/Model/SubProject.php was not matched in reported  
9:          errors.                                                                
9:          Ignored error pattern #^Method CDash\\Model\\SubProject\:\:Delete\(\)  
9:          throws checked exception LogicException but it's missing from the      
9:          PHPDoc @throws tag\.$# in path                                         
9:          /cdash/app/cdash/app/Model/SubProject.php was not matched in reported  
9:          errors.                                                                
9:          Ignored error pattern #^Method CDash\\Model\\SubProject\:\:Fill\(\)    
9:          throws checked exception                                               
9:          Illuminate\\Database\\Eloquent\\ModelNotFoundException but it's        
9:          missing from the PHPDoc @throws tag\.$# in path                        
9:          /cdash/app/cdash/app/Model/SubProject.php was not matched in reported  
9:          errors.                                                                
9:          Ignored error pattern #^Method                                         
9:          CDash\\Model\\SubProject\:\:GetDependencies\(\) throws checked         
9:          exception Illuminate\\Database\\Eloquent\\ModelNotFoundException but   
9:          it's missing from the PHPDoc @throws tag\.$# in path                   
9:          /cdash/app/cdash/app/Model/SubProject.php was not matched in reported  
9:          errors.                                                                
9:          Ignored error pattern #^Method                                         
9:          CDash\\Model\\SubProject\:\:RemoveDependency\(\) throws checked        
9:          exception Illuminate\\Database\\Eloquent\\ModelNotFoundException but   
9:          it's missing from the PHPDoc @throws tag\.$# in path                   
9:          /cdash/app/cdash/app/Model/SubProject.php was not matched in reported  
9:          errors.                                                                
9:  ------ ----------------------------------------------------------------------- 
9: 
9: 
9:  [ERROR] Found 6 errors                                                         
9: 
  9/230 Test   #9: php_static_analysis .............................................***Failed   83.28 sec

@williamjallen williamjallen added this pull request to the merge queue Sep 8, 2023
Merged via the queue into Kitware:master with commit b8ad26d Sep 8, 2023
2 checks passed
@williamjallen williamjallen deleted the subproject-eloquent-model branch September 8, 2023 16:12
github-merge-queue bot pushed a commit that referenced this pull request Sep 13, 2023
#1695 created an Eloquent-based `SubProject` model, but did not attempt
to change existing usages of the legacy model. This is a small follow-up
PR which expands the usage of the project-subproject relationship to
gain access to subprojects through the eloquent-based project model.
Amongst other things, this change should make a few pages slightly
faster by reducing the number of database queries executed when
iterating over subprojects. This PR also unifies the logic for
determining which subprojects were active on a given date. It is
probable that the prior inconsistent logic caused unexpected behavior in
rare cases.

I intend to work on subproject <-> build relationships in a future PR.
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