[Refactor:System] Daemon job queue path from config#12558
Conversation
Replace hardcoded /var/local/submitty/daemon_job_queue/ string literals with FileUtils::joinPaths($this->core->getConfig()->getSubmittyPath(), "daemon_job_queue") across all PHP controllers and models. Also resolves the FIXME in AdminGradeableController::enqueueGenerateRepos by adding a $submittyPath parameter to the static method and updating all five call sites. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi @prestoncarman, Thank you for contributing to Submitty by opening a pull request! Please check that your PR follows our guidelines for How to Make a Pull Request and that you have provided the information requested in our pull request template. If your pull request is incomplete, insufficiently documented, or untested it may be closed by maintainers. We encourage you to join our Zulip server to discuss your PR, bug reports, and technical implementation questions with other contributers and maintainers. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12558 +/- ##
=========================================
Coverage 21.66% 21.66%
Complexity 9638 9638
=========================================
Files 268 268
Lines 36233 36226 -7
Branches 486 486
=========================================
Hits 7849 7849
+ Misses 27902 27895 -7
Partials 482 482
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Why is this Change Important & Necessary?
Several PHP controllers hardcoded /var/local/submitty/daemon_job_queue/ as a string literal rather than deriving the path from configuration. This means the path is duplicated across the codebase and would silently break if submitty_data_dir is ever configured to a non-default location. AdminGradeableController::enqueueGenerateRepos even had an existing FIXME comment acknowledging the problem.
What is the New Behavior?
All daemon job queue paths are now constructed using FileUtils::joinPaths($this->core->getConfig()->getSubmittyPath(), "daemon_job_queue"), consistent with the pattern already used in SubmissionController. The static method enqueueGenerateRepos now accepts a $submittyPath parameter, and all five call sites have been updated to pass $config->getSubmittyPath().
Files changed:
What steps should a reviewer take to reproduce or test the bug or new feature?
Automated Testing & Documentation
No new automated tests added. The changed code paths are covered by existing integration tests that exercise course creation, gradeable building, and submission. No documentation changes required — this is an internal refactor with no user-visible behavior change.
Other information
Not a breaking change. No migrations required. No security concerns — the change only affects how the path is constructed, not what the path resolves to on a standard installation.
Generated with Claude Code