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

ORD Metadata changes #38

Open
23 of 25 tasks
RamIndia opened this issue Jul 25, 2024 · 7 comments
Open
23 of 25 tasks

ORD Metadata changes #38

RamIndia opened this issue Jul 25, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@RamIndia
Copy link
Contributor

RamIndia commented Jul 25, 2024

Please find attached the ord documents we walked through in our review:

Here are the changes decided for the ORD document :

  • Don’t add a suffix if I already specified a .json suffix in the -o / —dest parameter
  • Use .ord.json as file suffix instead of .ord if not
  • Always add "$schema": "https://sap.github.io/open-resource-discovery/spec-v1/interfaces/Document.schema.json"
  • Never use CSN's .namespace property but always just use the fully-qualified names from .definitions
  • 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,' ')

groups

  • "title": "Catalog Service” → i.e. without appending “ Title”
  • The groups for events shall be services, not the individual events → but then the last two entries in the bookstore sample are duplicates

packages

  • → the namespace was wrong and the package name shall be package.name.replace(/@/,'').replace(/\//g,'.')
  • "partOfProducts": [ "customer:product:capire.bookstore:” ] → has to be the same as the product name in the products section
  • "vendor": "customer:vendor:customer:” → has to be the same as the vendor in the products section
  • "title": "capire bookshop” → take what is there, don’t add extra text like “sample title for"
  • “shortDescription" → take what is there, don’t add extra text like “Here’s the short description for ..."
  • “description" → take what is there, don’t add extra text like “Here’s the short description for ..."

consumptionBundles

  • skip (do not include)

apiResources

  • "title": "Catalog Service” → take what is there, don’t add extra text like “The service is for ..."
  • “shortDescription": "Catalog Service” → take what is there, don’t add extra text like “Here we have the shortDescription for ..."
  • “description": "Catalog Service” → take what is there, don’t add extra text like “Here we have the description for ..."
  • "partOfPackage": "customer.capirebookstore:package:capire.bookshop:v1” → correct namespace prefix in package ref - use appName as packageName as a fallback

eventResources

  • The entries are service-level, not event-level
  • IMPORTANT: test with more than one event declared per service → should end up in one entry, not many

Explanation:

  • one catalog contains several events -> one event resource in ORD

Tests

  • Jest tests and CI/CD
@aramovic79
Copy link
Contributor

aramovic79 commented Aug 22, 2024

TODO: Check-mark the check-boxes given in the issue body (only) after merging the related pull requests.
Related PRs: #42 && #43
cc: @ductaily @Fannon @RoshniNaveenaS

@aramovic79
Copy link
Contributor

Regarding the Don’t add a suffix if I already specified a .json suffix in the -o / —dest parameter:
The fix should be implemented in the cds-dk repo, not in the ord plugin.
Compiler is always attaching the suffix that is equal to the -to parameter value.
Check by running e.g. : cds compile srv/services.cds -2 csn -o ORD15.someext => Result is: ORD15.someext.csn (or -2 SQL)

@RoshniNaveenaS @ductaily @Fannon

@aramovic79
Copy link
Contributor

aramovic79 commented Aug 26, 2024

The same as above stands for Use .ord.json as file suffix instead of .ord if not.
Check-marked both issues because the fix shall not be done in cap-js/ord plugin.

@RoshniNaveenaS @ductaily @Fannon

@RamIndia
Copy link
Contributor Author

Regarding the Don’t add a suffix if I already specified a .json suffix in the -o / —dest parameter: The fix should be implemented in the cds-dk repo, not in the ord plugin. Compiler is always attaching the suffix that is equal to the -to parameter value. Check by running e.g. : cds compile srv/services.cds -2 csn -o ORD15.someext => Result is: ORD15.someext.csn (or -2 SQL)

@RoshniNaveenaS @ductaily @Fannon

@stewsk: As of now cds compile -2 always appends the extension, can we ignore appending the format if extension is specified in the -o parameter?

@ductaily
Copy link
Contributor

@aramovic79 @Fannon

The issue regarding Don’t add a suffix if I already specified a .json suffix in the -o / —dest parameter will be resolved in cds-dk 8.2.0. See corresponding issue: https://github.tools.sap/cap/issues/issues/16685

@aramovic79
Copy link
Contributor

@zongqichen @ductaily : I've checked marked items that are done. I'm not sure for the remaining. Could you please take a look and check-mark the finished ones? Thanks!

@zongqichen
Copy link
Contributor

Hi @aramovic79, I marked the Jest and CICD pipeline item. I think we basically introduced the test and action as pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants