Page MenuHomePhabricator

[jobs-api,jobs-cli] `toolforge jobs load` uses PATCH for one-off jobs too
Closed, ResolvedPublic

Description

Updating one-off jobs is currently disabled as they are not stored in storage, so instead we should either move them to storage (and change the flows for them) or on the cli call POST instead of PATCH for one-off jobs.

Event Timeline

dcaro changed the task status from Open to In Progress.Mon, Jul 20, 1:17 PM
dcaro claimed this task.
dcaro triaged this task as High priority.
dcaro moved this task from Backlog to In review on the tools-platform-team board.

I'm trying to use this jobs.yaml file to start the one-off job defined in that file but I'm getting the following error:

tools.wikidata-geo-dumps@tools-bastion-15:~/wikidata-geo-dumps/toolforge$ toolforge jobs list
+-----------------------------+-------------------+------------------------------------------+
|          Job name:          |     Job type:     |                 Status:                  |
+-----------------------------+-------------------+------------------------------------------+
| wikidata-geo-dumps-generate | scheduled: @daily | Last schedule time: 2026-07-20T11:50:00Z |
+-----------------------------+-------------------+------------------------------------------+
tools.wikidata-geo-dumps@tools-bastion-15:~/wikidata-geo-dumps/toolforge$ toolforge-jobs load jobs.yaml
INFO: loading job 'wikidata-geo-dumps-generate'...
Job wikidata-geo-dumps-generate is already up to date
INFO: loading job 'wikidata-geo-dumps-test'...
OneOffJobs can't be updated, delete and recreate it instead
INFO: 2 job(s) loaded successfully
tools.wikidata-geo-dumps@tools-bastion-15:~/wikidata-geo-dumps/toolforge$ toolforge jobs delete wikidata-geo-dumps-test
ERROR: Job 'wikidata-geo-dumps-test' does not exist

So the list and delete commands are saying that the job 'wikidata-geo-dumps-test' does not exist but despite that load is returning an error OneOffJobs can't be updated, delete and recreate it instead as if the job already existed, which is incosistent.
Is this bug caused by the object of this task? Or should I open another task?

That is exactly the bug this task covers.

You can execute a toolforge jobs run passing the same options that are in the yaml to create the job in the meantime.

dcaro moved this task from In review to Done on the tools-platform-team board.

Done!