Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c74b659
Updated outdated package version which was causing subscription failu…
yashmeet29 Jul 1, 2026
8f710b0
update versions in personal-space app
yashmeet29 Jul 1, 2026
cf4c412
Fix tenant subscription failure caused by unguarded errors[0] access …
yashmeet29 Jul 1, 2026
ad38d47
Fix tenant subscription crash caused by undefined error object in cds…
yashmeet29 Jul 1, 2026
a4ed371
Fix incomplete null guard in cds-mtxs srv-mgr catch block causing sub…
yashmeet29 Jul 1, 2026
f807232
Ensure _pollError always returns a proper Error to surface real SM fa…
yashmeet29 Jul 1, 2026
7b8d02d
Updated workflow to read DATABASE_ID from secrets and remove changes …
yashmeet29 Jul 2, 2026
9f0c48a
Fix database_id injection to target mtx sidecar package.json
yashmeet29 Jul 2, 2026
37d9b52
Fix DATABASE_ID secret injection using step-level env variable
yashmeet29 Jul 2, 2026
a682f04
Fix DATABASE_ID injection using yq consistent with REPOSITORY_ID pattern
yashmeet29 Jul 2, 2026
dde5438
Inject DATABASE_ID via mta.yaml environment property to survive cds b…
yashmeet29 Jul 2, 2026
9d545ed
Add diagnostic logging for DATABASE_ID env var configuration in sidec…
yashmeet29 Jul 2, 2026
7db2f5e
Add comprehensive diagnostics to workflow for DATABASE_ID injection d…
yashmeet29 Jul 2, 2026
fcba233
Clean up diagnostics and make central-space and personal-space identical
yashmeet29 Jul 2, 2026
9fda205
Update xsappname in leading apps for individual spaces
yashmeet29 Jul 2, 2026
6770755
Added PujaDeshmukh17 as codeowners
yashmeet29 Jul 3, 2026
ecce6f6
Merge branch 'develop' into SDMEXT-subscriptionfix-feature
PujaDeshmukh17 Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/multiTenant_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,22 @@ jobs:
sudo apt update
sudo apt install cf8-cli
cf login -a "$CF_API" -u "$CF_USER" -p "$CF_PASSWORD" -o "$CF_ORG" -s "${{ github.event.inputs.space }}"

- name: Prepare app & Build and deploy
run: |
npm pack
mv *.tgz app/multi-tenant/personal-space/cap-js-incidents-app/
cd app/multi-tenant/personal-space/cap-js-incidents-app
npm i *.tgz

- name: Inject REPOSITORY_ID into mta.yaml
- name: Inject secrets into mta.yaml
working-directory: app/multi-tenant/personal-space/cap-js-incidents-app
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod a+x /usr/local/bin/yq
yq -i e '(.modules[] | select(.name == "incidents-mtx-srv")).properties.REPOSITORY_ID = "${{ secrets.REPOSITORY_ID }}"' mta.yaml
yq -i e '(.modules[] | select(.name == "incidents-mtx-mtx")).requires[] |= (select(.name == "app-api").properties.REPOSITORY_ID = "${{ secrets.REPOSITORY_ID }}")' mta.yaml
yq -i e '(.modules[] | select(.name == "incidents-mtx-mtx")).properties.DATABASE_ID = "${{ secrets.DATABASE_ID }}"' mta.yaml

- name: Build and deploy
working-directory: app/multi-tenant/personal-space/cap-js-incidents-app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ jobs:
cd app/multi-tenant/central-space/cap-js-incidents-app
npm i *.tgz

- name: Inject REPOSITORY_ID into mta.yaml
- name: Inject secrets into mta.yaml
working-directory: app/multi-tenant/central-space/cap-js-incidents-app
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod a+x /usr/local/bin/yq
yq -i e '(.modules[] | select(.name == "incidents-mtx-srv")).properties.REPOSITORY_ID = "${{ secrets.REPOSITORY_ID_MT }}"' mta.yaml
yq -i e '(.modules[] | select(.name == "incidents-mtx-mtx")).requires[] |= (select(.name == "app-api").properties.REPOSITORY_ID = "${{ secrets.REPOSITORY_ID_MT }}")' mta.yaml
yq -i e '(.modules[] | select(.name == "incidents-mtx-mtx")).properties.DATABASE_ID = "${{ secrets.DATABASE_ID }}"' mta.yaml

