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

Fix: Empty default packages caused by models without event definitions #119

Open
zongqichen opened this issue Feb 2, 2025 · 1 comment
Labels
Milestone

Comments

@zongqichen
Copy link
Contributor

When models lack eventResources definitions, the ORD loader initializes empty packages due to overstrict conditional logic:

// lib/ord.js (Line 150)
if (
  _getAPIResources(linkedCsn, appConfig).length &&  // AND condition
  _getEventResources(linkedCsn, appConfig).length   // ← Problematic check
) {
  ordDocument.packages = _getPackages(...);
}

It will cause following issues:

  • packagesIds is empty
  • no partOfPackage in entityTypes

We need to investigate why do we need to consider eventResouces when get packages and extend fully tests. At the moment, ord test does not cover no event testcase.

@swennemers
Copy link
Contributor

Please have 2 test cases:

  1. with only api resource
  2. with only event resource

to ensure having any package calculation is independent of other resource types being available.

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

No branches or pull requests

2 participants