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 broken API output for composer based installs #13272
Fix broken API output for composer based installs #13272
Conversation
I'm also running the tests on the API library to see if they pass, which is required. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 5.0 #13272 +/- ##
=========================================
Coverage 58.60% 58.60%
Complexity 32985 32985
=========================================
Files 2183 2183
Lines 98755 98755
=========================================
Hits 57875 57875
Misses 40880 40880
|
Tested the patch manually. Default mautic install (from repo). Contact api provides expected results. Checking code, the changes look correct to me. Also can confirm the API tests pass. One thing to note (perhaps not blocking on this thing), is if we could / should update tests to run on a composer based install (without the composer.lock file), or a seperate action running tests both in composer.lock install / composer based install. If not blocking i this i can create an issue for that? Further more (noting i'm not up to speed with the API-tests) if is we could see if this has actually test coverage in the api-tests package. I think this would need an API (failing) test run with only the package update. |
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.
Thanks for fixing this, Mattias!
@mallezie can you please validate if your tests of this PR were successful? I'm not clear on that from your comment. Especially this line is confusing to me:
|
@escopecz
This just was to confirm the issue that on composer based install (without the changes from the PR) the issue occurs. With the changes in this PR. Everything is okay. |
For future developments / problems in this area. I've verified that the API tests would have caught this issue (if they ran a composer based install). Which was an open concern from my side. Since the api library tests are switching to a docker based (composer based install) for their testing, there is no point now in adjusting the api-library tests. If fields are not shown in an api-response, the api tests catch it, so that's good. |
Description:
(see also the research of @mallezie in #13243 (comment))
On the
5.0
branch (and all other 5 branches), thejms/serializer-bundle
dependency is required as^5.0
and locked to5.1.0
However, when installing Mautic via composer (e.g. via the
mautic/recommended-project
), or testing/using the new Docker images (that internally use themautic/recommended-project
), there is nocomposer.lock
file, and at this point5.4.0
is used.This is problematic, as there is has been (IMO a BC breaking) incompatibility in following versions:
The main change is that
jms_serializer.metadata.annotation_driver
is removed and replaced byjms_serializer.metadata.annotation_or_attribute_driver
.Since Mautic depends on that name, this currently breaks all API where data is processed by the
jms/serializer-bundle
This PR addresses this, by locking the version to
^5.4
, and adapting the logic in the compilerpass and alternatice class.Steps to test this PR: