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

feat: Support multiple services for ui5 yaml files and manifest.json #2455

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

broksy
Copy link
Contributor

@broksy broksy commented Oct 11, 2024

Allows to add multiple services in YAML file configurations and Manifest (and multiple annotations per service).
Previous logic only rewrote whole mockserver config. This is still possible, but through an optional parameter.
During mockserver config generation localService/data folder (mockdataPath) is also generated if it does not exist in project.

@broksy broksy requested review from a team as code owners October 11, 2024 10:43
Copy link

changeset-bot bot commented Oct 11, 2024

🦋 Changeset detected

Latest commit: e0e2e94

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
@sap-ux/mockserver-config-writer Minor
@sap-ux/odata-service-writer Minor
@sap-ux/ui5-config Minor
@sap-ux/create Minor
@sap-ux/fiori-elements-writer Patch
@sap-ux/fiori-freestyle-writer Patch
@sap-ux/odata-service-inquirer Patch
@sap-ux/generator-simple-fe Patch
@sap-ux/abap-deploy-config-inquirer Patch
@sap-ux/abap-deploy-config-writer Patch
@sap-ux/adp-tooling Patch
@sap-ux/app-config-writer Patch
@sap-ux/cards-editor-config-writer Patch
@sap-ux/deploy-tooling Patch
@sap-ux/environment-check Patch
@sap-ux/launch-config Patch
@sap-ux/project-access Patch
@sap-ux/telemetry Patch
@sap-ux/ui5-application-writer Patch
@sap-ux/ui5-library-reference-writer Patch
@sap-ux/ui5-library-writer Patch
@sap-ux/ui5-proxy-middleware Patch
@sap-ux/preview-middleware Patch
@sap-ux/annotation-generator Patch
@sap-ux/cap-config-writer Patch
@sap-ux/cards-editor-middleware Patch
@sap-ux/fe-fpm-writer Patch
@sap-ux/fiori-annotation-api Patch
@sap-ux/fiori-generator-shared Patch
@sap-ux/ui5-application-inquirer Patch
@sap-ux/ui5-library-reference-inquirer Patch
@sap-ux/ui5-library-sub-generator Patch
@sap-ux/fe-fpm-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@broksy broksy marked this pull request as draft October 11, 2024 10:44
@broksy broksy added odata-service-writer @sap-ux/odata-servier-writer mockserver-config-writer @sap-ux/mockserver-config-writer ui5-config @sap-ux/ui5-config create @sap-ux/create labels Oct 11, 2024
@broksy broksy changed the title feat: Support multiple services for ui5 yaml files feat: Support multiple services for ui5 yaml files and manifest.json Oct 14, 2024
@broksy broksy marked this pull request as ready for review October 15, 2024 12:40
@broksy broksy requested review from a team as code owners October 15, 2024 12:41
Copy link
Contributor

@Klaus-Keller Klaus-Keller left a comment

Choose a reason for hiding this comment

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

Hi @broksy,

I've tested adding a mockserver and found following issues:

In interactive mode there is no text for overwrite, it just gives the technical information questions.overwrite › (y/N):

✔ questions.pathToMock › mainService: /sap/opu/odata4/dmo/sb_travel_mdsk_o4/srvd/dmo/sd_travel_mdsk/0001/
? questions.overwrite › (y/N)

I can see a maintained text "Overwrite existing services", but can't see it in the question when running on command line.

After mockserver config has been added to a project, the empty filewebapp/localService/data/keep is stored in that project. Is this intentionally? I don't think we should add the empty keep file. We can create the folder empty, but in my opinion it is then for the developer to decide, what to do with the empty folder.

There is an issue with the unit tests in @sap-ux/mockserver-config-writer
image

Comment on lines 2341 to 2344
"webapp/localService/data/keep": Object {
"contents": "",
"state": "modified",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should not add empty keep files. If a module relies on the fact the folder webapp/localService/data exists, we need to make it more robust.

Comment on lines 2341 to 2344
"webapp/localService/data/keep": Object {
"contents": "",
"state": "modified",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should generate empty keep files into a project.

packages/create/src/cli/add/mockserver-config.ts Outdated Show resolved Hide resolved
packages/ui5-config/src/middlewares.ts Outdated Show resolved Hide resolved
@Klaus-Keller
Copy link
Contributor

Hi @broksy,

I've tested adding a mockserver and found following issues:

In interactive mode there is no text for overwrite, it just gives the technical information questions.overwrite › (y/N):

✔ questions.pathToMock › mainService: /sap/opu/odata4/dmo/sb_travel_mdsk_o4/srvd/dmo/sd_travel_mdsk/0001/
? questions.overwrite › (y/N)

I can see a maintained text "Overwrite existing services", but can't see it in the question when running on command line.

I found the issue with i18n, there was a conflict due to global initialization of i18n in @sap-ux/cap-config-writer and @sap-ux/mockserver-config-writer. I switched now to an own instance of i18n for @sap-ux/mockserver-config-writer, see commit 5162ea3.

@@ -71,7 +71,7 @@ export interface OdataService {
/**
* Annotations can either be EDMX annotations or CDS annotations.
*/
annotations?: EdmxAnnotationsInfo | CdsAnnotationsInfo;
annotations?: EdmxAnnotationsInfo[] | CdsAnnotationsInfo[];
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking type change. @sap/fiori-generator will need to be updated to accomodate, or better if you continue to support backward compatible single entries

Copy link

sonarcloud bot commented Oct 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create @sap-ux/create mockserver-config-writer @sap-ux/mockserver-config-writer odata-service-writer @sap-ux/odata-servier-writer ui5-config @sap-ux/ui5-config
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants