Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix(*): reject config if both deprecated and new field defined and their values mismatch #13565
fix(*): reject config if both deprecated and new field defined and their values mismatch #13565
Changes from all commits
eabcd44
e69e9fb
125c653
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have
translate_backwards
and nowreplaced_with
. what is the difference here and what is thispath = ...
, there is nopath =
withtranslate_backwards
. Can we use single thing for both?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plan is to use only one of them - I want to get rid of
translate_backwards
- however it would require quite a lot code removal so I wanted to get it in another PR. It's going to be a refactor PR so it's not going to block the release.This addition - although it's a little bit of code duplication I think it's just safer / quicker path. I'll prepare cleanup PRs once this one is merged - I promise 😄
As a bonus I think we can even automate the message - I'm planning to still allow custom message but the way right now it's defined is rather repetitive and it looks like we have all the knowledge we need to generate those deprecation warnings automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plus... the more I work with it the more I hate the name
translate_backwards
- it's just confusing.replaced_with
insidedeprecation
right now makes more sense to me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If both
translate_backwards
andreplaced_with
can fix the bug, we'd better stick with thetranslate_backwards
and avoid introducing an extra metaschema in this PR.The refactor and introduction of
replaced_with
can be made in another PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we cannot use only one of the since
translate_backwards
is a single just a table path and we need to have an array of table paths. The reason is that one field can be replaced by a few fields ex:redis.timeout
andredis.connect_timeout
/redis.send_timeout
/redis.read_timeout
.We need to have a way to check against all 3 of these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a test case just for that. Maybe it explains it a little bit better: https://github.com/Kong/kong/pull/13565/files#diff-be157ebd3368ec7ae7c30ab60332aebbd18f627ec4fa680156e6d6cd1706f668R4233