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(core): add runtime check for performBulk #785

Merged
merged 3 commits into from
May 15, 2024

Conversation

eliangcs
Copy link
Member

@eliangcs eliangcs commented May 14, 2024

Adds a runtime check perform-bulk-return-type to ensure the result returned by the performBulk function follow the requirements:

  1. The returned object must contain all the IDs from the input bundle.bulk.
  2. Every sub-object in the returned object has an outputData object or an error string.

I found there was no integration test that ran all the checks in the checkOutput middleware, so I added one. Since I enabled the checks by adding command: 'execute' here, some other test cases in create-app.js started failing. I ended up refactoring many of the test cases.

@eliangcs eliangcs requested a review from rnegron as a code owner May 14, 2024 07:42
@eliangcs eliangcs requested a review from kola-er May 14, 2024 13:10
.filter((id) => id);

const outputIds = Object.keys(results);
const missingIds = inputIds.filter((id) => !outputIds.includes(id));
Copy link
Member Author

Choose a reason for hiding this comment

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

@FokkeZB do you think if the output should contain all the IDs in the input (bundle.bulk)? The current implementation assumes yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, correct. With outputData and (or?) an optional error.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the requirements in the description. So now each item must have an outputData object or an error string.

@eliangcs
Copy link
Member Author

eliangcs commented May 15, 2024

@kola-er just pushed a4080da so the result item must have either one of outputData or error. Can you re-review? Thanks!

@eliangcs eliangcs merged commit b02b238 into release-15.8.0 May 15, 2024
13 checks passed
@eliangcs eliangcs deleted the PDE-4990-perform-bulk-return-type-check branch May 15, 2024 07:02
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.

None yet

3 participants