- name: Build and deploy
working-directory: app/multi-tenant/central-space/cap-js-incidents-app
Expand Down
2 changes: 2 additions & 0 deletions app/multi-tenant/central-space/cap-js-incidents-app/mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ modules:
# but let's give it a try here
# https://cap.cloud.sap/docs/guides/multitenancy/#update-database-schema-for-tenants
command: cds-mtx upgrade '*'
properties:
DATABASE_ID: REPLACE_WITH_YOUR_DATABASE_ID
provides:
- name: mtx-api
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "incidents-mtx",
"dependencies": {
"@cap-js/sdm": "../../../cap-js-sdm-1.10.0.tgz",
"@sap/cds": "^8",
"@sap/cds-hana": "^2",
"@sap/cds-mtxs": "^2",
"@sap/cds": "^9",
"@cap-js/hana": "^2",
"@sap/cds-mtxs": "^3",
"@sap/xsenv": "^5",
"@sap/xssec": "^3",
"@sap/xssec": "^4",
"express": "^4"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ cds.once('bootstrap', async (app) => {
LOG.error('Hello');
app.disable('x-powered-by');

const databaseId = process.env.DATABASE_ID;
if (databaseId && databaseId !== 'REPLACE_WITH_YOUR_DATABASE_ID') {
cds.env.requires['cds.xt.DeploymentService'] ??= {};
cds.env.requires['cds.xt.DeploymentService'].hdi ??= {};
cds.env.requires['cds.xt.DeploymentService'].hdi.create ??= {};
cds.env.requires['cds.xt.DeploymentService'].hdi.create.database_id = databaseId;
LOG.info(`Configured HDI database_id from environment`);
} else {
LOG.error(`DATABASE_ID environment variable is not set or is still the placeholder. HDI container creation will fail.`);
}

try {
const services = xsenv.getServices({
runtimeRepo: { tag: 'html5-apps-repo-rt' },
Expand All @@ -28,7 +39,6 @@ cds.once('bootstrap', async (app) => {
LOG.info(`Configured SaaS dependency to SDM: ${runtimeSdmXsappname}`);
LOG.info(`Configured SaaS dependency to Destination: ${runtimeDestinationXsappname}`);
} catch (err) {
// LOG.warn(`Could not find service binding for HTML5 app repo runtime. Skipping Saas dependency setup. Error: ${err.message}`);
LOG.warn(`Could not find service binding for needed dependency. Skipping Saas dependency setup. Error: ${err.message}`);
}
});
Expand Down
2 changes: 2 additions & 0 deletions app/multi-tenant/personal-space/cap-js-incidents-app/mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ modules:
# but let's give it a try here
# https://cap.cloud.sap/docs/guides/multitenancy/#update-database-schema-for-tenants
command: cds-mtx upgrade '*'
properties:
DATABASE_ID: REPLACE_WITH_YOUR_DATABASE_ID
provides:
- name: mtx-api
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "incidents-mtx",
"dependencies": {
"@cap-js/sdm": "../../../cap-js-sdm-1.10.0.tgz",
"@sap/cds": "^8",
"@sap/cds-hana": "^2",
"@sap/cds-mtxs": "^2",
"@sap/cds": "^9",
"@cap-js/hana": "^2",
"@sap/cds-mtxs": "^3",
"@sap/xsenv": "^5",
"@sap/xssec": "^3",
"@sap/xssec": "^4",
"express": "^4"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ cds.once('bootstrap', async (app) => {
LOG.error('Hello');
app.disable('x-powered-by');

const databaseId = process.env.DATABASE_ID;
if (databaseId && databaseId !== 'REPLACE_WITH_YOUR_DATABASE_ID') {
cds.env.requires['cds.xt.DeploymentService'] ??= {};
cds.env.requires['cds.xt.DeploymentService'].hdi ??= {};
cds.env.requires['cds.xt.DeploymentService'].hdi.create ??= {};
cds.env.requires['cds.xt.DeploymentService'].hdi.create.database_id = databaseId;
LOG.info(`Configured HDI database_id from environment`);
} else {
LOG.error(`DATABASE_ID environment variable is not set or is still the placeholder. HDI container creation will fail.`);
}

try {
const services = xsenv.getServices({
runtimeRepo: { tag: 'html5-apps-repo-rt' },
Expand All @@ -28,7 +39,6 @@ cds.once('bootstrap', async (app) => {
LOG.info(`Configured SaaS dependency to SDM: ${runtimeSdmXsappname}`);
LOG.info(`Configured SaaS dependency to Destination: ${runtimeDestinationXsappname}`);
} catch (err) {
// LOG.warn(`Could not find service binding for HTML5 app repo runtime. Skipping Saas dependency setup. Error: ${err.message}`);
LOG.warn(`Could not find service binding for needed dependency. Skipping Saas dependency setup. Error: ${err.message}`);
}
});
Expand Down
2 changes: 1 addition & 1 deletion app/single-tenant/personal-space/incidents-app/mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ resources:
parameters:
config:
tenant-mode: dedicated
xsappname: sdmincidents
xsappname: sdmincidents-${org}-${space}
oauth2-configuration:
redirect-uris:
- ~{app-api/app-url}/**
Expand Down
Loading