From f3fa2774172e39aeb5c7401cd6321e713fe92723 Mon Sep 17 00:00:00 2001 From: anirudhprasad-sap Date: Wed, 12 Aug 2026 15:59:08 +0200 Subject: [PATCH 1/7] [Feat] Add workzone-standard support to chart generation - Add files/workzone.yaml.hbs with build-workzone-standard service instance and binding templates - Update lib/add.js: detect hasWorkzoneStandard and include workzone.yaml.hbs in combine() - Update files/approuter.yaml.hbs: add workzone-bind to consumedBTPServices and OWN_SAP_CLOUD_SERVICE env var - Update files/workloads.yaml.hbs: add workzone-bind to contentDeploy consumedBTPServices and ASYNC_UPLOAD=true env var --- files/approuter.yaml.hbs | 8 ++++++++ files/workloads.yaml.hbs | 8 ++++++++ files/workzone.yaml.hbs | 15 +++++++++++++++ lib/add.js | 3 ++- 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 files/workzone.yaml.hbs diff --git a/files/approuter.yaml.hbs b/files/approuter.yaml.hbs index ecbcefa..4e26727 100644 --- a/files/approuter.yaml.hbs +++ b/files/approuter.yaml.hbs @@ -22,9 +22,17 @@ workloads: {{#hasHTML5Repo}} - {{appName}}-html5-repo-runtime-bind {{/hasHTML5Repo}} + {{#hasWorkzoneStandard}} + - {{appName}}-workzone-bind + {{/hasWorkzoneStandard}} deploymentDefinition: type: Router image: ports: - name: router-port port: 5000 + {{#hasWorkzoneStandard}} + env: + - name: OWN_SAP_CLOUD_SERVICE + value: '["{{strippedAppName}}.service"]' + {{/hasWorkzoneStandard}} diff --git a/files/workloads.yaml.hbs b/files/workloads.yaml.hbs index 9e1337c..f088310 100644 --- a/files/workloads.yaml.hbs +++ b/files/workloads.yaml.hbs @@ -54,9 +54,17 @@ workloads: {{#hasHtml5Repo}} - {{appName}}-html5-repo-host-bind {{/hasHtml5Repo}} + {{#hasWorkzoneStandard}} + - {{appName}}-workzone-bind + {{/hasWorkzoneStandard}} jobDefinition: type: Content image: + {{#hasWorkzoneStandard}} + env: + - name: ASYNC_UPLOAD + value: "true" + {{/hasWorkzoneStandard}} {{#isApp}} tenantJob: diff --git a/files/workzone.yaml.hbs b/files/workzone.yaml.hbs new file mode 100644 index 0000000..038ac50 --- /dev/null +++ b/files/workzone.yaml.hbs @@ -0,0 +1,15 @@ +serviceInstances: + workzone: + name: {{appName}}-wz-service + serviceOfferingName: build-workzone-standard + servicePlanName: local-entry-point + parameters: + providerId: + exposureId: +serviceBindings: + workzone: + name: {{appName}}-workzone-bind + serviceInstanceName: {{appName}}-wz-service + secretName: {{appName}}-workzone-bind-secret + secretKey: credentials + parameters: {} diff --git a/lib/add.js b/lib/add.js index 0cf12fb..e8f8d41 100644 --- a/lib/add.js +++ b/lib/add.js @@ -122,7 +122,7 @@ module.exports = class CapOperatorAddPlugin extends cds.add.Plugin { const project = this.readProject(isServiceOnly) const { hasDestination, hasHtml5Repo, hasXsuaa, hasApprouter, - hasMultitenancy, hasIas + hasMultitenancy, hasIas, hasWorkzoneStandard } = project const valuesPath = join(cds.root, 'chart/values.yaml') @@ -137,6 +137,7 @@ module.exports = class CapOperatorAddPlugin extends cds.add.Plugin { await addIf(hasDestination, '../files/destination.yaml.hbs') await addIf(hasHtml5Repo, '../files/html5Repo.yaml.hbs') + await addIf(hasWorkzoneStandard, '../files/workzone.yaml.hbs') await addIf(hasIas, '../files/ias.yaml.hbs') await addIf(!hasIas && hasXsuaa, '../files/xsuaa.yaml.hbs') From a2da9af8c76825fb4408323e9eb7a04f4c47c03b Mon Sep 17 00:00:00 2001 From: anirudhprasad-sap Date: Wed, 12 Aug 2026 16:05:14 +0200 Subject: [PATCH 2/7] Set default providerId and exposureId from strippedAppName --- files/workzone.yaml.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/workzone.yaml.hbs b/files/workzone.yaml.hbs index 038ac50..7375698 100644 --- a/files/workzone.yaml.hbs +++ b/files/workzone.yaml.hbs @@ -4,8 +4,8 @@ serviceInstances: serviceOfferingName: build-workzone-standard servicePlanName: local-entry-point parameters: - providerId: - exposureId: + providerId: {{strippedAppName}} + exposureId: "{{strippedAppName}}.service" serviceBindings: workzone: name: {{appName}}-workzone-bind From 8d0eb5953d2d8c55ad8141821cd6865a0a572627 Mon Sep 17 00:00:00 2001 From: anirudhprasad-sap Date: Wed, 12 Aug 2026 16:08:05 +0200 Subject: [PATCH 3/7] Rename wz-service to workzone-service in workzone template --- files/workzone.yaml.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/workzone.yaml.hbs b/files/workzone.yaml.hbs index 7375698..cba0b48 100644 --- a/files/workzone.yaml.hbs +++ b/files/workzone.yaml.hbs @@ -1,6 +1,6 @@ serviceInstances: workzone: - name: {{appName}}-wz-service + name: {{appName}}-workzone-service serviceOfferingName: build-workzone-standard servicePlanName: local-entry-point parameters: @@ -9,7 +9,7 @@ serviceInstances: serviceBindings: workzone: name: {{appName}}-workzone-bind - serviceInstanceName: {{appName}}-wz-service + serviceInstanceName: {{appName}}-workzone-service secretName: {{appName}}-workzone-bind-secret secretKey: credentials parameters: {} From 2b6dce5ab27d36a37e9c31a32e8b5e8f158af6f5 Mon Sep 17 00:00:00 2001 From: anirudhprasad-sap Date: Wed, 12 Aug 2026 16:20:17 +0200 Subject: [PATCH 4/7] [Feat] Update changelog and version to 0.20.0; add support for workzone-standard in cap-operator chart --- CHANGELOG.md | 6 ++++++ package-lock.json | 4 ++-- package.json | 2 +- test/add.test.js | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0399e7e..bf0cd43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). The format is based on [Keep a Changelog](http://keepachangelog.com/). +## Version 0.20.0 - 12-August-2026 + +### Added + +- Added support for SAP Build Work Zone, Standard Edition (`workzone-standard`). Generates a `build-workzone-standard` service instance (`local-entry-point` plan) and binding, with workloads updated as required. + ## Version 0.19.0 - 31-July-2026 ### Added diff --git a/package-lock.json b/package-lock.json index c25e82f..65718eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cap-js/cap-operator-plugin", - "version": "0.19.0", + "version": "0.20.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cap-js/cap-operator-plugin", - "version": "0.19.0", + "version": "0.20.0", "license": "Apache-2.0", "dependencies": { "enquirer": "^2.4.1", diff --git a/package.json b/package.json index 978334f..d1d4b61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cap-js/cap-operator-plugin", - "version": "0.19.0", + "version": "0.20.0", "description": "Add/Build Plugin for CAP Operator", "homepage": "https://github.com/cap-js/cap-operator-plugin/blob/main/README.md", "repository": { diff --git a/test/add.test.js b/test/add.test.js index 396bbad..8ff11e3 100644 --- a/test/add.test.js +++ b/test/add.test.js @@ -2,6 +2,7 @@ const { join } = require('node:path') const { execSync } = require('node:child_process') const { expect } = require('chai') const fs = require('node:fs') +const yaml = require('yaml') const TempUtil = require('./tempUtil') const tempUtil = new TempUtil(__filename, { local: true }) @@ -321,4 +322,37 @@ describe('cds add cap-operator', () => { expect(log).to.not.include("'btp.provider'") }) + + it('Add cap-operator chart with workzone-standard', async () => { + execSync(`cds add workzone-standard`, { cwd: bookshop }) + execSync(`cds add cap-operator`, { cwd: bookshop }) + + const parsed = yaml.parse(fs.readFileSync(join(bookshop, 'chart/values.yaml'), 'utf8')) + + // service instance + const wzInstance = parsed.serviceInstances.workzone + expect(wzInstance.serviceOfferingName).to.equal('build-workzone-standard') + expect(wzInstance.servicePlanName).to.equal('local-entry-point') + expect(wzInstance.parameters.providerId).to.equal('bookshop') + expect(wzInstance.parameters.exposureId).to.equal('bookshop.service') + + // service binding + const wzBinding = parsed.serviceBindings.workzone + expect(wzBinding.name).to.equal('bookshop-workzone-bind') + expect(wzBinding.serviceInstanceName).to.equal('bookshop-workzone-service') + + // appRouter: workzone binding in consumedBTPServices + OWN_SAP_CLOUD_SERVICE env var + const appRouter = parsed.workloads.appRouter + expect(appRouter.consumedBTPServices).to.include('bookshop-workzone-bind') + const ownSapCloudService = appRouter.deploymentDefinition.env?.find(e => e.name === 'OWN_SAP_CLOUD_SERVICE') + expect(ownSapCloudService).to.exist + expect(ownSapCloudService.value).to.include('bookshop.service') + + // contentDeploy: workzone binding in consumedBTPServices + ASYNC_UPLOAD env var + const contentDeploy = parsed.workloads.contentDeploy + expect(contentDeploy.consumedBTPServices).to.include('bookshop-workzone-bind') + const asyncUpload = contentDeploy.jobDefinition.env?.find(e => e.name === 'ASYNC_UPLOAD') + expect(asyncUpload).to.exist + expect(asyncUpload.value).to.equal('true') + }) }) From e4c53b0d77335dbb512bd3680a30c9c52ccfb3b4 Mon Sep 17 00:00:00 2001 From: anirudhprasad-sap Date: Wed, 12 Aug 2026 16:30:39 +0200 Subject: [PATCH 5/7] [Fix] Update providerId in workzone.yaml.hbs to use workzoneProviderId; add validation for providerId length in tests --- files/workzone.yaml.hbs | 2 +- lib/add.js | 8 +++++++- test/add.test.js | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/files/workzone.yaml.hbs b/files/workzone.yaml.hbs index cba0b48..2e2c5e3 100644 --- a/files/workzone.yaml.hbs +++ b/files/workzone.yaml.hbs @@ -4,7 +4,7 @@ serviceInstances: serviceOfferingName: build-workzone-standard servicePlanName: local-entry-point parameters: - providerId: {{strippedAppName}} + providerId: {{workzoneProviderId}} exposureId: "{{strippedAppName}}.service" serviceBindings: workzone: diff --git a/lib/add.js b/lib/add.js index e8f8d41..68fdaac 100644 --- a/lib/add.js +++ b/lib/add.js @@ -125,6 +125,8 @@ module.exports = class CapOperatorAddPlugin extends cds.add.Plugin { hasMultitenancy, hasIas, hasWorkzoneStandard } = project + if (hasWorkzoneStandard) project.workzoneProviderId = project.strippedAppName.slice(0, 20) + const valuesPath = join(cds.root, 'chart/values.yaml') const valuesYaml = yaml.parse(await read(valuesPath)) @@ -137,10 +139,14 @@ module.exports = class CapOperatorAddPlugin extends cds.add.Plugin { await addIf(hasDestination, '../files/destination.yaml.hbs') await addIf(hasHtml5Repo, '../files/html5Repo.yaml.hbs') - await addIf(hasWorkzoneStandard, '../files/workzone.yaml.hbs') await addIf(hasIas, '../files/ias.yaml.hbs') await addIf(!hasIas && hasXsuaa, '../files/xsuaa.yaml.hbs') + if (hasWorkzoneStandard) { + project.workzoneProviderId = project.strippedAppName.slice(0, 20) + await addIf(true, '../files/workzone.yaml.hbs') + } + if (hasMultitenancy) { await addIf(hasIas, '../files/subscription-manager.yaml.hbs') await addIf(!hasIas && hasXsuaa, '../files/saas-registry.yaml.hbs') diff --git a/test/add.test.js b/test/add.test.js index 8ff11e3..707e3ab 100644 --- a/test/add.test.js +++ b/test/add.test.js @@ -334,6 +334,7 @@ describe('cds add cap-operator', () => { expect(wzInstance.serviceOfferingName).to.equal('build-workzone-standard') expect(wzInstance.servicePlanName).to.equal('local-entry-point') expect(wzInstance.parameters.providerId).to.equal('bookshop') + expect(wzInstance.parameters.providerId.length).to.be.at.most(20) expect(wzInstance.parameters.exposureId).to.equal('bookshop.service') // service binding From f530a963c4e92fb15ad83849f741b15f30c9ed52 Mon Sep 17 00:00:00 2001 From: anirudhprasad-sap Date: Thu, 13 Aug 2026 10:21:49 +0200 Subject: [PATCH 6/7] [Refactor] Remove ASYNC_UPLOAD environment variable from contentDeploy in workloads.yaml.hbs and update related test assertions --- files/workloads.yaml.hbs | 5 ----- test/add.test.js | 5 +---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/files/workloads.yaml.hbs b/files/workloads.yaml.hbs index f088310..078cd61 100644 --- a/files/workloads.yaml.hbs +++ b/files/workloads.yaml.hbs @@ -60,11 +60,6 @@ workloads: jobDefinition: type: Content image: - {{#hasWorkzoneStandard}} - env: - - name: ASYNC_UPLOAD - value: "true" - {{/hasWorkzoneStandard}} {{#isApp}} tenantJob: diff --git a/test/add.test.js b/test/add.test.js index 707e3ab..08938a0 100644 --- a/test/add.test.js +++ b/test/add.test.js @@ -349,11 +349,8 @@ describe('cds add cap-operator', () => { expect(ownSapCloudService).to.exist expect(ownSapCloudService.value).to.include('bookshop.service') - // contentDeploy: workzone binding in consumedBTPServices + ASYNC_UPLOAD env var + // contentDeploy: workzone binding in consumedBTPServices const contentDeploy = parsed.workloads.contentDeploy expect(contentDeploy.consumedBTPServices).to.include('bookshop-workzone-bind') - const asyncUpload = contentDeploy.jobDefinition.env?.find(e => e.name === 'ASYNC_UPLOAD') - expect(asyncUpload).to.exist - expect(asyncUpload.value).to.equal('true') }) }) From 1843494bbf230aaa11a9e3d0d65817e3c3000bd2 Mon Sep 17 00:00:00 2001 From: Anirudh Prasad Date: Thu, 13 Aug 2026 13:11:46 +0200 Subject: [PATCH 7/7] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf0cd43..df5eaa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). The format is based on [Keep a Changelog](http://keepachangelog.com/). -## Version 0.20.0 - 12-August-2026 +## Version 0.20.0 - 17-August-2026 ### Added