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: Use package name for product ORD IDs. #42

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

ductaily
Copy link
Contributor

@ductaily ductaily commented Aug 21, 2024

Addressing

  • ORD namespace (used as prefix in several ORD IDs) = package.name.replace(/@/,'').replace(/\//g,’'), unless explicitly configured in cds.env.ord.namespace
  • Products:
    • "ordId": "customer:product:capire.bookstore:”→ i.e. package.name.replace(/@/,'').replace(/\//g,'.')
    • "vendor": "customer:vendor:customer:”
    • "title": “capire bookstore”→ i.e. package.name.replace(/@/,'').replace(/\//g,' ')
    • "shortDescription": “capire bookstore" → i.e. package.name.replace(/@/,'').replace(/\//g,' ') - Description for + "package name"

from #38

@ductaily ductaily marked this pull request as ready for review August 21, 2024 12:55
Copy link
Contributor

@RoshniNaveenaS RoshniNaveenaS left a comment

Choose a reason for hiding this comment

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

Scenario:
Removing the sample .cdsrc JSON configuration for ord namespace and asyncapi namesapce,
The packageJSON name has special characters ( for example @cap-js/ordsample) the special character gets added and the namespace becomes cap-jsord for which the validator throws an error.
The special characters are also to be escaped here

Copy link
Contributor

@RoshniNaveenaS RoshniNaveenaS left a comment

Choose a reason for hiding this comment

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

Here if the title and short description are same the validator throws an error.
@Fannon you could help us better too to decide what to we do about this.

image

@Fannon
Copy link
Contributor

Fannon commented Aug 22, 2024

Here if the title and short description are same the validator throws an error. @Fannon you could help us better too to decide what to we do about this.

image

This rule will only cause issues when publishing to the Business Accelerator Hub, if you just have sap:core:v1 or none as policyLevel, it does not apply.

But I think it would still be better to avoid this problem in the first place, so if SAP collagues use this plugin, they don't have to rework. Maybe we can prefix the shortDescription with something like CAP application ? In the end, the shortDescription and description should be explicitly provided when publishing, so something more meaningful can be put there.

@RoshniNaveenaS
Copy link
Contributor

Tested and looks good!

@ductaily ductaily merged commit 7e1402c into main Aug 22, 2024
2 checks passed
@ductaily ductaily deleted the feat/ord-product-namespace branch August 22, 2024 11:28
@aramovic79 aramovic79 mentioned this pull request Aug 22, 2024
25 tasks
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