Skip to content

N°9565 - Extension Mgmt : display progression during analysis#975

Open
Lenaick wants to merge 5 commits into
developfrom
feature/9565-extension-mgmt-use-progress-bar-for-analysis
Open

N°9565 - Extension Mgmt : display progression during analysis#975
Lenaick wants to merge 5 commits into
developfrom
feature/9565-extension-mgmt-use-progress-bar-for-analysis

Conversation

@Lenaick

@Lenaick Lenaick commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

N°9565 - Extension Mgmt : display progression during analysis

Copilot AI review requested due to automatic review settings July 17, 2026 08:40

Copilot AI left a comment

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.

Pull request overview

Moves extension-removal compilation and auditing to asynchronous operations with progress feedback.

Changes:

  • Adds AJAX compilation and audit workflows.
  • Persists setup state through session parameters.
  • Adds progress, success, error, and empty-result UI messaging.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
sources/Service/Session/SessionParameters.php Avoids unchanged session writes.
setup/wizardsteps/WizStepLandingBeforeAudit.php Reuses session-backed setup parameters.
setup/setuputils.class.inc.php Updates feature-removal return routing.
datamodels/2.x/combodo-data-feature-removal/templates/Features.html.twig Updates return-application identifier.
datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.ready.js.twig Runs compilation and audit asynchronously.
datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig Displays progress and AJAX results.
datamodels/2.x/combodo-data-feature-removal/templates/AjaxRunAudit.html.twig Renders audit and cleanup results.
datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php Implements AJAX operations and session-backed cleanup state.
datamodels/2.x/combodo-data-feature-removal/dictionaries/fr.dict.combodo-data-feature-removal.php Adds French progress messages.
datamodels/2.x/combodo-data-feature-removal/dictionaries/en.dict.combodo-data-feature-removal.php Adds English progress messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread datamodels/2.x/combodo-data-feature-removal/templates/AjaxRunAudit.html.twig Outdated
Comment thread sources/Service/Session/SessionParameters.php Outdated
@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the synchronous compile-then-audit page render with a two-step AJAX pipeline (ajax_compileajax_run_audit), showing live progress indicators to the user while each long-running step executes. Parameters that were previously POSTed as hidden form inputs are now persisted in SessionParameters and read back by each AJAX endpoint.

  • New async flow: AnalysisResult.ready.js.twig chains compile and audit calls, unhiding spinner/success/error alert slots as each step resolves; AjaxRunAudit.html.twig renders the deletion-plan or no-cleanup result injected into the page without a full reload.
  • Parameter migration: OperationAnalysisResult seeds SessionParameters with extension/module selections; OperationAjaxCompile computes and stores selected_modules; OperationAjaxRunAudit stores classes and renders the audit result as HTML (errors fall back to a JSON response).
  • Wizard identifier rename: setuputils.class.inc.php updates the GetBackButtonInfo switch from 'itop' to 'DataFeatureRemoval', matching the new value written to the session in OperationMain.

Confidence Score: 3/5

The AJAX progress display works correctly, but the refactored parameter-passing to the setup wizard is incomplete and will cause the installation wizard to proceed with empty module/extension selections.

All SavePostedParameter calls for selected_modules, selected_extensions, added_extensions, removed_extensions, target_env, use_symbolic_links, and force-uninstall were removed from WizStepLandingBeforeAudit. These values now live only in SessionParameters, but neither the launch-setup form posts them nor does WizStepLandingBeforeAudit copy them into the wizard parameter store. Wizard steps that call GetParameter('selected_extensions') will receive '[]', so installation proceeds as if no extension changes were requested.

setup/wizardsteps/WizStepLandingBeforeAudit.php — the else branch needs to transfer the relevant parameters from SessionParameters into wizard context before returning WizStepDataAudit.

Important Files Changed

