Skip to content

refactor: Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename b2b and b2c files from '.module.ts' to '.providers.ts'"#21181

Merged
Platonn merged 7 commits intodevelopfrom
feature/CXSPA-12047
Mar 11, 2026

Conversation

@Platonn
Copy link
Copy Markdown
Contributor

@Platonn Platonn commented Feb 20, 2026

This reverts commit 70bc432.

What:

We're moving the OCC backend (and Media backend) configuration in storefrontapp from app.module.ts to spartacus-configuration.module.ts - to mimic better the fresh apps which have this config in their spartacus-configuration.module.ts.
And we extracting repeated config from spartacus-b2b-... and spartacus-b2c-configuration.module.ts to one spartacus-configuration.module.ts and moving the differing parts to renamed b2b and b2c ... .providers.ts files.

Why:

In https://jira.tools.sap/browse/CXSPA-11890 we've modernized storefrontapp to look more like a fresh app - i.e. we moved around configs between app.module, spartacus-storefront.module, spartacus-b2b-storefront.module, spartacus-b2c-storefront.module

But it turned our it broke our ec-automate-pipelines scripts, which caused deployment scripts to fail. So we quickly reverted those modernizations of storefrontapp in https://jira.tools.sap/browse/CXSPA-12046 (#21120) , to unblock the testing of the Feb2026 release, with the help of necessary deployment scripts

But now, after we're done with Feb2026 release, we'd like to bring back the modernization of the storefrontapp, and then we'll adjust the ec-automate-pipelines script.

Conflicts resolved with recent changes in develop
While applying a revert I resolved 2 conflicts with changes that were added in the meantime on develop:


Notes for adjusting ec-automate-pipelines: (generated with Opus 4.5 and human-edited)

