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

Update 2.0 branch #41

Merged
merged 26 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5c4a48a
AC-2841:PHP 7.4 compatibility removal from the codebase
faizan-shk Aug 23, 2022
2a36095
AC-3005::Investigate drop of composer 1.x support
glo71317 Sep 8, 2022
41447a9
AC-6646::Add PHP 8.2 Compatibility Support
faizan-shk Oct 3, 2022
63f93e9
Merge pull request #9 from magento-gl/Hammer_PlatForm_Health_246_Scop…
sidolov Nov 2, 2022
e1c7920
Merge branch 'develop' of github.com:magento-gl/composer-root-update-…
faizan-shk Nov 10, 2022
0c8252c
AC-2841: Reverted removal of PHP7.4 support
faizan-shk Nov 14, 2022
d91dbc3
Merge pull request #8 from magento-gl/Hammer_PlatForm_Health_246_Scop…
sidolov Nov 16, 2022
533a9d5
2.0.3 version
sidolov Jan 4, 2023
8528f21
Merge pull request #10 from magento-amigos/2.0.3-version
sidolov Jan 4, 2023
dcbfe8b
Test fixes + compatibility with PHP 8.2
sidolov Jan 23, 2023
5f32fec
Tests configuration
sidolov Jan 23, 2023
4abb6ab
Tests configuration
sidolov Jan 23, 2023
f1e83a7
Tests configuration
sidolov Jan 23, 2023
af2cd89
Tests configuration
sidolov Jan 23, 2023
6d8cfef
Merge pull request #11 from magento-amigos/CCENG-125
sidolov Feb 13, 2023
b90ab7a
AC-10558::Adobe Commerce 2.4.7 core code is compatible with PHP 8.3
glo71317 Nov 15, 2023
cee07b7
Merge pull request #12 from magento-gl/AC-10558
sidolov Jan 16, 2024
a39d2e8
Declare return types to be compatible with composer 2.7+
Seldaek Feb 9, 2024
71a5a1a
Declare return types to be compatible with composer 2.7+
Seldaek Feb 9, 2024
307a56e
Add setApplication return type
Seldaek Feb 14, 2024
917d4e5
Merge pull request #39 from Seldaek/patch-1
sidolov Feb 14, 2024
bc98bd8
PHP 8.3 support
sidolov Feb 14, 2024
1f1519d
Update version to 2.0.4-beta1
sidolov Feb 14, 2024
4233bb9
Merge pull request #13 from magento-commerce/php8.3
sidolov Feb 14, 2024
bcb6c72
Update version in composer.json
sidolov Apr 9, 2024
ba35880
Merge pull request #42 from magento/sidolov-patch-1
sidolov Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This is a basic workflow to help you get started with Actions

name: Integration Tests

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
pull_request:
types: [opened, reopened,synchronize]
branches:
- develop

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

# Runs a single command using the runners shell
- name: Run composer install
run: composer install

# Runs a single command using the runners shell
- name: Run unit tests
run: php vendor/bin/phpunit tests/Integration
40 changes: 40 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This is a basic workflow to help you get started with Actions

name: Unit Tests

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
pull_request:
types: [opened, reopened,synchronize]
branches:
- develop

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

# Runs a single command using the runners shell
- name: Run composer install
run: composer install

# Runs a single command using the runners shell
- name: Run unit tests
run: php vendor/bin/phpunit tests/Unit
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"AFL-3.0"
],
"require": {
"php": "~7.3.0||~7.4.0||~8.0.0||~8.1.0",
"composer/composer": "^1.0 || ^2.0",
"php": "~7.3.0||~7.4.0||~8.0.0||~8.1.0||~8.2.0||~8.3.0",
"composer/composer": "^2.0",
"composer-plugin-api": "^1.0 || ^2.0"
},
"require-dev": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class OverrideRequireCommand extends ExtendableRequireCommand
* @param Application|null $application
* @return void
*/
public function setApplication(Application $application = null)
public function setApplication(Application $application = null): void
{
// For Composer versions below 2.1.6:
// In order to trick Composer into overriding its native RequireCommand with this class, the name needs to be
Expand All @@ -86,7 +86,7 @@ public function setApplication(Application $application = null)
*
* @return void
*/
protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down Expand Up @@ -170,7 +170,7 @@ protected function configure()
*
* @throws Exception
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->console = new Console($this->getIO(), $input->getOption(self::INTERACTIVE_OPT));
$this->pkgUtils = new PackageUtils($this->console);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@ class RequireCommerceCommand extends ExtendableRequireCommand
*/
protected $console;

/**
* @var array
*/
protected $repos;

/**
* Use the native RequireCommand config with options/doc additions for the root project composer.json update
*
* @return void
*/
protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down Expand Up @@ -149,7 +154,7 @@ protected function getFormattedHelp(): string
*
* @throws Exception
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->console = new Console($this->getIO(), $input->getOption(self::INTERACTIVE_OPT));
$console = $this->console;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function getEditionLabel(string $packageEdition): ?string
public function findRequire(Composer $composer, string $packageMatcher)
{
$requires = array_values($composer->getPackage()->getRequires());
if (@preg_match($packageMatcher, null) === false) {
if (@preg_match($packageMatcher, '') === false) {
foreach ($requires as $link) {
if ($packageMatcher == $link->getTarget()) {
return $link;
Expand Down
4 changes: 2 additions & 2 deletions src/Magento/ComposerRootUpdatePlugin/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "magento/composer-root-update-plugin",
"type": "composer-plugin",
"description": "Plugin to look ahead for Magento Open Source or Adobe Commerce project root changes when running composer update for new magento/product or magento/magento-cloud metapackage versions",
"version": "2.0.2",
"version": "2.0.4",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"php": "~7.3.0||~7.4.0||~8.0.0||~8.1.0",
"php": "~7.3.0||~7.4.0||~8.0.0||~8.1.0||~8.2.0||~8.3.0",
"composer/composer": "^1.0 || ^2.0",
"composer-plugin-api": "^1.0 || ^2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"vendor1/different-conflicting2": "2.0.0",
"vendor1/different-conflicting3": "3.0.0"
},
"config": {
"allow-plugins": true
},
"extra": {
"extra-key1": "install1",
"extra-key2": "target2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"Magento\\Sniffs\\": "dev/tests/framework/Magento/Sniffs/"
}
},
"config": {
"allow-plugins": true
},
"conflict": {
"vendor1/conflicting1": "1.0.0",
"vendor1/conflicting2": "2.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@
"sample-data": "Suggested Sample Data 1.0.0",
"vendor/suggested": "Another Suggested Package"
},
"config": {
"allow-plugins": true
},
"minimum-stability": "dev"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Composer\Package\RootPackageInterface;
use Composer\Plugin\PluginInterface;
use Composer\Repository\ComposerRepository;
use Composer\Repository\RepositoryInterface;
use Composer\Repository\LockArrayRepository;
use Composer\Repository\RepositoryManager;
use Composer\Util\RemoteFilesystem;
use Magento\ComposerRootUpdatePlugin\Utils\Console;
Expand Down Expand Up @@ -153,7 +153,7 @@ public function testGetOriginalRootNotOnRepo_NoConfirm()

public function testGetTargetRootFromRepo()
{
$this->repo->expects($this->any())->method('loadPackages')->willReturn(
$this->repo->expects($this->atLeast(1))->method('loadPackages')->willReturn(
[
'namesFound' => [$this->originalRoot->getName()],
'packages' => [
Expand Down Expand Up @@ -210,7 +210,16 @@ protected function setUp(): void
'isLocked',
'getLockedRepository'
]);
$lockedRepo = $this->getMockForAbstractClass(RepositoryInterface::class);
$lockedRepo = $this->getMockForAbstractClass(
LockArrayRepository::class,
[],
'',
true,
true,
true,
['getPackages'],
false
);
$originalProduct = $this->getMockForAbstractClass(PackageInterface::class);
$originalProduct->method('getName')->willReturn('magento/product-enterprise-edition');
$originalProduct->method('getVersion')->willReturn('1.1.0.0');
Expand All @@ -232,11 +241,15 @@ protected function setUp(): void
$this->originalRoot->method('getVersion')->willReturn('1.1.0.0');
$this->originalRoot->method('getStabilityPriority')->willReturn(0);

$this->targetRoot = $this->createPartialMock(Package::class, ['getName', 'getVersion', 'getStabilityPriority']);
$this->targetRoot = $this->createPartialMock(
Package::class,
['getName', 'getVersion', 'getStabilityPriority', 'getPrettyVersion']
);
$this->targetRoot->id = 2;
$this->targetRoot->method('getName')->willReturn('magento/project-enterprise-edition');
$this->targetRoot->method('getVersion')->willReturn('2.0.0.0');
$this->targetRoot->method('getStabilityPriority')->willReturn(0);
$this->targetRoot->method('getPrettyVersion')->willReturn('');

$repoManager = $this->createPartialMock(RepositoryManager::class, ['getRepositories']);
if ($apiMajorVersion == '1') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Composer\Package\Package;
use Composer\Package\RootPackage;
use Composer\Repository\ComposerRepository;
use Composer\Repository\LockArrayRepository;
use Composer\Repository\RepositoryInterface;
use Composer\Repository\RepositoryManager;
use Composer\Semver\Constraint\Constraint;
Expand Down Expand Up @@ -273,7 +274,16 @@ public function setUp(): void
$repo = $this->createPartialMock(ComposerRepository::class, []);
$repoManager = $this->createPartialMock(RepositoryManager::class, ['getRepositories']);
$repoManager->method('getRepositories')->willReturn([$repo]);
$lockedRepo = $this->getMockForAbstractClass(RepositoryInterface::class);
$lockedRepo = $this->getMockForAbstractClass(
LockArrayRepository::class,
[],
'',
true,
true,
true,
['getPackages'],
false
);
$lockedRepo->method('getPackages')->willReturn([
new Package('magento/product-community-edition', '1.0.0.0', '1.0.0')
]);
Expand Down
Loading