fix(cron): pass arguments to job scripts#20354
Open
leprincep35700 wants to merge 1 commit into
Open
Conversation
e1ed3c5 to
cdccc19
Compare
Contributor
Author
|
CI note after the latest run:
Happy to rebase and re-run once the base test suite is green if that helps review. |
25 tasks
cdccc19 to
f90dd81
Compare
f90dd81 to
bd4ddec
Compare
This was referenced May 20, 2026
bd4ddec to
7995b9c
Compare
Contributor
Author
|
Branch refreshed onto current
GitHub now shows the PR as clean with successful current checks. |
Contributor
Author
|
Current-main reassessment: I rechecked this against current Conclusion: still useful and still clean. What current main still lacks:
Current update status:
Recommendation:
|
2f626df to
f5f3a41
Compare
Contributor
Author
|
Rebased onto current
|
f5f3a41 to
fb91c43
Compare
fb91c43 to
b0f6c44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scriptentries withshlex.split()so a script path can be followed by CLI arguments.Why this shape
Cron scripts are already configured as a single string, and users can reasonably write values such as
memory-ttl.py expireormonitor.py --check-only. Previously_run_job_script()treated the entire string as the filename, so the script either failed lookup or ran without the intended mode depending on how it was configured downstream.Using
shlex.split()keeps quoted arguments predictable while preserving the existing explicit interpreter selection and path containment model.Testing
/opt/venv/bin/python -m py_compile cron/scheduler.py tests/cron/test_cron_script.py scripts/release.py/opt/venv/bin/python -m pytest tests/cron/test_cron_script.py::TestRunJobScript tests/cron/test_cron_script.py::TestScriptPathContainment tests/cron/test_cron_no_agent.py -q -o addopts=''Result:
35 passed, 1 warning.Notes for maintainers
This is intentionally limited to script argument parsing and does not change the trust boundary: the executable script itself still has to resolve inside
HERMES_HOME/scripts/before it runs.Closes #20300.