OLD Expectations of ec-automate-pipelines:

  1. OCC BaseUrl Configuration
  • File: projects/storefrontapp/src/app/app.module.ts
  • Line pattern: baseUrl: environment.occBaseUrl
  1. B2B Configuration
  • File: spartacus-b2b-configuration.module.ts (NgModule with @NgModule({ providers: [...] }))
  • Structure: Has providers: [ array inside NgModule decorator
  • PWA config: Located IN this file
  1. B2C Configuration
  • File: spartacus-b2c-configuration.module.ts (NgModule)
  • PWA config: Located IN this file
  1. PWA Configuration Location
  • B2B: In spartacus-b2b-configuration.module.ts
  • B2C: In spartacus-b2c-configuration.module.ts
  • PWA config enabled

NEW Expectations of ec-automate-pipelines should be:

  1. OCC BaseUrl Configuration ⚠️ MOVED
  • New File: projects/storefrontapp/src/app/private/private.providers.ts
  • Old File: app.module.ts (no longer contains OCC config)
  • Line pattern: Same - baseUrl: environment.occBaseUrl
  1. B2B Configuration ⚠️ RENAMED & RESTRUCTURED
  • New File: spartacus-b2b-configuration.providers.ts
  • Old File: spartacus-b2b-configuration.module.ts (deleted)
  • Structure: Uses makeEnvironmentProviders([...]) instead of NgModule
  • PWA config: NOT in this file anymore
  1. B2C Configuration ⚠️ RENAMED & RESTRUCTURED
  • New File: spartacus-b2c-configuration.providers.ts (standalone providers function)
  • Old File: spartacus-b2c-configuration.module.ts (deleted)
  • PWA config: NOT in this file anymore
  1. PWA Configuration Location ⚠️ CENTRALIZED
  • New Location: spartacus-configuration.module.ts (single location)
  • Old Location: B2B and B2C modules separately (removed)
  • PWA config IS ALREADY DISABLED (no need to disable it with ec-automate-pipelines)!

fixes https://jira.tools.sap/browse/CXSPA-12047

…nd restore b2b- and b2c-configuration.module.ts (#21120)"

This reverts commit 70bc432.
@Platonn Platonn requested a review from a team as a code owner February 20, 2026 18:26
@github-actions github-actions bot marked this pull request as draft February 20, 2026 18:29
@github-actions
Copy link
Copy Markdown
Contributor

🚨 PR Title Validation Failed 🚨

Your pull request title does not follow the required format. Please update it to match the expected pattern:

Expected format:
<type>: <subject>

Allowed Types

  • docs: Changes to documentation only
  • feat: New feature work
  • fix: Bug fixes
  • perf: Code improvements for performance
  • refactor: Code changes that are not bug fixes or features
  • style: Code style changes (e.g., whitespace, formatting)
  • test: Adding or updating tests
  • chore: Build, CI, scripts, configs, etc.

Example of a valid PR title

feat: Add user authentication
fix: Resolve checkout bug
docs: Update API documentation

Merge is blocked until the PR title is corrected.

2 similar comments
@github-actions
Copy link
Copy Markdown
Contributor

🚨 PR Title Validation Failed 🚨

Your pull request title does not follow the required format. Please update it to match the expected pattern:

Expected format:
<type>: <subject>

Allowed Types

  • docs: Changes to documentation only
  • feat: New feature work
  • fix: Bug fixes
  • perf: Code improvements for performance
  • refactor: Code changes that are not bug fixes or features
  • style: Code style changes (e.g., whitespace, formatting)
  • test: Adding or updating tests
  • chore: Build, CI, scripts, configs, etc.

Example of a valid PR title

feat: Add user authentication
fix: Resolve checkout bug
docs: Update API documentation

Merge is blocked until the PR title is corrected.

@github-actions
Copy link
Copy Markdown
Contributor

🚨 PR Title Validation Failed 🚨

Your pull request title does not follow the required format. Please update it to match the expected pattern:

Expected format:
<type>: <subject>

Allowed Types

  • docs: Changes to documentation only
  • feat: New feature work
  • fix: Bug fixes
  • perf: Code improvements for performance
  • refactor: Code changes that are not bug fixes or features
  • style: Code style changes (e.g., whitespace, formatting)
  • test: Adding or updating tests
  • chore: Build, CI, scripts, configs, etc.

Example of a valid PR title

feat: Add user authentication
fix: Resolve checkout bug
docs: Update API documentation

Merge is blocked until the PR title is corrected.

@Platonn Platonn changed the title Revert "fix: move back storefrontapp occ config to 'app.module.ts', and restore b2b- and b2c-configuration.module.ts (#21120)" Move storefrontapp occ config from 'app.module.ts' to private.providers.ts, centralize common configs of b2b- and b2c- into one configuration.module.ts, extract b2b- and b2c- providers to separate files (#21120)" Feb 20, 2026
@Platonn Platonn changed the title Move storefrontapp occ config from 'app.module.ts' to private.providers.ts, centralize common configs of b2b- and b2c- into one configuration.module.ts, extract b2b- and b2c- providers to separate files (#21120)" Move storefrontapp occ config to ;private.providers.ts', centralize common configs of b2b- and b2c- in one file, rename files from .module.ts to .providers.ts (#21120)" Feb 20, 2026
@Platonn Platonn changed the title Move storefrontapp occ config to ;private.providers.ts', centralize common configs of b2b- and b2c- in one file, rename files from .module.ts to .providers.ts (#21120)" Move storefrontapp occ config to 'private.providers.ts', centralize common configs of b2b- and b2c- in one file, rename files from .module.ts to .providers.ts (#21120)" Feb 20, 2026
@Platonn Platonn changed the title Move storefrontapp occ config to 'private.providers.ts', centralize common configs of b2b- and b2c- in one file, rename files from .module.ts to .providers.ts (#21120)" Move storefrontapp occ config to 'private.providers.ts', centralize common configs of b2b and b2c in one file, rename files from .module.ts to .providers.ts (#21120)" Feb 20, 2026
@Platonn Platonn changed the title Move storefrontapp occ config to 'private.providers.ts', centralize common configs of b2b and b2c in one file, rename files from .module.ts to .providers.ts (#21120)" Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename files from .module.ts to .providers.ts (#21120)" Feb 20, 2026
@Platonn Platonn changed the title Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename files from .module.ts to .providers.ts (#21120)" Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename b2b and b2c files from .module.ts to .providers.ts (#21120)" Feb 20, 2026
@Platonn Platonn changed the title Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename b2b and b2c files from .module.ts to .providers.ts (#21120)" Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename b2b and b2c files from '.module.ts' to '.providers.ts' (#21120)" Feb 20, 2026
@Platonn Platonn changed the title Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename b2b and b2c files from '.module.ts' to '.providers.ts' (#21120)" Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename b2b and b2c files from '.module.ts' to '.providers.ts'" Feb 20, 2026
Copy link
Copy Markdown
Contributor

@pawelfras pawelfras left a comment

Choose a reason for hiding this comment

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

Only now I realised that we have ci-scripts/update-ccv2.sh file that also refers to modules with configurations. Let's double-check (ideally with one of release masters) if the script is still in use and provide the following adjustments, if needed:

  • Change APP_MODULE_PATH to projects/storefrontapp/src/app/private/private.providers.ts
  • Update B2B_CONFIG_PATH to projects/storefrontapp/src/app/spartacus/spartacus-b2b-configuration.providers.ts
  • Update B2C_CONFIG_PATH to projects/storefrontapp/src/app/spartacus/spartacus-b2c-configuration.providers.ts
  • Adjust PWA config handling logic (now centralized in spartacus-configuration.module.ts)

@Platonn Platonn changed the title Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename b2b and b2c files from '.module.ts' to '.providers.ts'" refactor: Move storefrontapp occ config to 'private.providers.ts'; centralize common configs of b2b and b2c in one file; rename b2b and b2c files from '.module.ts' to '.providers.ts'" Feb 23, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
@SAP SAP deleted a comment from github-actions bot Mar 5, 2026
Copy link
Copy Markdown
Contributor

@pawelfras pawelfras left a comment

Choose a reason for hiding this comment

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

LGTM. As discussed, let's inform other teams, so they can adjust CCv2 deployment scripts accordingly.

@Platonn Platonn marked this pull request as ready for review March 9, 2026 14:13
@cypress
Copy link
Copy Markdown

cypress bot commented Mar 9, 2026

spartacus    Run #52207

Run Properties:  status check passed Passed #52207  •  git commit 6e05c3ff86 ℹ️: Merge 92c3979494e461a458464ee4e43f2a1642518d17 into 17f76f66a73d2aba5929b3616960...
Project spartacus
Branch Review feature/CXSPA-12047
Run status status check passed Passed #52207
Run duration 03m 20s
Commit git commit 6e05c3ff86 ℹ️: Merge 92c3979494e461a458464ee4e43f2a1642518d17 into 17f76f66a73d2aba5929b3616960...
Committer Krzysztof Platis
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 101
View all changes introduced in this branch ↗︎

@github-actions github-actions bot marked this pull request as draft March 10, 2026 14:01
@Platonn Platonn marked this pull request as ready for review March 11, 2026 09:08
@Platonn Platonn merged commit 25312b2 into develop Mar 11, 2026
38 checks passed
@Platonn Platonn deleted the feature/CXSPA-12047 branch March 11, 2026 09:51
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