-
Notifications
You must be signed in to change notification settings - Fork 919
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
chore(config-validator): update ajv to v8 #3242
Conversation
Thanks @Zirak ! |
No no, thank you.
I was unsure whether to tick the bugfix or breaking change. Naively, this is not breaking; it only deals with the configuration checking mechanism, nothing big. But it might, maybe? It may be possible to have a configuration which previously passed validation, but no longer now that ajv is more strict. It's also possible that I did not create a good real-world schema for the commitlint/@commitlint/config-validator/src/commitlint.schema.json Lines 83 to 90 in 97b3273
If we want to err on the side of caution it might be better to define this as breaking? What do you think?
You are very correct, I was sure I had one on my personal account yet nada. Created one, do you know if it'll get picked up or should I force-push to retrigger? |
In these cases I pray to the OSS gods and rub 🔮 3 times and hope that @armano2 might have a look.
Might be safer, yes. Ugh. Another major version :D
Please try a push and hopefully this will trigger the checks, thanks! |
Huzzah! My apologies for resurrecting a dead horse.
It is done! |
there should no be any impacts for this upgrade, as we are using it for simple validation most notable change is that schema is compiled to es6 instead of es5 as for breaking changes, they mostly relate to https://ajv.js.org/v6-to-v8-migration.html you may also consider using https://ajv.js.org/standalone.html#generating-function-s-using-cli, if we see any performance impact (v8 is slower than v6) |
That's sort of true - some strict mode settings are enabled by default in ajv (or rather, We can turn all of them off to minimise potential 3rd-party breakage, which sounds like a good compromise. |
Sounds good to me |
ajv introduced some breaking changes from v6 to v7, and from v7 to v8. Most can be found in [their migration guide](https://ajv.js.org/v6-to-v8-migration.html). This commit addresses the following: - `ErrorObject.dataPath` was renamed to `ErrorObject.instacePath` - Wordings of some errors changed (e.g. "should" -> "must") - Strict mode does not allow a top-level `default` value - Disable [strict mode](https://ajv.js.org/strict-mode.html) - The `plugins` schema included an invalid object definition for `rules` - `schemaId` is no longer an ajv option - `missingRefs` no longer seems to affect the usage of ajv in the project - `addKeyword` has its signature changed The tests pass and everyone's seemingly happy; do say if anything's still scary-looking. Obsoletes conventional-changelog#2888.
Thanks! 🥇 |
Description
ajv introduced some breaking changes from v6 to v7, and from v7 to v8. Most can
be found in their migration guide.
This commit addresses the following:
ErrorObject.dataPath
was renamed toErrorObject.instacePath
default
valuerule
array definition, seeUnconstrained tuples
plugins
schema included an invalid object definition forrules
schemaId
is no longer an ajv optionmissingRefs
no longer seems to affect the usage of ajv in the projectaddKeyword
has its signature changedThe tests pass and everyone's seemingly happy; do say if anything's still
scary-looking.
Motivation and Context
Obsoletes #2888.
How Has This Been Tested?
Ran the unit tests, did a couple of manual smoke runs.
Types of changes
Checklist: