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

Not able to consistently (or globally) overwrite vendor and product #123

Open
StefanHenke opened this issue Feb 3, 2025 · 3 comments
Open

Comments

@StefanHenke
Copy link

StefanHenke commented Feb 3, 2025

By default, the ord plugin generates fields with "customer":

  • products.ordId: "customer:product:...."
  • products.vendor: "customer:vendor:Customer:"
  • vendor: "customer:vendor:Customer:"

I want to overwrite these values for a SAP-internal case, but faced a few troubles.

What I tried to do is adding the following config to .cdsrc.json:

"cds": {
    "ord": {
      "products": [
        {
          "ordId": "sap:product:eb.bm.tests:",
          "vendor": "sap:vendor:SAP:"
        }
      ],
      "packages": [
        {
          "vendor": "sap:vendor:Customer:"
        }
      ]
     }

This led to an ord which had a correct product section. However, the packages section still had the original product referenced:

"partOfProducts": [
        "customer:product:eb.bm.tests:"
      ]

Maybe this is related to #121.

Besides this, the vendor within the packages was not replaces at all. I think the semantics I used is wrong. However, I did not find a way to apply something like "replace the vendor field in all the packages that are auto-generated by the ord plugin".

@swennemers
Copy link
Contributor

So far the solution is a simplistic overwrite solution. I agree, that we can improve this.

@swennemers
Copy link
Contributor

#129 related, at SAP products are also typically added via global ORD registry repo. Maybe we add a property like existingProductORDId: to the .cdsrc.json that would prevent the creation of a customer product and packages would pickup this product. @Fannon , @StefanHenke, @aramovic79 , @zongqichen , what do you think?

@StefanHenke
Copy link
Author

@swennemers: I don´t understand the approach in total, but it sounds promising. What would existingProductORDId hold as a value? Would it be something like sap:product:eb.bm.tests: in my above example so that no products object would be included in the ord document? I´m asking because the packages object does not refer to a product, but a vendor. So, I´m wondering how this would be replaced then.

Could you shed some light on this global ORD registry repo. This is different from the system namespace repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants