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

feat(api): endpoint for centreon web upgrade #11307

Merged
merged 28 commits into from
Jul 5, 2022
Merged

Conversation

kduret
Copy link
Contributor

@kduret kduret commented Jun 29, 2022

Description

add endpoint for centreon web upgrade
this allows to execute all upgrade scripts in a single time via api

next steps :

  • lock upgrade to avoid simultaneous upgrades
  • check prerequisites (mariadb & php)
  • remove install dir at end of install

Fixes MON-12296

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

Target serie

  • 21.04.x
  • 21.10.x
  • 22.04.x
  • 22.10.x (master)

@kduret kduret changed the base branch from develop to MON-12296 July 1, 2022 13:47
@kduret kduret marked this pull request as ready for review July 1, 2022 13:48
@kduret kduret requested review from a team, adr-mo and TamazC and removed request for a team July 1, 2022 13:48
@kduret kduret changed the title feat(api): endpoint skeleton for centreon web upgrade feat(api): endpoint for centreon web upgrade Jul 1, 2022
class LegacyWriteVersionRepository extends AbstractRepositoryDRB implements WriteVersionRepositoryInterface
{
use LoggerTrait;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you could define a constant INSTALL_DIR = '''; and use them in different methods ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* @param string $filePath
* @return void
*/
private function runSqlFile(string $filePath): void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method has a high cyclomatic complexity and could be refactored

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just refactored most of the code by splitting in private methods

…sions.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>
@sonarqube-decoration
Copy link

@TamazC TamazC merged commit b8589b3 into MON-12296 Jul 5, 2022
@TamazC TamazC deleted the MON-12296-updates branch July 5, 2022 16:13
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.

5 participants