Skip to content

VCST-4696: Platform Startup Extension Point#2985

Open
OlegoO wants to merge 4 commits intodevfrom
feat/VCST-4696
Open

VCST-4696: Platform Startup Extension Point#2985
OlegoO wants to merge 4 commits intodevfrom
feat/VCST-4696

Conversation

@OlegoO
Copy link
Contributor

@OlegoO OlegoO commented Feb 26, 2026

Description

feat: Added Platform Startup Extension Point that allows modules to participate in platform startup phases before the normal IModule lifecycle begins.

References

QA-test:

Jira-link:

https://virtocommerce.atlassian.net/browse/VCST-4696

Artifact URL:


Note

Medium Risk
Touches platform bootstrapping (Program/Startup) and adds early assembly loading/resolution for module-provided startup hooks, so misconfiguration or ordering issues could affect app startup. Azure App Configuration is no longer wired directly in the web host and must be provided via the new startup hook if needed.

Overview
Introduces a new module extension point, IPlatformStartup, allowing modules to hook into host configuration, host-level service registration, app service registration, and middleware setup across three pipeline phases (EarlyMiddleware, Initialization, LateMiddleware) with explicit priority ordering.

Adds startupType to module.manifest and a PlatformStartupDiscovery utility that scans manifests, loads module assemblies from the probing path, and instantiates startup types early in Program.cs, then invokes their hooks from Program.cs and Startup.

Removes the platform’s direct Azure App Configuration integration (package reference and Use/AddAzureAppConfiguration wiring) in favor of module-provided startup implementations, and bumps coverlet.collector to 8.0.0 across test projects.

Written by Cursor Bugbot for commit ba30e59. This will update automatically on new commits. Configure here.

Image tag:
ghcr.io/VirtoCommerce/platform:3.1008.0-pr-2985-ba30-vcst-4696-ba30e598

feat: Added Platform Startup Extension Point that allows modules to participate in platform startup phases before the normal IModule lifecycle begins.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

foreach (var manifestFile in Directory.EnumerateFiles(discoveryPath, "module.manifest", SearchOption.AllDirectories))
{
// Exclude manifests from built modules artifacts
if (manifestFile.Contains("artifacts"))
Copy link

Choose a reason for hiding this comment

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

Artifacts path filter checks full path, not relative

Medium Severity

The manifestFile.Contains("artifacts") check tests the entire absolute path, unlike the equivalent code in LocalStorageModuleCatalog.cs which uses manifestFile.Substring(_discoveryPath.Length).Contains("artifacts") to only check the relative portion after the discovery path. If the discovery path itself contains "artifacts" (common in CI/CD pipelines, e.g. /build/artifacts/modules/), every manifest will be skipped and no IPlatformStartup types will be discovered.

Fix in Cursor Fix in Web

{
//Conditionally use the hangFire server for this app instance to have possibility to disable processing background jobs
if (hostingContext.Configuration.GetValue("VirtoCommerce:Hangfire:UseHangfireServer", true))
var configuration = configurationBuilder.Build();
Copy link

Choose a reason for hiding this comment

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

Unused configuration built inside ConfigureAppConfiguration callback

Low Severity

var configuration = configurationBuilder.Build() creates a configuration snapshot that is never used — the variable immediately goes out of scope. This appears to be a leftover from the removed Azure App Configuration logic. The Build() call is also wasteful since the framework will build the configuration itself after the callback returns.

Fix in Cursor Fix in Web

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 New Critical Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@sonarqubecloud
Copy link

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

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.

1 participant