Skip to content

feat: use default options from dk#36

Merged
Kronprinz03 merged 16 commits intomainfrom
feat-use-new-dk2
Mar 12, 2026
Merged

feat: use default options from dk#36
Kronprinz03 merged 16 commits intomainfrom
feat-use-new-dk2

Conversation

@SirSimon04
Copy link
Contributor

only needed to do cds-tsx import --from process ... as all the required options are set by default

@SirSimon04 SirSimon04 requested a review from a team as a code owner March 12, 2026 14:25
@hyperspace-insights
Copy link
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Refactor: Use Default Import Options from CDS and Remove Manual package.json Updates

Refactor

♻️ Simplified the cds import --from process integration by leveraging default options provided by the CDS development kit (dk), removing the need for manual package.json service registration.

Changes

  • cds-plugin.ts: Registers default import options for the process source (no_copy: true, as: 'cds', config: 'kind=rest') via cds.import.options.process, so users no longer need to pass these flags manually.

  • lib/processImport.ts:

    • Removed the addServiceToPackageJson helper function and all calls to it — service registration in package.json is now handled automatically by the CDS dk based on the configured options.
    • Removed the getModelPathFromFilePath utility function, which was only needed for the package.json update logic.
    • Updated the CSN model meta.creator field from 'cds-import-process' to '@cap-js/process'.
  • tests/bookshop/srv/external/eu12.bpm-horizon-walkme.sdshipmentprocessor.shipmentHandler.cds:

    • Updated checksum after regeneration.
    • Changed shipmentProcessResultOutput in ProcessOutputs to be nullable (removed not null).
    • Added a new ProcessInstanceStatus type and updated getInstancesByBusinessKey to use it instead of an inline many String.
  • tests/integration/process-import/process-import.test.ts: Removed all test cases covering the now-deleted Package.json Update logic.


  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.18.4 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Correlation ID: 43eb2760-1e1f-11f1-84ff-42e5f6374749
  • Event Trigger: pull_request.opened
  • Summary Prompt: Default Prompt
  • LLM: anthropic--claude-4.6-sonnet
  • Output Template: Default Template

💌 Have ideas or want to contribute? Create an issue and share your thoughts with us!
📑 Check out the documentation for more information.
📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

Made with ❤️ by Hyperspace.

Copy link
Contributor

@hyperspace-insights hyperspace-insights bot left a comment

Choose a reason for hiding this comment

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

The PR is clean overall — the removal of the addServiceToPackageJson logic and its associated tests is well-scoped, and the new ProcessInstanceStatus named type is a good improvement. One substantive issue was found: the unconditional assignment of cds.import.options.process should use ??= to remain consistent with the surrounding initialization pattern and to respect any user-provided overrides.

PR Bot Information

Version: 1.18.4 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Correlation ID: 43eb2760-1e1f-11f1-84ff-42e5f6374749
  • Event Trigger: pull_request.opened
  • LLM: anthropic--claude-4.6-sonnet

@SirSimon04
Copy link
Contributor Author

Nevermind, not overruling the other PR. Locally everything works, is there something i need to do wrt to typescript to make this work?

Locally i can not even npm run build in tests/bookshop on main because of ts errors:

@Kronprinz03 @tilwbr What is the problem here?

  Try `npm i --save-dev @types/sap__cds` if it exists or add a new declaration (.d.ts) file containing `declare module '@sap/cds';`
@cds-models/_/index.ts(3,22): error TS7016: Could not find a declaration file for module '@sap/cds'. '/Users/I569192/Documents/cap/dev/cap/process/node_modules/@sap/cds/lib/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/sap__cds` if it exists or add a new declaration (.d.ts) file containing `declare module '@sap/cds';`
srv/annotation-service.ts(1,17): error TS7016: Could not find a declaration file for module '@sap/cds'. '/Users/I569192/Documents/cap/dev/cap/process/node_modules/@sap/cds/lib/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/sap__cds` if it exists or add a new declaration (.d.ts) file containing `declare module '@sap/cds';`
srv/annotation-service.ts(9,10): error TS2339: Property 'on' does not exist on type 'AnnotationService'.
srv/annotation-service.ts(10,28): error TS2552: Cannot find name 'SELECT'. Did you mean 'onselect'?
srv/annotation-service.ts(16,10): error TS2339: Property 'on' does not exist on type 'AnnotationService'.
srv/annotation-service.ts(17,28): error TS2552: Cannot find name 'SELECT'. Did you mean 'onselect'?
srv/annotation-service.ts(24,10): error TS2339: Property 'on' does not exist on type 'AnnotationService'.
srv/annotation-service.ts(25,28): error TS2552: Cannot find name 'SELECT'. Did you mean 'onselect'?
srv/annotation-service.ts(31,10): error TS2339: Property 'on' does not exist on type 'AnnotationService'.

@SirSimon04 SirSimon04 marked this pull request as draft March 12, 2026 14:35
@SirSimon04
Copy link
Contributor Author

Hmm, when i copy the srv/external/...service.cds from main. And i think this change is not due to my import change, because when i checkout main and execute

cds-tsx import --from process ./workflows/eu12.bpm-horizon-walkme.sdshipmentprocessor.shipmentHandler.json --force --config kind=rest --no-copy --as cds

then the external service gets changed. I think we should always align the workflow file and the generated service. We should add the compilation step maybe in the pipeline to execute the tests against the latest import functionality to ensure a working e2e scenario. Locally, the tests run when i import the process again (with a few changes, that i cant happen to push).

@SirSimon04 SirSimon04 marked this pull request as ready for review March 12, 2026 14:47
Copy link
Contributor

@Kronprinz03 Kronprinz03 left a comment

Choose a reason for hiding this comment

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

LGTM

@Kronprinz03 Kronprinz03 merged commit aa38b17 into main Mar 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants