Skip to content

N°9678 - Datamodel not added after extension management setup#936

Open
odain-cbd wants to merge 5 commits into
developfrom
issue/9678-fixchoosenextensions
Open

N°9678 - Datamodel not added after extension management setup#936
odain-cbd wants to merge 5 commits into
developfrom
issue/9678-fixchoosenextensions

Conversation

@odain-cbd

Copy link
Copy Markdown
Contributor

No description provided.

@odain-cbd odain-cbd requested review from Lenaick and eespie June 11, 2026 11:21
@odain-cbd odain-cbd self-assigned this Jun 11, 2026
@odain-cbd odain-cbd added the internal Work made by Combodo label Jun 11, 2026
@greptile-apps

greptile-apps Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR centralizes extension map discovery and adjusts setup compilation paths. The main changes are:

  • Replaces direct iTopExtensionsMap construction with a shared factory.
  • Tracks scanned module root directories on the extension map.
  • Updates setup and data-audit compilation to use selected extensions and modules differently.
  • Adds feature-removal coverage for newly added extensions during dry removal.
  • Updates setup unit tests and fixtures around extension maps and compilation.

Confidence Score: 3/5

This should be fixed before merging.

  • The data-audit compile path can ignore the wizard-selected source tree.
  • Upgrade checks can run against the wrong datamodel roots.
  • The previously reported Hub download issue still affects an extension install path.

setup/runtimeenv.class.inc.php

Reviews (4): Last reviewed commit: "N°9678 - Refactor data model compilation..." | Re-trigger Greptile

Comment thread setup/runtimeenv.class.inc.php Outdated
@odain-cbd odain-cbd closed this Jun 11, 2026
Comment thread setup/extensionsmap.class.inc.php Outdated
@odain-cbd odain-cbd reopened this Jun 11, 2026
@odain-cbd odain-cbd closed this Jun 15, 2026
@odain-cbd odain-cbd reopened this Jun 15, 2026
Comment thread datamodels/2.x/itop-hub-connector/land.php
@eespie eespie closed this Jun 16, 2026
@eespie eespie reopened this Jun 16, 2026
@eespie eespie closed this Jun 16, 2026
@eespie eespie reopened this Jun 16, 2026
Comment on lines 1452 to +1492
@@ -1481,7 +1459,7 @@ public function DoCompile(array $aSelectedExtensionCodes, array $aRemovedExtensi
$aNoCodeExtensionLabelsThatBreakSetup = [];
foreach ($oExtensionsMap->GetAllExtensions() as $oExtension) {
if (in_array($oExtension->sCode, $aSelectedExtensionCodes)) {
$oExtension->bMarkedAsChosen = true;
$oExtension->MarkAsChosen();
}

if (empty($oExtension->sCode)) {
@@ -1493,7 +1471,7 @@ public function DoCompile(array $aSelectedExtensionCodes, array $aRemovedExtensi
$aNoCodeExtensionSourceDirs [$sExtensionLabel] = $oExtension->sSourceDir;
}

if ($oExtension->bMarkedAsChosen) {
if ($oExtension->IsMarkedAsChosen()) {
$aNoCodeExtensionLabelsThatBreakSetup[] = $sExtensionLabel;
$bSetupFailure = true;
}
@@ -1511,7 +1489,7 @@ public function DoCompile(array $aSelectedExtensionCodes, array $aRemovedExtensi
}
}

$oFactory = new ModelFactory($aDirsToScan);
$oFactory = new ModelFactory($oExtensionsMap->GetScannedModulesRootDirs());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Compile roots ignored

DoCompile() now builds both the extension map and ModelFactory from the cached map for the final environment. That map only scans the default roots for that environment, while the setup step still collects source_dir and extensions_dir from the wizard. In an upgrade or data-audit run that points source_dir at a previous installation tree, this path compiles modules from the current app roots instead of the selected source tree, so the audit can run against the wrong datamodel and miss or add classes incorrectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants