modularity icon indicating copy to clipboard operation
modularity copied to clipboard

Aligned behavior using build

Open luislard opened this issue 9 months ago • 1 comments

Please check if the PR fulfills these requirements

  • [ ] The commit message follows our guidelines
  • [ ] Tests for the changes have been added (for bug fixes/features)
  • [ ] Docs have been added/updated (for bug fixes/features)

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)?

  • It is not possible to connect packages if the caller is built. Tests were added.
  • It is possible to call $package->build() and the status of the package will not 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

luislard avatar Apr 28 '24 17:04 luislard