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

Feature/id reference for feeds validation #496

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
796 changes: 795 additions & 1 deletion package-lock.json

Large diffs are not rendered by default.

12,073 changes: 11,699 additions & 374 deletions packages/openactive-broker-microservice/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type ValidatorWorkerRequestParsedItem = {
validationMode: string;
item: unknown;
feedContextIdentifier: string;
rpdeKind: string;
};

export type ValidatorWorkerRequestParsed = ValidatorWorkerRequestParsedItem[];
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ async function createAndSaveValidatorInputsFromRpdePage(feedContextIdentifier, i
item: item.data,
validationMode: ITEM_VALIDATION_MODE,
feedContextIdentifier,
rpdeKind: item.kind,
})),
/* Items are split into chunks so e.g. a page with 500 items will, with chunk length 100, be split into 5 files
with 100 items each.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ async function run() {
const numItemsPerFeed = {};
/** @type {ValidatorWorkerResponse['errors']} */
const errors = [];
for (const { feedContextIdentifier, validationMode, item } of requestParsed) {
for (const { feedContextIdentifier, validationMode, item, rpdeKind } of requestParsed) {
numItemsPerFeed[feedContextIdentifier] = (numItemsPerFeed[feedContextIdentifier] ?? 0) + 1;

const allOaValidationErrors = await validate(item, {
loadRemoteJson: true,
remoteJsonCachePath: VALIDATOR_TMP_DIR,
remoteJsonCacheTimeToLive: 3600,
validationMode,
rpdeKind,
});

const newErrors = execPipe(allOaValidationErrors,
filter((oaValidationError) => (
oaValidationError.severity === 'failure'
Expand Down
Loading