Repository navigation
Conversation
validate_user() accepts a uid of 0, but create stored NULL for it (if ( $user )), update refused it alone with "You should specify at least one..." and ignored it next to other options, and the config.ini template's {{#user}} section skips "0" because Mustache treats it as false. The user is now tested for presence, the template renders it through a has_user flag, and the host and run-now paths no longer treat a stored "0" as no user.
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
--user=0(a valid uid fordocker exec) passedvalidate_user()but was then lost to PHP and Mustache truthiness:createstored NULL,update <id> --user=0alone failed with "You should specify at least one...", and next to other options it was silently ignored. Theconfig.initemplate's{{#user}}section also skipped a stored0.The user is now tested for presence instead of truthiness in
createandupdate, the template renders it through ahas_userflag, and the host andrun-nowpaths no longer treat a stored0as no user.Tested with PHPUnit on PHP 7.4 and 8.5: create stores and renders user 0, update accepts it alone and with other options, updating another field keeps it, moving the job to the host drops it, and
run-nowuses it.Summary by CodeRabbit
0when creating or updating site jobs.rootonly when a job has no user set.