Skip to content
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

Still support the latest older versions of doctrines orm 2, dbal 3 and lexer 3 #97

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

alexander-schranz
Copy link
Contributor

@alexander-schranz alexander-schranz commented Feb 5, 2024

After lexer 3 support is merged. I rebased this branch to keep support for older doctrine versions.

TODO

  • Run tests?

@x86demon
Copy link
Collaborator

x86demon commented Feb 5, 2024

@alexander-schranz to run tests follow steps defined in the .travis.yml

https://github.com/oroinc/doctrine-extensions/blob/master/.travis.yml#L27-L42

@TNAJanssen
Copy link

Can i help to get this done?

@alexander-schranz
Copy link
Contributor Author

alexander-schranz commented Feb 19, 2024

@TNAJanssen I did not yet have any time to test if all test still runs. Please feel free to take this over and check all the test matrixes defined in the .travis.yml. For @x86demon I would recommend to switch to Github Actions as travis CI is not longer run here for the pull requests as I think travis did cancel open source support in August 2022

@x86demon
Copy link
Collaborator

x86demon commented Feb 19, 2024

@alexander-schranz thank you for recommendation of Github Actions, I'll take a look.
Please make sure your changes are compatible with both versions of the lexer. Now it looks like a change in favor of v3 only.

@alexander-schranz
Copy link
Contributor Author

alexander-schranz commented Feb 19, 2024

@x86demon the ->value and ->type already existed at 2.0. https://github.com/doctrine/lexer/blob/2.0.0/src/Token.php#L26 It just not longer ArrayAccess in 3.0 https://github.com/doctrine/lexer/blob/3.0.0/src/Token.php#L15 which was used in this library.

@Gwemox
Copy link
Contributor

Gwemox commented Apr 18, 2024

I made this request in the PR #99

@alexander-schranz
Copy link
Contributor Author

We are currently stuck on orm: 2 would still be great to have a version of oro extensions which supports the lexer 3 also with orm 2. I think there is atleast one 2.x doctrine/orm version which is fully compatibility with doctrine/orm 3.x as they have a smooth upgrade and deprecation path inside doctrine.

@Gwemox
Copy link
Contributor

Gwemox commented Apr 18, 2024

Your code works with Lexer 2.0 and Lexer 3.0, however the tests fail because you need to change the annotation with doctrine/annotations: 2.0 :

tests/Oro/Tests/Connection/TestUtil.php:

$config = Setup::createAnnotationMetadataConfiguration([$entitiesPath], true);

should be changed to

$config = Setup::createAnnotationMetadataConfiguration([$entitiesPath], true, null, null, false);

tests/Oro/Entities/Foo.php:
Change the annotations to use the prefix @ORM\ and include:

use Doctrine\ORM\Mapping as ORM;

After these changes, I think we can merge into version 2.x.

@Gwemox
Copy link
Contributor

Gwemox commented Apr 18, 2024

@alexander-schranz thank you for recommendation of Github Actions, I'll take a look. Please make sure your changes are compatible with both versions of the lexer. Now it looks like a change in favor of v3 only.

New CI here : #100

@alexander-schranz alexander-schranz changed the title Add support for doctrine/lexer 3 Still support the latest version of doctrines orm 2, dbal 3 and lexer 3 Jul 5, 2024
@alexander-schranz alexander-schranz force-pushed the feature/lexer-3 branch 3 times, most recently from 32bbbdb to e2775aa Compare July 5, 2024 12:41
@alexander-schranz
Copy link
Contributor Author

alexander-schranz commented Jul 5, 2024

I rebased and adopted the Test Matrix to show that even on the new prefer-lowest the tests seems to run as expected. The only upgrade now is dbal 2 -> 3.

@Gwemox
Copy link
Contributor

Gwemox commented Jul 5, 2024

The tests do not explicitly verify proper functioning with Doctrine version 3 or 2. In case they are blocked by another dependency. Wouldn't it be better to use the --with parameter of Composer?

@alexander-schranz alexander-schranz force-pushed the feature/lexer-3 branch 2 times, most recently from fda77d5 to 0c34feb Compare July 5, 2024 13:07
@alexander-schranz
Copy link
Contributor Author

alexander-schranz commented Jul 5, 2024

@Gwemox sure we could make a more complex CI but still --prefer-lowest should always part of a CI to make sure that lowest constraints are correctly defined :). What we could is also add a test to check if --prefer-lowest runs on expected versions instead of add more and more CI builts.

I did have a quicklook at doctrine/dbal 2 support. But think that is something which we should skip. That are too many BC layer changes that it is worth.

@alexander-schranz alexander-schranz force-pushed the feature/lexer-3 branch 2 times, most recently from d503ace to 331fc58 Compare July 5, 2024 13:20
@alexander-schranz alexander-schranz changed the title Still support the latest version of doctrines orm 2, dbal 3 and lexer 3 Still support the latest older versions of doctrines orm 2, dbal 3 and lexer 3 Jul 5, 2024
@alexander-schranz alexander-schranz marked this pull request as ready for review July 5, 2024 13:33
Copy link
Contributor Author

@alexander-schranz alexander-schranz Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This make sure that the CI not accidently not longer tests dbal 3, orm 2 or lexer 2 when being run on --prefer-lowest.

@alexander-schranz
Copy link
Contributor Author

@x86demon did let the CI rerun. Looks all fine. Can you recheck this Pull Request?

@x86demon
Copy link
Collaborator

@alexander-schranz PR looks good, thank you for contribution, Is it ready for merge?

@alexander-schranz
Copy link
Contributor Author

Ready to merge :)

@x86demon x86demon merged commit ec7b24d into oroinc:master Dec 10, 2024
48 checks passed
@alexander-schranz alexander-schranz deleted the feature/lexer-3 branch December 10, 2024 17:19
@alexander-schranz
Copy link
Contributor Author

alexander-schranz commented Dec 10, 2024

@x86demon Thx, this will make update lot easier as they can already get the new oro extension on orm 2 and you don't require to support 2 extension versions.

Is something else we need to tackle for the 3.0 release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants