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

[Argus] Fix config parsing bug #4788

Merged
merged 4 commits into from
Jun 12, 2023

Conversation

zeeshanakram3
Copy link
Contributor

addresses #4787

@vercel
Copy link

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
Member

mnaamani commented Jun 9, 2023

Would merging #4759 without this fix be problematic?

@zeeshanakram3
Copy link
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.

@@ -7,7 +8,7 @@ export class ValidationError extends Error {

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
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
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

Copy link
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