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

fix: Update Adp writer deploy scripts #2362

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
db47981
fix: update deploy scripts
GDamyanov Sep 12, 2024
10ea50a
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Sep 12, 2024
9bfc39c
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Sep 12, 2024
b86b711
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Sep 13, 2024
327a1ac
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Sep 16, 2024
3fe6c68
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Sep 18, 2024
66d4ec7
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
longieirl Sep 25, 2024
a3c9caa
feat: configure ui5.yaml with the latest builder config
GDamyanov Sep 27, 2024
633a480
chore: add changeset
GDamyanov Sep 27, 2024
edc0c85
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Sep 30, 2024
f4aa2ec
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Sep 30, 2024
2c7b570
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Oct 3, 2024
9c1c8dc
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Oct 7, 2024
74ad9fe
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Oct 9, 2024
7d80f41
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Oct 14, 2024
927cb2d
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Oct 15, 2024
e799bb8
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Oct 16, 2024
3e3107e
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Oct 29, 2024
c5254a5
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Oct 30, 2024
28da205
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Oct 31, 2024
2b1a2b6
Merge branch 'main' into fix/2361/cloud-adp-project-deployment
GDamyanov Nov 11, 2024
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
14 changes: 14 additions & 0 deletions packages/adp-tooling/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,20 @@ export interface CustomConfig {
};
}

export interface CloudCustomTaskConfig {
type: string;
destination: string | undefined;
appName: string | undefined;
languages: Language[];
connections?: Connection[];
}

export interface Connection {
url: string | undefined;
authenticationType: string | undefined;
ignoreCertErrors: boolean;
}

export interface InboundChangeContentAddInboundId {
inbound: {
[inboundId: string]: AddInboundModel;
Expand Down
33 changes: 21 additions & 12 deletions packages/adp-tooling/src/writer/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import type {
Content,
CloudApp,
ChangeInboundNavigation,
InternalInboundNavigation
InternalInboundNavigation,
CloudCustomTaskConfig
} from '../types';
import { isAppStudio } from '@sap-ux/btp-utils';

/**
* Generate the configuration for the middlewares required for the ui5.yaml.
Expand Down Expand Up @@ -178,21 +180,28 @@ function addOpenSourceMiddlewares(ui5Config: UI5Config, config: AdpWriterConfig)
* @returns list of required tasks.
*/
function getAdpCloudCustomTasks(config: AdpWriterConfig & { target: AbapTarget } & { app: CloudApp }): CustomTask[] {
const configuration: CloudCustomTaskConfig = {
type: 'abap',
destination: config.target?.destination,
appName: config?.app?.bspName,
languages: config?.app?.languages?.map((language: Language) => {
return {
sap: language.sap,
i18n: language.i18n
};
})
};

if (!isAppStudio()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you always add this please, so that projects are ready for usage everywhere.
Even if you run in AppStudio, you have the url and auth type. The url is part of the destination configuration and the authtype is always reentranceTicket since we only add the task for ABAP cloud systems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For BAS we don't need this configuration, because we are using destinations.

Copy link
Contributor

Choose a reason for hiding this comment

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

A project generated in BAS and then checked into e.g. github, could be checked out in VSCode and it should also work there as well. Just because it is generated in BAS, does not necessarily mean it only used in BAS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a3c9caa

configuration.connections = [
{ url: config.target.url, authenticationType: config.target.authenticationType, ignoreCertErrors: false }
];
}
return [
{
name: 'app-variant-bundler-build',
beforeTask: 'escapeNonAsciiCharacters',
configuration: {
type: 'abap',
destination: config.target?.destination,
appName: config?.app?.bspName,
languages: config?.app?.languages?.map((language: Language) => {
return {
sap: language.sap,
i18n: language.i18n
};
})
}
configuration
}
];
}
Expand Down
7 changes: 4 additions & 3 deletions packages/adp-tooling/templates/project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
"@sap-ux/ui5-proxy-middleware": "^1.3.0",
"@sap-ux/deploy-tooling": "^0.11.7"<%}%>,
"@ui5/task-adaptation": "^1.3.0",
"@ui5/cli": "^3.9.2"
"@ui5/cli": "^3.9.2"<%if (locals.deploy) {%>,
"rimraf": "^5.0.5"<%}%>
},
"scripts": {
"build": "ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest",
"start": "<%= locals.options?.fioriTools ? 'fiori run' : 'ui5 serve' %> --open /test/flp.html#app-preview",
"start-editor": "<%= locals.options?.fioriTools ? 'fiori run' : 'ui5 serve' %> --open /test/adaptation-editor.html"<%if (locals.deploy) {%>,
"deploy": "ui5 build --config ui5-deploy.yaml --exclude-task <%= locals.options?.fioriTools ? 'deploy-to-abap' : 'abap-deploy-task' %> generateFlexChangesBundle generateComponentPreload --clean-dest && <%= locals.options?.fioriTools ? 'fiori deploy' : 'deploy' %> --config ui5-deploy.yaml",
"undeploy": "<%= locals.options?.fioriTools ? 'fiori undeploy' : 'undeploy' %> --config ui5-deploy.yaml --lrep \"apps/<%= app.reference %>/appVariants/<%= app.id %>/\"",
"deploy": "npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip",
Copy link
Contributor

Choose a reason for hiding this comment

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

The deploy process should not generate an archive.zip if not explicitly requested, therefore, I am confused that you require rimraf here.
If it does generate an archive.zip then there is a regression that needs an investigation.

Copy link
Contributor

Choose a reason for hiding this comment

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

You also need to add the IF again because you only have the fiori deploy command if the Fiori tools are added, otherwise, you need to use ui5 build

Copy link
Contributor

Choose a reason for hiding this comment

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

@tobiasqueck in SAP Fiori tools, the package.json deploy script is appended as follows;

"deploy": "npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip",

During the deploy task, there is a zip generated on the fly. However, a user can specify a path to an already generated zip which will obviously bypass this zip generation task.

https://github.com/SAP/open-ux-tools/blob/main/packages/deploy-tooling/src/cli/archive.ts#L82

Copy link
Contributor Author

@GDamyanov GDamyanov Sep 18, 2024

Choose a reason for hiding this comment

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

I checked in "@sap-ux/abap-deploy-config-writer" module and it is always generating the same scripts like in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well ... I still don't understand the usage of rimraf because as @longieirl said, the zip is generated on the fly, so nothing needs to be deleted.
The deploy config generated is only generating things for the Fiori tools, while the adp writer already supports both, Fiori tools and a "pure" open source version, so instead of introducing a regression in the adp-writer, this needs to be improved in the deploy-config writer, and then, maybe reused here instead of copying an implementation

Copy link
Contributor

Choose a reason for hiding this comment

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

@tobiasqueck the archive remains if there is any exception thrown during the process! I think this is more of a cleanup task.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a3c9caa

"undeploy": "npm run build && fiori undeploy --config ui5-deploy.yaml",
"deploy-test": "npm run build && fiori deploy --config ui5-deploy.yaml --testMode true"<%}%>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ Object {
\\"devDependencies\\": {
\\"@sap/ux-ui5-tooling\\": \\"1\\",
\\"@ui5/task-adaptation\\": \\"^1.3.0\\",
\\"@ui5/cli\\": \\"^3.9.2\\"
\\"@ui5/cli\\": \\"^3.9.2\\",
\\"rimraf\\": \\"^5.0.5\\"
},
\\"scripts\\": {
\\"build\\": \\"ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest\\",
\\"start\\": \\"fiori run --open /test/flp.html#app-preview\\",
\\"start-editor\\": \\"fiori run --open /test/adaptation-editor.html\\",
\\"deploy\\": \\"ui5 build --config ui5-deploy.yaml --exclude-task deploy-to-abap generateFlexChangesBundle generateComponentPreload --clean-dest && fiori deploy --config ui5-deploy.yaml\\",
\\"undeploy\\": \\"fiori undeploy --config ui5-deploy.yaml --lrep \\\\\\"apps/the.original.app/appVariants/my.test.app/\\\\\\"\\",
\\"deploy\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip\\",
Copy link
Contributor

@longieirl longieirl Oct 14, 2024

Choose a reason for hiding this comment

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

.gitignore should also exclude the archive.zip from source control which I think from looking at the snapshots, is appended i.e. *.zip

\\"undeploy\\": \\"npm run build && fiori undeploy --config ui5-deploy.yaml\\",
\\"deploy-test\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml --testMode true\\"
}
}
Expand Down Expand Up @@ -108,6 +109,9 @@ builder:
languages:
- sap: testId
i18n: testKey
connections:
- url: http://sap.example
ignoreCertErrors: false
",
"state": "modified",
},
Expand All @@ -131,14 +135,15 @@ Object {
\\"devDependencies\\": {
\\"@sap/ux-ui5-tooling\\": \\"1\\",
\\"@ui5/task-adaptation\\": \\"^1.3.0\\",
\\"@ui5/cli\\": \\"^3.9.2\\"
\\"@ui5/cli\\": \\"^3.9.2\\",
\\"rimraf\\": \\"^5.0.5\\"
},
\\"scripts\\": {
\\"build\\": \\"ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest\\",
\\"start\\": \\"fiori run --open /test/flp.html#app-preview\\",
\\"start-editor\\": \\"fiori run --open /test/adaptation-editor.html\\",
\\"deploy\\": \\"ui5 build --config ui5-deploy.yaml --exclude-task deploy-to-abap generateFlexChangesBundle generateComponentPreload --clean-dest && fiori deploy --config ui5-deploy.yaml\\",
\\"undeploy\\": \\"fiori undeploy --config ui5-deploy.yaml --lrep \\\\\\"apps/the.original.app/appVariants/my.test.app/\\\\\\"\\",
\\"deploy\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip\\",
\\"undeploy\\": \\"npm run build && fiori undeploy --config ui5-deploy.yaml\\",
\\"deploy-test\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml --testMode true\\"
}
}
Expand Down Expand Up @@ -222,6 +227,9 @@ builder:
languages:
- sap: testId
i18n: testKey
connections:
- url: http://sap.example
ignoreCertErrors: false
",
"state": "modified",
},
Expand All @@ -248,14 +256,15 @@ Object {
\\"@sap-ux/ui5-proxy-middleware\\": \\"^1.3.0\\",
\\"@sap-ux/deploy-tooling\\": \\"^0.11.7\\",
\\"@ui5/task-adaptation\\": \\"^1.3.0\\",
\\"@ui5/cli\\": \\"^3.9.2\\"
\\"@ui5/cli\\": \\"^3.9.2\\",
\\"rimraf\\": \\"^5.0.5\\"
},
\\"scripts\\": {
\\"build\\": \\"ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest\\",
\\"start\\": \\"ui5 serve --open /test/flp.html#app-preview\\",
\\"start-editor\\": \\"ui5 serve --open /test/adaptation-editor.html\\",
\\"deploy\\": \\"ui5 build --config ui5-deploy.yaml --exclude-task abap-deploy-task generateFlexChangesBundle generateComponentPreload --clean-dest && deploy --config ui5-deploy.yaml\\",
\\"undeploy\\": \\"undeploy --config ui5-deploy.yaml --lrep \\\\\\"apps/the.original.app/appVariants/my.test.app/\\\\\\"\\",
\\"deploy\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip\\",
\\"undeploy\\": \\"npm run build && fiori undeploy --config ui5-deploy.yaml\\",
\\"deploy-test\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml --testMode true\\"
}
}
Expand Down Expand Up @@ -419,14 +428,15 @@ Object {
\\"devDependencies\\": {
\\"@sap/ux-ui5-tooling\\": \\"1\\",
\\"@ui5/task-adaptation\\": \\"^1.3.0\\",
\\"@ui5/cli\\": \\"^3.9.2\\"
\\"@ui5/cli\\": \\"^3.9.2\\",
\\"rimraf\\": \\"^5.0.5\\"
},
\\"scripts\\": {
\\"build\\": \\"ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest\\",
\\"start\\": \\"fiori run --open /test/flp.html#app-preview\\",
\\"start-editor\\": \\"fiori run --open /test/adaptation-editor.html\\",
\\"deploy\\": \\"ui5 build --config ui5-deploy.yaml --exclude-task deploy-to-abap generateFlexChangesBundle generateComponentPreload --clean-dest && fiori deploy --config ui5-deploy.yaml\\",
\\"undeploy\\": \\"fiori undeploy --config ui5-deploy.yaml --lrep \\\\\\"apps/the.original.app/appVariants/my.test.app/\\\\\\"\\",
\\"deploy\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip\\",
\\"undeploy\\": \\"npm run build && fiori undeploy --config ui5-deploy.yaml\\",
\\"deploy-test\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml --testMode true\\"
}
}
Expand Down Expand Up @@ -758,14 +768,15 @@ dist/
\\"@sap-ux/ui5-proxy-middleware\\": \\"^1.3.0\\",
\\"@sap-ux/deploy-tooling\\": \\"^0.11.7\\",
\\"@ui5/task-adaptation\\": \\"^1.3.0\\",
\\"@ui5/cli\\": \\"^3.9.2\\"
\\"@ui5/cli\\": \\"^3.9.2\\",
\\"rimraf\\": \\"^5.0.5\\"
},
\\"scripts\\": {
\\"build\\": \\"ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest\\",
\\"start\\": \\"ui5 serve --open /test/flp.html#app-preview\\",
\\"start-editor\\": \\"ui5 serve --open /test/adaptation-editor.html\\",
\\"deploy\\": \\"ui5 build --config ui5-deploy.yaml --exclude-task abap-deploy-task generateFlexChangesBundle generateComponentPreload --clean-dest && deploy --config ui5-deploy.yaml\\",
\\"undeploy\\": \\"undeploy --config ui5-deploy.yaml --lrep \\\\\\"apps/the.original.app/appVariants/my.test.app/\\\\\\"\\",
\\"deploy\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip\\",
\\"undeploy\\": \\"npm run build && fiori undeploy --config ui5-deploy.yaml\\",
\\"deploy-test\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml --testMode true\\"
}
}
Expand Down Expand Up @@ -892,14 +903,15 @@ dist/
\\"devDependencies\\": {
\\"@sap/ux-ui5-tooling\\": \\"1\\",
\\"@ui5/task-adaptation\\": \\"^1.3.0\\",
\\"@ui5/cli\\": \\"^3.9.2\\"
\\"@ui5/cli\\": \\"^3.9.2\\",
\\"rimraf\\": \\"^5.0.5\\"
},
\\"scripts\\": {
\\"build\\": \\"ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest\\",
\\"start\\": \\"fiori run --open /test/flp.html#app-preview\\",
\\"start-editor\\": \\"fiori run --open /test/adaptation-editor.html\\",
\\"deploy\\": \\"ui5 build --config ui5-deploy.yaml --exclude-task deploy-to-abap generateFlexChangesBundle generateComponentPreload --clean-dest && fiori deploy --config ui5-deploy.yaml\\",
\\"undeploy\\": \\"fiori undeploy --config ui5-deploy.yaml --lrep \\\\\\"apps/the.original.app/appVariants/my.test.app/\\\\\\"\\",
\\"deploy\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip\\",
\\"undeploy\\": \\"npm run build && fiori undeploy --config ui5-deploy.yaml\\",
\\"deploy-test\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml --testMode true\\"
}
}
Expand Down Expand Up @@ -1134,14 +1146,15 @@ dist/
\\"devDependencies\\": {
\\"@sap/ux-ui5-tooling\\": \\"1\\",
\\"@ui5/task-adaptation\\": \\"^1.3.0\\",
\\"@ui5/cli\\": \\"^3.9.2\\"
\\"@ui5/cli\\": \\"^3.9.2\\",
\\"rimraf\\": \\"^5.0.5\\"
},
\\"scripts\\": {
\\"build\\": \\"ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest\\",
\\"start\\": \\"fiori run --open /test/flp.html#app-preview\\",
\\"start-editor\\": \\"fiori run --open /test/adaptation-editor.html\\",
\\"deploy\\": \\"ui5 build --config ui5-deploy.yaml --exclude-task deploy-to-abap generateFlexChangesBundle generateComponentPreload --clean-dest && fiori deploy --config ui5-deploy.yaml\\",
\\"undeploy\\": \\"fiori undeploy --config ui5-deploy.yaml --lrep \\\\\\"apps/the.original.app/appVariants/my.test.app/\\\\\\"\\",
\\"deploy\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip\\",
\\"undeploy\\": \\"npm run build && fiori undeploy --config ui5-deploy.yaml\\",
\\"deploy-test\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml --testMode true\\"
}
}
Expand Down Expand Up @@ -1225,6 +1238,9 @@ builder:
languages:
- sap: testId
i18n: testKey
connections:
- url: http://sap.example
ignoreCertErrors: false
",
"state": "modified",
},
Expand Down Expand Up @@ -1288,14 +1304,15 @@ dist/
\\"devDependencies\\": {
\\"@sap/ux-ui5-tooling\\": \\"1\\",
\\"@ui5/task-adaptation\\": \\"^1.3.0\\",
\\"@ui5/cli\\": \\"^3.9.2\\"
\\"@ui5/cli\\": \\"^3.9.2\\",
\\"rimraf\\": \\"^5.0.5\\"
},
\\"scripts\\": {
\\"build\\": \\"ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest\\",
\\"start\\": \\"fiori run --open /test/flp.html#app-preview\\",
\\"start-editor\\": \\"fiori run --open /test/adaptation-editor.html\\",
\\"deploy\\": \\"ui5 build --config ui5-deploy.yaml --exclude-task deploy-to-abap generateFlexChangesBundle generateComponentPreload --clean-dest && fiori deploy --config ui5-deploy.yaml\\",
\\"undeploy\\": \\"fiori undeploy --config ui5-deploy.yaml --lrep \\\\\\"apps/the.original.app/appVariants/my.test.app/\\\\\\"\\",
\\"deploy\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml && rimraf archive.zip\\",
\\"undeploy\\": \\"npm run build && fiori undeploy --config ui5-deploy.yaml\\",
\\"deploy-test\\": \\"npm run build && fiori deploy --config ui5-deploy.yaml --testMode true\\"
}
}
Expand Down Expand Up @@ -1379,6 +1396,9 @@ builder:
languages:
- sap: testId
i18n: testKey
connections:
- url: http://sap.example
ignoreCertErrors: false
",
"state": "modified",
},
Expand Down
Loading