Skip to content

Conversation

@williamjallen
Copy link
Collaborator

Recent versions of Laravel changed how database seeding is supposed to be done. This PR switches to the new format, while also cleaning up a handful of other broken factory/seeder related things.

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.

One of the changes made causes the php artisan migrate --seed to fail to complete because [DatabaseSeeder] does not exist:

php artisan db:wipe && php artisan migrate --seed

   INFO  Dropped all tables successfully.  


   INFO  Preparing database.  

  Creating migration table ............................................................................................................ 26.07ms DONE

   INFO  Running migrations.  

  2000_01_01_000000_load_from_schema ....................................................................................................... 1s DONE
  2019_06_24_140207_create_saml2_tenants_table ........................................................................................ 32.83ms DONE
  2020_10_22_140856_add_relay_state_url_column_to_saml2_tenants_table .................................................................. 4.18ms DONE
  2020_10_23_072902_add_name_id_format_column_to_saml2_tenants_table ................................................................... 2.99ms DONE
  2025_06_16_152800_decompress_test_output ............................................................................................ 16.48ms DONE
  2025_06_17_140642_drop_note_crc32 .................................................................................................... 4.26ms DONE
  2025_06_24_222844_renormalize_label2coveragefile .................................................................................... 21.66ms DONE
  2025_07_17_142900_decompress_coveragefile ............................................................................................ 5.67ms DONE
  2025_07_24_173132_coveragefilelog_bytea_to_text ...................................................................................... 5.09ms DONE
  2025_07_25_131613_coverage_view ...................................................................................................... 4.26ms DONE
  2025_07_27_214956_coverage_file_newlines ............................................................................................. 1.90ms DONE
  2025_07_30_131713_test_status_enum .................................................................................................. 12.55ms DONE
  2025_08_07_181941_test2image_test_relationship ...................................................................................... 22.85ms DONE
  2025_08_12_182732_test_id_column_type ................................................................................................ 7.22ms DONE
  2025_08_18_171650_image_id_column_type .............................................................................................. 66.07ms DONE


   INFO  Seeding database.  


In Container.php line 1045:
                                                 
  Target class [DatabaseSeeder] does not exist.  
                                                 

In Container.php line 1043:
                                         
  Class "DatabaseSeeder" does not exist  
                                         

This doesn't occur on master. I assumed it was the removal of the Artisan facade, but putting that back doesn't seem to fix it. Does it work locally for you?

@williamjallen
Copy link
Collaborator Author

@josephsnyder It's probably related to the composer.json changes. Try running composer install before trying again so the classmap is up to date.

@josephsnyder
Copy link
Member

@josephsnyder It's probably related to the composer.json changes. Try running composer install before trying again so the classmap is up to date.

@williamjallen, the branch was installed into the container via cdash_install --dev so that command was run already. An additional invocation of the command doesn't change the outcome

@williamjallen williamjallen force-pushed the database-seeder-refactor branch from fb42cb4 to b10900f Compare August 19, 2025 16:36
@williamjallen
Copy link
Collaborator Author

@josephsnyder It looks like I needed to run composer install myself to reproduce the error. The paths have been corrected so that the autoloader now works properly. Thanks for the careful testing!

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! Thanks!

One more question: how does someone expect to sign in without accessing the database first?

With the previous information set of information, one could see the login information in code and expect it to be static between cycles of wipe/seed. Now, the admin account has a non-determinant email albeit with the same password. Are they expected to create their own admin user?

@williamjallen williamjallen force-pushed the database-seeder-refactor branch from b10900f to 903a0b1 Compare August 19, 2025 17:00
@williamjallen
Copy link
Collaborator Author

@josephsnyder Good point. We should probably have some normal users with predefined credentials too. For now, I've reverted the changes to the admin user and I'll improve the fixed users in a future PR.

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.

Great. Thanks for the quick answers!

@josephsnyder josephsnyder enabled auto-merge August 19, 2025 17:12
@josephsnyder josephsnyder added this pull request to the merge queue Aug 19, 2025
Merged via the queue into Kitware:master with commit 06c34d9 Aug 19, 2025
7 checks passed
@williamjallen williamjallen deleted the database-seeder-refactor branch August 19, 2025 17:44
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