Skip to content

Commit bfdbaca

Browse files
authored
fix: Deploy Config generator should not validate the package for OnPremise systems for ADP (#3639)
* fix: do not validate the package for OnPremise systems * chore: update cset
1 parent 62f764b commit bfdbaca

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.changeset/loud-ghosts-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sap-ux/abap-deploy-config-inquirer': patch
3+
---
4+
5+
fix: Deploy Config generator should not validate the package for OnPremise systems for ADP

packages/abap-deploy-config-inquirer/src/prompts/validators.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -647,14 +647,10 @@ export function validateConfirmQuestion(overwrite: boolean): boolean {
647647
*/
648648
async function validatePackageType(input: string, backendTarget?: BackendTarget): Promise<boolean | string> {
649649
const isS4HC = PromptState?.abapDeployConfig?.isS4HC;
650-
if (isS4HC === false && input === DEFAULT_PACKAGE_ABAP) {
650+
if (!isS4HC) {
651+
LoggerHelper.logger.debug(`System is OnPremise, skipping package "${input}" type validation`);
651652
return true;
652653
}
653-
const packageType = isS4HC ? AdaptationProjectType.CLOUD_READY : AdaptationProjectType.ON_PREMISE;
654-
const errorMsg =
655-
packageType === AdaptationProjectType.CLOUD_READY
656-
? t('errors.validators.invalidCloudPackage')
657-
: t('errors.validators.invalidOnPremPackage');
658654
const systemInfoResult = await getSystemInfo(input, backendTarget);
659655
if (!systemInfoResult.apiExist) {
660656
return true;
@@ -665,9 +661,9 @@ async function validatePackageType(input: string, backendTarget?: BackendTarget)
665661
return true;
666662
}
667663

668-
const isValidPackageType = types?.length === 1 && types[0] === packageType;
664+
const isValidPackageType = types?.length === 1 && types[0] === AdaptationProjectType.CLOUD_READY;
669665

670-
return isValidPackageType ? true : errorMsg;
666+
return isValidPackageType ? true : t('errors.validators.invalidCloudPackage');
671667
}
672668

673669
/**

packages/abap-deploy-config-inquirer/test/prompts/validators.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,10 @@ describe('Test validators', () => {
448448
expect(result).toBe(true);
449449
});
450450

451-
it('should return true for onPremise system with default onPremise package', async () => {
451+
it('should return true for onPremise system', async () => {
452452
PromptState.abapDeployConfig.isS4HC = false;
453453
const getSystemInfoSpy = jest.spyOn(serviceProviderUtils, 'getSystemInfo');
454-
const result = await validatePackage('$TMP', previousAnswers, {
454+
const result = await validatePackage('ZPACKAGE', previousAnswers, {
455455
additionalValidation: { shouldValidatePackageType: true }
456456
});
457457
expect(getSystemInfoSpy).not.toHaveBeenCalled();

0 commit comments

Comments
 (0)