-
Notifications
You must be signed in to change notification settings - Fork 973
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
Compatibility issues with version 7.4.0 #967
Comments
@deguif I know this issue are related to the new code generation that is 100% align with the REST API specification of Elasticsearch (using the script util/GenerateEndpoints.php). Before, everything was managed manually and there were some inconsistencies in the namespace and in the code implementation. Regarding your example, the API is ingest.delete_pipeline.json that is translated in Unfortunately, I cannot do nothing here apart from helping other projects like Elastica to fix the issues. |
Thanks @ezimuel for your answer. What about adding class aliases to keep the backward compatibility until a new major release is published? Do you think it should be doable on this project? That can also be done on |
@deguif this is a potential fix, let me double check the code first. I'll update you soon. Thanks for the suggestion btw! |
Another solution would be to move those changes into a Major release |
@thePanz I cannot continue to maintain such amount of code manually. I need to be consistent with the Elasticsearch API specification, that's why I wrote the code generation tool. |
Btw, this BC break is only for library/projects that use directly (some) endpoint classes. From a user land perspective, the endpoints are still the same. For instance the ingest.delete_pipeline mentioned before has the same function name: $params = [ /* ... */ ];
$result = $client->ingest()->deletePipeline($params); // as before 7.3 |
Just ran into this issue with scout-elasticsearch-driver repo. I've had to pinpoint my release to 7.3.* for now as it was causing fatal errors in production. It's really not ideal to release a BC on a second point release. |
@deguif, @thePanz I just sent the PR #968 to fix the issue with the old namespaces. Please review, thanks! @iamthefreeman I know and I'm sorry for that. This BC breaks is related with some old namespace used in the code. There was some inconsistency with the previous endpoints. Now the code is 100% generated from the REST API specification of Elasticsearch, so no more dead code in the future. Sorry again, I'll release 7.4.1 as soon #968 will be merged. |
I really disagree with breaking changes on a minor release. Everyone relies that minor releases doesn't contains any intentional breaking changes. The 7.4.0 contains two intentional breaking changes (I say that's intentional because are written on changelog). This release broke this widely used package https://github.com/babenkoivan/scout-elasticsearch-driver/issues/297 and many of our applications. I understand that you need to be consistent with elasticsearch API, but I'm pretty sure they doesn't add any breaking changes on minor releases. |
@iget-master let me try to explain what happened with 7.4.0 release. First of all, I agree with you but there were some difficult condition that drove me in this direction. The existing code base of This process requires a lot of time and it's not error free, in fact we had some inconsistencies in the endpoints like missing endpoints, parameters or not updated one. In order to reduce these inconsistencies and release a client library that is 100% aligned with the API of Elasticsearch, I built a tool in tool/GenerateEndpoints.php. This tool is able to read the API specification and generate the classes for all the Endpoints and Namespaces. I used this tool to generate the endpoints shipped in 7.4.0 and there was some unexpected BC breaks with previous class naming, because these old names were not following the API specification. For instance, the mtermvectors endpoint was translated manually into Regarding the intentional BC break in Again, I'm really sorry for these changes but I hope you can now understand better the motivation behind this decision. Just to recap, I'm working on |
@deguif can you test this PR with Elastica to see if this solves all the BC break issues? Thanks! |
@iamthefreeman can you test this PR against your scout-elasticsearch-driver project to see if this solves all the BC break issues? Thanks! |
@ezimuel Thanks for your work on this issue. A lot of errors are now fixed, with your PR about the class aliases.
|
@deguif thanks for reporting this, I'm looking into it. |
Here my composer setup for testing your PR (that might help other people):
|
Modern PHP frameworks (Laravel, Symfony) will generally convert every error (even So adding any kind of |
@AegirLeet in a production environment, if you have If I convert the |
Setting But modern PHP code will catch every single error, warning or notice and convert it to an So triggering an It's no big deal, i quickly downgraded to 7.3 when the error appeared, but you should probably keep this in mind for future releases. |
@AegirLeet I see what you mean, but still I think this a problem of how you configure your PHP application in a production environment. Even in Laravel of Symfony you have different environment configuration for logging the PHP events (error/warning/notice/deprecated, etc) as exceptions. In your opinion, If I cannot use Thanks for your feedback! |
@ezimuel @AegirLeet in Symfony the Found in the Yaml parser of Symfony. |
I'd use Either that or make it very clear in the docs that this package does not follow SemVer and users should lock their minor versions. @thePanz In those cases, isn't the |
@thePanz thanks, also in Zend Framework, the project that I worked on, uses it. For instance, in @AegirLeet I feel that using only @thePanz interesting the idea of suppress error with |
@deguif I just added the missing |
@ezimuel I don't see any changes in your PR, did you push the changes? |
@deguif sorry, I sent now. I think it's better to call it a day. |
@ezimuel that's working ;) Thanks for that. |
@deguif you are welcome and thanks for your kindly support! |
I understand your reasons. Maybe it's my fault to rely too mutch on
versioning, I should be more restrictive.
Em seg, 25 de nov de 2019 14:21, Enrico Zimuel <[email protected]>
escreveu:
… @deguif <https://github.com/deguif> you are welcome and thanks for your
kindly support!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#967?email_source=notifications&email_token=ACH7OT6MA5NUBTHMRUUHAG3QVQCRZA5CNFSM4JPFZBQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFDE3TI#issuecomment-558255565>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACH7OT6OGFRS2WNDP2W4X2TQVQCRZANCNFSM4JPFZBQQ>
.
|
I just released 7.4.1 that solves the BC break related to the endpoint class naming and it solves also the |
Summary of problem or feature request
Since version 7.4.0 was published, it seems some classes were renamed which break compatiblity.
For example,
Elasticsearch\Endpoints\Ingest\Pipeline\Delete
was renamed toElasticsearch\Endpoints\Ingest\DeletePipeline
See ruflin/Elastica#1710 for reference.
The text was updated successfully, but these errors were encountered: