Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CXCDS-14100: move SCI configuration from .env to schematics-config #19952

Merged
merged 8 commits into from
Feb 7, 2025

Conversation

johannathalmann-SAP
Copy link
Contributor

The value of "sciEnabled" should not be defined in .env_cdmrc file, as that's only available for developers. Instead, it needs to be configured when setting up cds from libs.

@johannathalmann-SAP johannathalmann-SAP marked this pull request as ready for review February 2, 2025 09:16
@johannathalmann-SAP johannathalmann-SAP requested review from a team as code owners February 2, 2025 09:16
Copy link

cypress bot commented Feb 2, 2025

spartacus    Run #46975

Run Properties:  status check passed Passed #46975  •  git commit 14c30e6760 ℹ️: Merge 77f425aa8acc4715c70379b9bf9a640b04bcf174 into b0d19eb4be3561d7bcec8e09b250...
Project spartacus
Branch Review bugfix/CXCDS-14100
Run status status check passed Passed #46975
Run duration 12m 18s
Commit git commit 14c30e6760 ℹ️: Merge 77f425aa8acc4715c70379b9bf9a640b04bcf174 into b0d19eb4be3561d7bcec8e09b250...
Committer johannathalmann-SAP
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 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 125
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@github-actions github-actions bot marked this pull request as draft February 3, 2025 08:15
klucerofermin
klucerofermin previously approved these changes Feb 4, 2025
"sciEnabled": {
"type": "boolean",
"description": "CDS/ISS is integrated into the SAP Cloud Identity Service (SCI). The downstream services use different domains and URL formats. To enable SCI, enable this parameter and make sure to use the proper profile tag urls (see documentation).",
"default": false,
Copy link
Contributor

Choose a reason for hiding this comment

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

[Business question]
I understand we don't want to enable SCI in existing applications, but rather let customers enable it by themselves

But do we really want to disable by default SCI in fresh new applications created by customers? My gut feeling is we'd like new apps to use newest features OOTB. But you know better the business context here, so I'm happy to learn your poiunt of view.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SCI support for ISS will be activated a little bit later - we’re still in extensive test phase for that (that’s also why we need to be able to activate it already for our test installations)
But you are right, after SCI is fully integrated into ISS, we could think about making it the default for new setups.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you. Now I get better the business context.

Do I understand correctly that eventually when we like customers to enable the SCI feature, THEY will have to:

  • manually change the endpoints configuration config.cds.endpoints in their CdsFeatureModule in their apps?
  • they can keep the config config.cds.profileTag.sciEnabled false in their CdsFeatureModule in their apps, becasue it is (and will be?) a dead config

btw. as of today new apps crated with schematics will put the config config.cds.profileTag.sciEnabled explicitly in customers' apps' CdsFeatureModule and [set it there to false](https://github.com/SAP/spartacus/pull/19952/files#diff-924178d81edea4b6d2638cbf2f6783c4a120785a01d00a833ff3dd21c53882e9R110). But it seems to be a dead config (as noted in another comment https://github.com//pull/19952/files#r1940901467) - which I believe can be misleading for customers. Changing this config will have no effect for them, right? So I still struggle to understand why we want to expose this config. Perhaps I'm missing something obvious important - then please help me understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Customers who enable SCI, during their setup, will have to:

  • set the sciEnabled = true
  • set the correct profiletag urls

Which strategy endpoint to use, is then decided on the value of sciEnabled in the cds-schematics-config.ts (line 74-76)
Also config.cds.profileTag.sciEnabled will be same value as in the setup (line 110)

Or is your question regarding changing these things MANUALLY in CdsFeatureModule only refering to existing setups/customers?

Copy link
Contributor

@Platonn Platonn Feb 6, 2025

Choose a reason for hiding this comment

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

Thank you for your answer.
So I understand that during initial installation of spartacus, the shape of the scaffolded CdsFeatureModule in customer's app will look differently depending on the value of sciEnabled in the cds-schematics-config.ts (line 74-76).

And I understand that if customer already created an application with CDS in the past, then the only way enable SCI in the future (if they want it in the future), for them will be they'll manually change the content of their CdsFeatureModule -> then we should put instructions in our official docs for them so they know what changes to peform manually there.

Still, what I dont understand is: why do we keep Spartacus config property config.cds.profileTag.sciEnabled. Perhaps we have some future plans for it?
Currently, as far as I can see in the code, it's not used anywhere. It's just defined.
Perhaps I'm missing something here, then please correct me.
If this config is not used anywhere, my gut feeling is we should remove it and re-introduce only possibly in the future, if in the future we add some logic in Spartacus that would use this config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello, both assumptions for initial installation and already created application are correct. We already gave our input to our documentation team to have that properly written down.

I've deleted the config.cds.profileTag.sciEnabled property.

@@ -97,6 +107,7 @@ function buildCdsConfig(
'PROFILE_TAG_CONFIG_URL_PLACEHOLDER'
}',
allowInsecureCookies: true,
sciEnabled: ${options.sciEnabled}
Copy link
Contributor

@Platonn Platonn Feb 4, 2025

Choose a reason for hiding this comment

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

[QUESTION]
I can see here we set the property of the Spartacus global config config.cds.profileTag.sciEnabled based on the argument option --sci-enabled of the Installation Schematics, during the installation.

  1. But I'm having problem to understand what do we need this Spartacus config option for (config.cds.profileTag.sciEnabled)?
    I have problem to find any usages of it in runtime. Below is a screenshot from VSCode on the current branch:
image

(See:

)

  1. By the way, I can see we've removed an analogical Spartacus config property in this PR in 1 level above config.cds.sciEnabled (without .profileTag. in beteween). So it seems we had previously the config property sciEnabled defined in interfaces on both levels:
  • config.cds.sciEnabled - which is removed in this PR
  • config.cds.profileTag.sciEnabled - which remained in this PR
    Perhaps we wanted to remove also the profileTag-nested one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to have it consistent with our profileTag implementation - https://github.tools.sap/cx-commerce/cds-argonauts-profiletag/blob/master/src/config/config.ts

@johannathalmann-SAP johannathalmann-SAP marked this pull request as ready for review February 5, 2025 09:54
@github-actions github-actions bot marked this pull request as draft February 6, 2025 16:10
@johannathalmann-SAP johannathalmann-SAP marked this pull request as ready for review February 6, 2025 16:52
@github-actions github-actions bot marked this pull request as draft February 7, 2025 07:07
@johannathalmann-SAP johannathalmann-SAP marked this pull request as ready for review February 7, 2025 07:35
@johannathalmann-SAP johannathalmann-SAP merged commit 944b991 into develop Feb 7, 2025
28 checks passed
@johannathalmann-SAP johannathalmann-SAP deleted the bugfix/CXCDS-14100 branch February 7, 2025 08:39
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.

3 participants