Filename Overview
setup/wizardsteps/WizStepLandingBeforeAudit.php Removed all SavePostedParameter calls for extension/module parameters; the else branch now only saves copy_setup_files, so wizard steps that depend on selected_modules, selected_extensions, etc. will receive empty defaults.
datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php Refactored compile and audit into two separate AJAX operations (OperationAjaxCompile, OperationAjaxRunAudit); parameters migrated from POST-based to SessionParameters; success_message is always emitted even on error.
datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.ready.js.twig New JS template: chains ajax_compile() to ajax_run_audit() with in-progress/success/error indicators; both .fail() handlers correctly hide spinners.
datamodels/2.x/combodo-data-feature-removal/templates/AjaxRunAudit.html.twig New template for the AJAX audit result: renders deletion plan table or no-cleanup success message with a launch-setup form.
datamodels/2.x/combodo-data-feature-removal/templates/AnalysisResult.html.twig Refactored to show extension diff summary and AJAX progress placeholders immediately; compile/audit result injected asynchronously into #ajax_run_audit.
sources/Service/Session/SessionParameters.php Added a short-circuit optimization in SetParameter to skip the session write when value is unchanged; safe for both scalars and arrays.
setup/setuputils.class.inc.php Renames the return_application switch case from 'itop' to 'DataFeatureRemoval' to match the new session parameter value set by OperationMain().

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Browser
    participant DFR as DataFeatureRemovalController
    participant Session as SessionParameters
    participant Wizard as WizStepLandingBeforeAudit

    Browser->>DFR: GET OperationAnalysisResult
    DFR->>Session: Seed extension/module params
    DFR-->>Browser: AnalysisResult.html + JS

    Browser->>DFR: POST ajax_compile
    DFR->>Session: Read selected_extensions
    DFR->>DFR: DoCompile()
    DFR->>Session: SetParameter(selected_modules)
    DFR-->>Browser: JSON success or error

    alt Compile OK
        Browser->>DFR: POST ajax_run_audit
        DFR->>DFR: RunDataAudit()
        DFR->>Session: SetParameter(classes)
        DFR-->>Browser: HTML AjaxRunAudit

        alt Deletion needed
            Browser->>DFR: POST DoDeletion
            DFR->>Session: Read classes
            DFR->>DFR: ExecuteCleanup()
            DFR-->>Browser: Redirect OperationAnalysisResult
        else No deletion needed
            Browser->>Wizard: "POST _class=WizStepLandingBeforeAudit"
            Note over Wizard: selected_modules / selected_extensions NOT in wizard params
            Wizard-->>Browser: WizStepDataAudit
        end
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Browser
    participant DFR as DataFeatureRemovalController
    participant Session as SessionParameters
    participant Wizard as WizStepLandingBeforeAudit

    Browser->>DFR: GET OperationAnalysisResult
    DFR->>Session: Seed extension/module params
    DFR-->>Browser: AnalysisResult.html + JS

    Browser->>DFR: POST ajax_compile
    DFR->>Session: Read selected_extensions
    DFR->>DFR: DoCompile()
    DFR->>Session: SetParameter(selected_modules)
    DFR-->>Browser: JSON success or error

    alt Compile OK
        Browser->>DFR: POST ajax_run_audit
        DFR->>DFR: RunDataAudit()
        DFR->>Session: SetParameter(classes)
        DFR-->>Browser: HTML AjaxRunAudit

        alt Deletion needed
            Browser->>DFR: POST DoDeletion
            DFR->>Session: Read classes
            DFR->>DFR: ExecuteCleanup()
            DFR-->>Browser: Redirect OperationAnalysisResult
        else No deletion needed
            Browser->>Wizard: "POST _class=WizStepLandingBeforeAudit"
            Note over Wizard: selected_modules / selected_extensions NOT in wizard params
            Wizard-->>Browser: WizStepDataAudit
        end
    end
Loading

Reviews (3): Last reviewed commit: "N°9565 - Extension Mgmt : display progre..." | Re-trigger Greptile

@Lenaick
Lenaick force-pushed the feature/9565-extension-mgmt-use-progress-bar-for-analysis branch from bc5c77a to f31e7df Compare July 17, 2026 09:42
Comment thread setup/wizardsteps/WizStepLandingBeforeAudit.php
Comment thread datamodels/2.x/combodo-data-feature-removal/templates/AjaxRunAudit.html.twig Outdated
@Lenaick
Lenaick requested review from Timmy38, eespie and odain-cbd July 17, 2026 14:07
@Lenaick
Lenaick force-pushed the feature/9565-extension-mgmt-use-progress-bar-for-analysis branch from 6b068cd to 6bae7b8 Compare July 17, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants