inpsyde / modularity

A PSR-11 implementation for WordPress Plugins, Themes or Libraries.
https://inpsyde.github.io/modularity/
GNU General Public License v2.0
44 stars 4 forks source link

Aligned behavior using build #45

Closed luislard closed 4 days ago

luislard commented 4 months ago

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) Bug fix

What is the current behavior? (You can also link to an open issue here)

Bug: Misaligned behavior with build The package has changed from using a boot method with passed modules to adding modules and having a build stage before boot.

Not all the tests were aligned by the time the new approach was added. I added some tests to check the current behavior and found a couple of misalignments.

Bug: Calling $package->build() several times change package status to STATUS_FAILED

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Current consumers using the following code will have to adapt it.

$package1 = Package::new()->addModule($serviceModule1)->build();
$package2 = Package::new()->addModule($serviceModule2)->build();
$package2->connect($package1);

Other information: We need to find a better way to get Container Status as mentioned in here

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.88%. Comparing base (7538809) to head (4f1825c). Report is 19 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #45 +/- ## ============================================ + Coverage 98.87% 98.88% +0.01% - Complexity 192 196 +4 ============================================ Files 9 9 Lines 531 538 +7 ============================================ + Hits 525 532 +7 Misses 6 6 ``` | [Flag](https://app.codecov.io/gh/inpsyde/modularity/pull/45/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inpsyde) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/inpsyde/modularity/pull/45/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inpsyde) | `98.88% <100.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inpsyde#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gmazzap commented 4 days ago

No need for this anymore.

The combination of #49 #51 and #52 addresses all the issues raised in this PR.

Thank you everyone involved.