Project

General

Profile

Actions

Bug #38755

closed

skip_failure option in foreman upgrade:run rake task does not work as designed

Added by Quirin Pamp 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

We found this while making use of it here: https://github.com/Katello/katello/pull/11487#discussion_r2355640309

Reading this line here: https://github.com/theforeman/foreman/blob/develop/lib/tasks/upgrade.rake#L38

The intended design is clearly that `run_task` will return `false` if there is an error and `task.skip_failure?` is true. This will then prevent `task.mark_as_ran!` from being run in this case.

However, the false is not returned, instead we leave the if block and return true instead.

Can be tested in production using "foreman-rake upgrade:run" when a upgrade task with ":skip_failure => true, , :always_run => false" has been seeded, and the task has been manipulated to ensure it fails.

Actions

Also available in: Atom PDF