-
Notifications
You must be signed in to change notification settings - Fork 41
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: Multiple service support #2499
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 6da046a The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
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 |
You fix for the fiori-freestyle-writer issue has been addressed in #2532 as it was blocking other PRs as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments. Some improvement suggestions, some nit-picks (sorry for that), some type issues but no major issues
packages/mockserver-config-writer/src/mockserver-config/ui5-mock-yaml.ts
Outdated
Show resolved
Hide resolved
packages/mockserver-config-writer/src/mockserver-config/ui5-mock-yaml.ts
Outdated
Show resolved
Hide resolved
packages/mockserver-config-writer/src/mockserver-config/ui5-mock-yaml.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- changeset ok
- review comments addressed
- test coverage is very good
- did NOT test manually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @broksy - Review focused on:
- Code review in general
odata-service-writer
- generate command- adding services to
ui5-local|ui5-mock.yaml
- adding service to
manifest.json
-
localUri
path is not resolved tometadata.xml
- first service in manifest should be
sap.ui5/models/"": { … }
, notsap.ui5/models/"serviceName"
-
- adding services to
- Manual testing with
tools-suite
consumption - Did not test:
- Deletion of services
- Add command
- CDS annotation scenario
); | ||
|
||
// Create local copy of metadata and annotations | ||
fs.write(join(webappPath, 'localService', 'metadata.xml'), prettifyXml(service.metadata, { indent: 4 })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to work hardcoded for adding multiple services - Adding a new service would delete the old metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 54a778d
"<%- localAnnotationsName %>" | ||
<% } %> | ||
] | ||
<% if (locals.metadata) { %>, | ||
"localUri": "localService/metadata.xml" <% } %><%if (version === '4') {%>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localUri
also has to be dynamically rendered. It is dependent on the folder the service is moved/generated to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in e5029f3
"uri": "/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Annotations(TechnicalName='<%- encodeURIComponent(annotation.technicalName) %>',Version='0001')/$value/", | ||
"type": "ODataAnnotation", | ||
"settings": { | ||
"localUri": "localService/<%- annotation.technicalName %>.xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here with localUri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in e5029f3
"uri": "/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Annotations(TechnicalName='<%- encodeURIComponent(annotations.technicalName) %>',Version='0001')/$value/", | ||
"type": "ODataAnnotation", | ||
"settings": { | ||
"localUri": "localService/<%- annotations.technicalName %>.xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here with localUri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in e5029f3
Currently it's up to consumer. However, I can enhance
In such case it will always make sure that:
Done in 6da046a |
Quality Gate passedIssues Measures |
Adds support for multiple services and multiple annotations per service. Includes updates for multiple packages.
odata-service-writer
remove(basePath, service, fs?)
to handle service related data removal from manifest.json and YAML filesgenerateMockserverConfig
: overwrite (if true, then mockserver services and annotations are overwritten based on manifest dataSources), else dataSources for services and annotations from manifest are collected and appended to the existing mockserver datamockserver-config-writer
removeMockDataFolders(fs, basePath)
to remove all mock data paths during running ofremoveMockserverConfig
.ui5-config
addServiceToMockserverMiddleware(dataSourceConfig, appRoot?, annotationsConfig = [])
to add service to mockserverremoveServiceFromMockServerMiddleware(servicePath, annotationsPaths)
to delete service from mockserver including annotations related to this serviceremoveBackendFromFioriToolsProxydMiddleware(backendUrl)
to delete back from fiori-tools-proxycreate
fiori-freestyle-writer
'/'
(Unix like separator) tosep
(universal separator) frompath
module during template generation inprocessDestinationPath(filePath)
in order to make replace work also on Windows like paths.