-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: move tinyyaml to lyaml #11312
feat: move tinyyaml to lyaml #11312
Conversation
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.
LGTM
Please wait for some more REVIEWERS and don't merge for now.
|
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.
LGTM
Regarding the changes in config-default.yaml:
|
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 think this hack can be removed https://github.com/apache/apisix/pull/11080/files#diff-ab3c55c5825b9d6c1f2a2e296c658ea10092998b5a53feca14fd3988bcf8209aR87
where a placeholder string was replaced to get around null problems. Will you remove this in this PR?
Do we need to change it to |
Reply to @moonming
This should be controlled by some boolean value, e.g.
It should even be further integrated with port settings, e.g.
These bad designs will be corrected by me (maybe), but not in this PR. there are many things just waiting to be revolutionized. |
Reply to @Revolyssup It could probably be deleted, but I don't want it here. Because I also want to make some changes to where the YAML is generated. The reason: overwriting the old config.yaml file with the regenerated YAML does not preserve user comments, which may break some user efforts. So I think it's better to generate it at runtime and use logging output or output to file like |
This design was imported by #9600, looking forword a better one. |
Yes, the current design is not good but it is still work, so it will not be modified in this PR. If we plan to modify it, we should design it first and switch between APISIX 3 and APISIX 4. |
Description
APISIX now uses a YAML parser called
tinyyaml
, which has a number of problems, such as:There have been many issues logged for tinyyaml. https://github.com/apache/apisix/issues?q=tinyyaml
This PR therefore introduces a change to replace tinyyaml with a wrapper for the libyaml C library, which is the C reference implementation of the YAML project. It is more standardized and advanced.
Theoretically, if the user is using a fully YAML-compliant document, the change is insensitive. Otherwise it will report an error.
So I think it's largely backward compatible. But as stated in the background above, in the past our developers created so many buggy test cases that they had to be fixed one by one. The good thing is that they have been fixed completely and without substantially changing the testing process.
The outliers in config-default.yaml have also been fixed.
Checklist