Project

General

Profile

Actions

action #69997

closed

Streamline "restart" and "duplicate" routes of the REST-API

Added by mkittler about 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Feature requests
Target version:
Start date:
2020-08-13
Due date:
% Done:

0%

Estimated time:

Description

status quo

  • The "restart" route is used when one restarts a job via the web UI and therefore also the route I suggest to use when using the REST-API directly.
  • The "duplicate" route also exists but is at this point ironically almost a duplicate of the "restart" route.
  • The "duplicate" route is still used (see audit log on o3 and OSD, filter for event:job_duplicate).
    • The worker uses the "duplicate" route when a job has been aborted because the worker service is stopped.

acceptance criteria

  • AC0: Make the "duplicate" route an alias for the "restart" route using the same code internally.
  • AC1: Backwards compatibility of any route must not be broken. (Except for the event currently emitted by the "duplicate" route. It is not used and may be dropped/replaced. The parameter dup_type_auto can likely be ignored as well because it doesn't seem so have any effect anymore.)

historical remarks

According to the commits 1c7de4b2ce and 6b48bd8a72 "restart" was there before. According to git show 6b48bd8a72:lib/OpenQA/modules/Scheduler.pm "restart" meant at the time aborting the job and setting it back to scheduled. Only "duplicate" would create a new job. That explains why "duplicate" was added in the first place.

notes

  • The specific functions I'm talking about are OpenQA::WebAPI::Controller::API::V1::Job::restart and OpenQA::WebAPI::Controller::API::V1::Job::duplicate.

Related issues 1 (0 open1 closed)

Related to openQA Project - action #69871: Improve error handling when restarting jobsResolvedmkittler2020-08-11

Actions
Actions #1

Updated by mkittler about 4 years ago

  • Related to action #69871: Improve error handling when restarting jobs added
Actions #2

Updated by mkittler about 4 years ago

  • Description updated (diff)
Actions #3

Updated by livdywan about 4 years ago

It might be worth making the event work as a hot fix? Just to be able to confirm that an alias would be useful, or if we could drop it afterall... although of course it could be used on other instances as well.

Actions #4

Updated by mkittler about 4 years ago

  • Description updated (diff)
Actions #5

Updated by mkittler about 4 years ago

@cdywan I looked at the code a little bit more for the error handling ticket. I've noticed that the event is actually generated and shows up in the audit log (see updated ticket description). I've been searching for openqa_job_duplicate but it is just job_duplicate in the further occurrences.

Actions #6

Updated by mkittler about 4 years ago

  • Status changed from New to In Progress

I've been working on this issue now because when improving the error handling (see #69871) I don't want to have to care about both routes. Besides, the duplicate route missed an explicit test.

PR: https://github.com/os-autoinst/openQA/pull/3311

Actions #7

Updated by mkittler about 4 years ago

  • Assignee set to mkittler
Actions #8

Updated by okurz about 4 years ago

  • Category set to Feature requests
  • Target version set to Ready
Actions #9

Updated by mkittler about 4 years ago

  • Status changed from In Progress to Resolved

PR has been merged so I'm closing the ticket. (Reopen it if it causes any trouble in practice.)

Actions

Also available in: Atom PDF