Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

enh(core): better manage exceptions and upgrade failure #8234

Merged
merged 20 commits into from
Jan 14, 2020

Conversation

sc979
Copy link
Contributor

@sc979 sc979 commented Jan 3, 2020

Pull Request Template

Description

1 - Add transactions / rollback mechanism to avoid to corrupt database on upgrade failure.
2 - Improve exception throwed and log messages on update

Fixes # (none)

Before :
image

Or infinite loop ->
image

After :
image

Adding the specific log file : "/var/log/centreon/upgrade.log" / called using the insertLog method with the id 4 :
image

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • Updating documentation (missing information, typo...)

Target serie

  • 2.8.x
  • 18.10.x
  • 19.04.x
  • 19.10.x
  • 20.04.x (master)

How this pull request can be tested ?

Create condition for an exception to be throwed and check that the proper message is displayed in the IHM.

Checklist

Community contributors & Centreon team

  • I followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have made corresponding changes to the documentation.
  • I have rebased my development branch on the base branch (master, maintenance).

Centreon team only

  • I have made sure that the unit tests related to the story are successful.
  • I have made sure that unit tests cover 80% of the code written for the story.
  • I have made sure that acceptance tests related to the story are successful (local and CI)

@sc979 sc979 requested a review from callapa January 3, 2020 11:54
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
@sc979 sc979 marked this pull request as ready for review January 3, 2020 15:56
@sc979 sc979 requested review from kduret and loiclau January 3, 2020 15:56
www/install/php/Update-20.04.0-beta.1.php Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
www/install/php/Update-20.04.0-beta.1.php Outdated Show resolved Hide resolved
@sc979 sc979 force-pushed the MON-update-using-transactions branch from 822128a to 188cfce Compare January 6, 2020 13:50
@sc979 sc979 requested review from kduret and callapa January 7, 2020 08:19
@sc979 sc979 merged commit 3ab0d8b into master Jan 14, 2020
@sc979 sc979 deleted the MON-update-using-transactions branch January 14, 2020 12:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants