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 4 months ago. Updated 4 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 #1

Updated by Quirin Pamp 4 months ago

I expect this bug was never an issue, because no one has used the combination of options where it occurs.

Actions #2

Updated by The Foreman Bot 4 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/10693 added
Actions #3

Updated by The Foreman Bot 4 months ago

  • Fixed in Releases 3.17.0 added
Actions #4

Updated by Quirin Pamp 4 months ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF