-
Notifications
You must be signed in to change notification settings - Fork 10
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
Tdr 22/get depencencies from composer #764
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.
Some suggestions/ideas and failed tests.
* @throws ManifestNotFoundException | ||
* @throws exception\MalformedManifestException | ||
*/ | ||
public function __construct($filePath, ComposerInfo $composerInfo = null) |
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 it would be better to pass directory name instead of manifest file path here. This class is more suitable for manifest fine name constant, than common_ext_Extension
and later in the code we use directory name to read composer files.
…22/get_depencencies_from_composer
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.
composer.lock
is meant to be for internal usage for Composer and its structure can vary from release to release.
Instead it's strongly advised to build on Composer's public API which has been introduced with Composer 2 and being supported by TAO.
@hutnikau now that we have Composer 2 support, please consider updating the PR to be built on a standard and reliable API.
…22/get_depencencies_from_composer
I pushed a commit with usage of composer API, but unfortunately it does not provide full information about the package, so we still need to read lock file (to get |
I'm having failing unit tests locally:
|
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 the updates @hutnikau. This is an important milestone in the life of TAO :).
There are some comments left. Most of them are originated to ComposerInfo
and its contract. Please check them out!
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 the quick update @hutnikau!
I have a failing unit test, please have a look:
❯ vendor/bin/phpunit generis/test/unit --bootstrap generis/test/bootstrap.php
PHPUnit 8.5.14 by Sebastian Bergmann and contributors.
............................................................... 63 / 308 ( 20%)
SSSSSSSS....................................................... 126 / 308 ( 40%)
..................SSSSSSSSSSSS................................. 189 / 308 ( 61%)
....................EF......................................... 252 / 308 ( 81%)
........................................................ 308 / 308 (100%)
Time: 12.69 seconds, Memory: 24.00 MB
There was 1 error:
1) oat\generis\test\unit\extension\ComposerInfoTest::testGetAvailableTaoExtensions
common_ext_ExtensionException: Composer lock file missed at /composer.lock
/Users/mihaly.hadju/repos/sandbox/generis/common/oatbox/extension/ComposerInfo.php:156
/Users/mihaly.hadju/repos/sandbox/generis/common/oatbox/extension/ComposerInfo.php:78
/Users/mihaly.hadju/repos/sandbox/generis/test/unit/extension/ComposerInfoTest.php:43
--
There was 1 failure:
1) oat\generis\test\unit\extension\ComposerInfoTest::testExtractExtensionDependencies
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
- 'taoItemBank' => '*'
)
/Users/mihaly.hadju/repos/sandbox/generis/test/unit/extension/ComposerInfoTest.php:49
ERRORS!
Tests: 308, Assertions: 960, Errors: 1, Failures: 1, Skipped: 20.
There's a comment on a - first glance - peculiar static call, which IMO requires further elaboration. Then from my side we are good to roll 🚀
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.
Right in the finish line. Passing unit tests 🚀 Comments resolved 🚀 Thanks for the fun @hutnikau
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.
Review Checklist
- New code is covered by tests (if applicable)
- Tests are running successfully (old and new ones) on my local machine (if applicable)
- New code is respecting code style rules
- New code is respecting best practices
- New code is not subject to concurrency issues (if applicable)
- The feature is working correctly on my local machine (if applicable)
- Acceptance criteria are respected
- Pull request title and description are meaningful
…22/get_depencencies_from_composer
The changes were made in accordance with the comments.
No description provided.