SAP / commerce-gradle-plugin

Gradle plugins for the full development lifecycle of a SAP Commerce project
Apache License 2.0
32 stars 12 forks source link

Mismatched Image Version Validation Issue. #57

Closed eljoujat closed 1 year ago

eljoujat commented 1 year ago

Hello,

I'm encountering an issue with the sap.commerce.build.ccv2:4.0.0 plugin that validates the image version of an sap commerce before building. The plugin is currently unable to handle versions of SAP CC later than 2211. I specifically reproduce this issue with the version 2211.8 of SAP CC

Steps to Reproduce:

Include the in your Gradle build configuration. Attempt to build the project with the version 2211.8 Observe that the plugin is reporting a version mismatch error even though the build number is the same being used in the cloud portal

Expected Behavior:

The plugin should correctly validate the image version of the artifact

Actual Behavior: The plugin consistently reports a version mismatch error

Additional Information:

sap.commerce.build.ccv2 version: 4.0.0 SAP Commerce version with mismatched build number:2211.8 Expected build number: 2211.FP1

Any relevant logs or error messages: current version: 2211.FP1 (PREVIEW); required version: 2211.8 -> MISMATCH

portal-build-logs.txt

Environment:

Operating System: Mac OS Java Version: OpenJDK Runtime Environment SapMachine (build 17.0.8+7-LTS-sapmachine) Gradle Version: Gradle 7.6

Best regards, Youssef El Jaoujat

mpern commented 1 year ago

Hi Youssef!

thanks for the comprehensive bug report!

This issue is unfortunately caused by a mismatch between the metadata embedded in the commerce zip and the build number expected in the manifest.

Fortunately, the issue was already fixed (#53), you can use the previewToPatchLevel configuration to map FP1 to the correct patch level 8

hybris {
   //Optional mapping of preview version to patch level.
   // manifest.json requires the Commerce Suite version in the format 2211.8, while the platform build.number
   // uses 2211.FP1. This mapping allows the plugin to convert between the two formats. 
   previewToPatchLevel = [
      "2211.FP1": 8
   ]
} 

https://github.com/SAP/commerce-gradle-plugin/blob/main/docs/Plugin-sap.commerce.build.md

Let me know if this solves your issue or just close the request accordingly :)