Skip to content

[Argus] Fix config parsing bug#4788

Merged
mnaamani merged 4 commits intoJoystream:masterfrom
zeeshanakram3:argus_fix_config_parsing_bug
Jun 12, 2023
Merged

[Argus] Fix config parsing bug#4788
mnaamani merged 4 commits intoJoystream:masterfrom
zeeshanakram3:argus_fix_config_parsing_bug

Conversation

@zeeshanakram3
Copy link
Copy Markdown
Contributor

addresses #4787

@vercel
Copy link
Copy Markdown

vercel bot commented Jun 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
pioneer-testnet ⬜️ Ignored (Inspect) Jun 12, 2023 1:08pm

@mnaamani
Copy link
Copy Markdown
Member

mnaamani commented Jun 9, 2023

Would merging #4759 without this fix be problematic?

@zeeshanakram3
Copy link
Copy Markdown
Contributor Author

Would merging #4759 without this fix be problematic?

The error fixed in this PR occurred if we didn't provide the required property of an optional object in config.yml. In #4759, a new property logs.elastic.index is being added, which is already optional. So I think we won't have an issue if we merge #4759 without this fix.

public constructor(message: string, errors: Ajv['errors']) {
const errorMessages: string[] = []
errors?.forEach((e) => errorMessages.push(`${e.dataPath}: ${e.message} (${JSON.stringify(e.params)})`))
errors?.forEach((e) => errorMessages.push(`${e.instancePath}: ${e.message} (${JSON.stringify(e.params)})`))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see this change from dataPath to instancePath is due to newer version of ajv package. https://ajv.js.org/api.html#validation-errors

But storage-node also uses ajv for schema validation so we may need to do a similar fix there

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Both storage-node & distributor-node have in-package import of ajv dependency from storage-node/node_modules & distributor-node/node_modules/ as it's added separately in storage-node/package.json & distributor-node/package.json.

  • However, I have updated ajv dependency to ^8..0.0 in /storage-node & /cli
  • Removed ajv dependency from /types, as it's unused

@zeeshanakram3 zeeshanakram3 requested a review from mnaamani June 12, 2023 13:08
Copy link
Copy Markdown
Member

@mnaamani mnaamani left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants