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

Update Versions #30

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

fibsifan
Copy link

@fibsifan fibsifan commented Aug 31, 2023

Backend:

  • Gradle 8.8
  • Java 17
  • SAP Commerce Cloud 2211 (not yet complete)
    • Updated gradle build script plugins
    • fixed gradle tasks, that aren't compatible new versions of gradle and build plugins
    • Accelerator based storefront is deprecated, so it is disabled by default and can be enabled by setting a project property.
    • Use sparse bootstrapping in the generated project.
    • cloudhotfolder zip is expected in the dependencies folder.
    • solrVersion can be set during project bootstrap. Solr >= 9 is automatically downloaded.

Frontend:

  • Required node version: 20
  • Required angular version: 17
  • Spartacus 2211
    • NPM-Repo credentials need to be provided as env var (see js-storefront/README.md)

intended to fix #29

Out of scope for this PR: since the versions of Frontend, Commerce Cloud and Integrations package are now coupled, find a way to parameterize all of them,

* Gradle 8.3
* Java 17
* SAP Commerce Cloud 2211 (probably not yet complete)
@fibsifan fibsifan changed the title Update Versions Update Versions (WIP) Aug 31, 2023
@mpern
Copy link
Member

mpern commented Aug 31, 2023

You rock! 🤘

@mpern
Copy link
Member

mpern commented Sep 5, 2023

BTW, if you have any questions/need help, just ask here or find me on LinkedIn

@fibsifan
Copy link
Author

fibsifan commented Sep 5, 2023

Sure, thanks.

Currently I'm fighting with my IDE and gradle-script support there, but I think i've got a working version of the commerce part.

Since the commerce accelerator is deprecated, I wonder if the template should still provide the accelerator storefront by default, or whether this should be behind a feature toggle?

@mpern
Copy link
Member

mpern commented Sep 5, 2023

Let's hide it behind a toogle. Default should be new OCC APIs only + Spartacus

@fibsifan
Copy link
Author

I'm afraid toggling the acceleratorstorefront is not as easy as I thought, because the current process uses modulegen. Yacceleratorstorefront is still part of the accelerator module template, despite being deprecated. Would it be better to switch to extgen? Or should we rather stick with modulegen and still have the yacceleratorstorefront?

Also: I'm uneasy with uploading the cloudhotfolder extensions since I'm not licensed to do that. Wouldn't it be better to have them as dependency in the dependencies folder?

@mpern
Copy link
Member

mpern commented Sep 12, 2023

Or should we rather stick with modulegen and still have the yacceleratorstorefront?

Still use modulegen but delete *storefront afterwards?

@fibsifan
Copy link
Author

That's what I went for, I hope I caught every trace of the storefront.

Should the cloudhotfolders be optional too? As far as I understand it, we could instead provide an alternative hotfolder configuration (plain folder, without azure) in the dev config for testing. Then the azure cloud hotfolders will only be loaded in the cloud.

If someone wants to test azurecloudhotfolder specifics they still could put them in the dependencies folder and unpack them?

Then I wouldn't need to commit copyrighted Code into Github ;-)

@mpern
Copy link
Member

mpern commented Oct 24, 2023

we could instead provide an alternative hotfolder configuration (plain folder, without azure) in the dev config for testing

Unfortunately not, the cloud hotfolder logic is different enough from the stuff in acceleratorservices to cause issues if not properly tested.

Let's add a note/step to download the extensions from the SAP Note 2817992, to avoid having the code in the template.

Plus a flag to optionally disable cloud hotfolders, if it isn't too much to ask.

@fibsifan
Copy link
Author

Man, this keeps dragging on...

I updated the description with the current version and TODOs

The part of making the azurecloudhotfolders optional is easy I think, just haven't found the time to do it yet.

But with the Storefront It feels like a lot has changed. The environment.ts files have disappeared so the patches - at least partly - don't match anymore. I currently have no idea what a storefront configuration could look like that works locally but also lets you configure the endpoints and the CCv2 Base url in the cloud like described in the documentation

Any ideas?

@mpern
Copy link
Member

mpern commented Jun 13, 2024

thank you for keeping at it!

re. composable storefront:
I think the patches are already obsolete. It has been I while since a set up a new storefront project from scratch, but it should just work ootb now. e.g.OCC_BACKEND_BASE_URL_VALUE is included by default in index.html etc.

@fibsifan fibsifan force-pushed the sap-commerce-2211 branch from 3738cb6 to 6dfbcec Compare June 13, 2024 13:15
(
cd "$NAME" || exit 1

cat > .npmrc <<-EOF
Copy link
Member

@mpern mpern Jun 14, 2024

Choose a reason for hiding this comment

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

@fibsifan
a simpler way to handle this would be using env vars in the npmrc.

e.g.

@spartacus:registry=https://73554900100900004337.npmsrv.base.repositories.cloud.sap/
//73554900100900004337.npmsrv.base.repositories.cloud.sap/:_auth=${RBSC_NPM_CREDENTIALS}
always-auth=true

now you can add the .npmrc to your repo without leaking credentials and use the same config everywhere.

export RBSC_NPM_CREDENTIALS=abc1245

yarn build

@fibsifan
Copy link
Author

fibsifan commented Jul 9, 2024

Let's add a note/step to download the extensions from the SAP Note 2817992, to avoid having the code in the template.

Plus a flag to optionally disable cloud hotfolders, if it isn't too much to ask.

The flag was too complicated on first glance, I found no nice way to persist the initial decision whether it is needed so I just put it in the Readme.md for the user to handle it. They can either download the zip file or remove the dependency on bootstrapping it from the build.gradle.kts.

Apart from that I think I'm done for now. There is still a lot room for improvement, but I think it's definitely better than before.

@fibsifan fibsifan marked this pull request as ready for review July 9, 2024 12:40
@fibsifan fibsifan changed the title Update Versions (WIP) Update Versions Jul 11, 2024
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.

Update template/bootstrap script for 2211?
2 participants