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: Multiple service support #2499

Merged
merged 63 commits into from
Dec 2, 2024
Merged

feat: Multiple service support #2499

merged 63 commits into from
Dec 2, 2024

Conversation

broksy
Copy link
Contributor

@broksy broksy commented Oct 25, 2024

Adds support for multiple services and multiple annotations per service. Includes updates for multiple packages.

odata-service-writer

  • Added remove(basePath, service, fs?) to handle service related data removal from manifest.json and YAML files
  • Added optional parameter for generateMockserverConfig: 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 data
  • Manifest template enhanced with support for annotations used as object or array to have backward compatibility
  • enhanceData function updated with default service name and annotation name handling. mainService will be used as the default name for first service, _Annotation will be added to annotation name if annotation name matches service name to avoid generation of duplications in manifest dataSources section.

mockserver-config-writer

  • Added removeMockDataFolders(fs, basePath) to remove all mock data paths during running of removeMockserverConfig.

ui5-config

  • Added addServiceToMockserverMiddleware(dataSourceConfig, appRoot?, annotationsConfig = []) to add service to mockserver using information from manifest dataSource
  • Added removeServiceFromMockServerMiddleware(servicePath, annotationsPaths) to delete service from mockserver including annotations related to this service using information from manifest dataSource
  • Improved addBackendToFioriToolsProxydMiddleware(backend) to handle multiple backends and avoid duplicates
  • Added removeBackendFromFioriToolsProxydMiddleware(backendUrl) to delete backend from fiori-tools-proxy using

create

  • Added another question whether user wants to overwrite existing services when interactive mode is used for command. If true, then mockserver services will be overwritten based on manifest dataSources and only when ui5-mock.yaml is available.

fiori-freestyle-writer

  • Since merge with main branch snapshots on Windows started to fail, I changed hardcoded '/'(Unix like separator) to sep (universal separator) from path module during template generation in processDestinationPath(filePath) in order to make replace work also on Windows like paths.

@broksy broksy requested review from a team as code owners October 25, 2024 15:54
Copy link

changeset-bot bot commented Oct 25, 2024

🦋 Changeset detected

Latest commit: fd2d06e

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

This PR includes changesets to release 40 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/cf-deploy-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-reference-sub-generator Patch
@sap-ux/inquirer-common Patch
@sap-ux/ui5-library-sub-generator Patch
@sap-ux/fe-fpm-cli Patch
@sap-ux/deploy-config-generator-shared Patch
@sap-ux/flp-config-inquirer Patch
@sap-ux/cf-deploy-config-inquirer Patch
@sap-ux/ui5-library-inquirer 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 requested a review from a team as a code owner October 25, 2024 16:55
@broksy broksy added mockserver-config-writer @sap-ux/mockserver-config-writer odata-service-writer @sap-ux/odata-servier-writer ui5-config @sap-ux/ui5-config create @sap-ux/create labels Oct 25, 2024
johannes-kolbe
johannes-kolbe previously approved these changes Nov 29, 2024
Copy link
Contributor

@johannes-kolbe johannes-kolbe left a comment

Choose a reason for hiding this comment

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

PR for initial consumption lgtm.
Focused on tools-suite consumption and manual testing:

  • adding, deletion of services
  • handling of multiple services
  • fixed comments from earlier reviews
  • changeset provided

Copy link
Contributor

@heimwege heimwege left a comment

Choose a reason for hiding this comment

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

Mainly found some hard coded webapp paths that should be replaced by getWebappPath from project-access

heimwege
heimwege previously approved these changes Nov 29, 2024
Copy link
Contributor

@heimwege heimwege left a comment

Choose a reason for hiding this comment

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

review comments addressed -> re-approve 👍🏻

@broksy broksy dismissed tobiasqueck’s stale review November 29, 2024 15:31

Already reviewed by Dominik and Johannes.

johannes-kolbe
johannes-kolbe previously approved these changes Nov 29, 2024
Copy link
Contributor

@johannes-kolbe johannes-kolbe left a comment

Choose a reason for hiding this comment

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

Reapproving

Copy link
Contributor

@tobiasqueck tobiasqueck left a comment

Choose a reason for hiding this comment

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

Added a few comments for improvement, otherwise, the coding adheres to expectations. However, my local tests fail. @broksy I will send you an internal project that gets misconfigured when adding a mockserver config.

@broksy broksy dismissed stale reviews from heimwege and johannes-kolbe via c99bebb December 2, 2024 10:47
Copy link
Contributor

@tobiasqueck tobiasqueck left a comment

Choose a reason for hiding this comment

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

  • changeset ok
  • retesting successful
  • feedback applied

@broksy broksy merged commit 73475e5 into main Dec 2, 2024
16 checks passed
@broksy broksy deleted the feat/multiple-services branch December 2, 2024 16:10
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.

5 participants