dependabot-composer 0.171.3 → 0.171.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b833ba87f97c5665f318047b4de70a036403b0fa583a58229e4dfe77a4a5fc6
4
- data.tar.gz: 4924e3d8b18df1a46840c4962bfeccc7f6b7b18863954ecb5c29cbcdbc554574
3
+ metadata.gz: eb001cd7b0bc9f4323dfc02b7a80ccd1e47e1ad293bd8bdad7dc34348bac158b
4
+ data.tar.gz: 1893abdd91f67025dd0ae54eefc454f7a04f3d9a8ced334178dbd3efaa95ef4f
5
5
  SHA512:
6
- metadata.gz: e23d989c68794afa9f0195be520eaa1a9ec6f99c16d7bc2f8afad48de415fca539fde2cefeb373bf0f7d331512dc0c1334cfce5123e0c2d9564c5dcf7e1f7069
7
- data.tar.gz: aeb34bde83d46e412ede3f1d2e89d4502f1e6e64ecdd8cf24c307c35edeadac0c5cfd26f6318251320ad8314b969af6d40ba051b6086e2c6b394459ac09717bd
6
+ metadata.gz: 716a7b39fe93ba1ea7357658fb5740a300f39c0bf4001e5beb6e9305c16e88b8933f80588be0fa909dec2e638ef00097986f4a60f49cad47b0c8887382067075
7
+ data.tar.gz: 1dc40e9f0724fdfb8d55847f0b4d17cd79b8c3df2658c72d1f73ab4a2c9f4296fe246d97648e1972f42b44feee28ce0104e9fdf9c243dff41f0c179bba5f54f5
@@ -8,7 +8,6 @@ use Composer\DependencyResolver\Request;
8
8
  use Composer\Factory;
9
9
  use Composer\Installer;
10
10
  use Composer\Package\PackageInterface;
11
- use Composer\Util\Filesystem;
12
11
 
13
12
  final class UpdateChecker
14
13
  {
@@ -48,15 +47,6 @@ final class UpdateChecker
48
47
  $io->loadConfiguration($config);
49
48
  }
50
49
 
51
- $installationManager = new DependabotInstallationManager($composer->getLoop(), $io);
52
-
53
- $fs = new Filesystem(null);
54
- $binaryInstaller = new Installer\BinaryInstaller($io, rtrim($composer->getConfig()->get('bin-dir'), '/'), $composer->getConfig()->get('bin-compat'), $fs);
55
-
56
- $installationManager->addInstaller(new Installer\LibraryInstaller($io, $composer, null, $fs, $binaryInstaller));
57
- $installationManager->addInstaller(new Installer\PluginInstaller($io, $composer, $fs, $binaryInstaller));
58
- $installationManager->addInstaller(new Installer\MetapackageInstaller($io));
59
-
60
50
  $install = new Installer(
61
51
  $io,
62
52
  $config,
@@ -64,7 +54,7 @@ final class UpdateChecker
64
54
  $composer->getDownloadManager(),
65
55
  $composer->getRepositoryManager(),
66
56
  $composer->getLocker(),
67
- $installationManager,
57
+ $composer->getInstallationManager(),
68
58
  $composer->getEventDispatcher(),
69
59
  $composer->getAutoloadGenerator()
70
60
  );
@@ -72,6 +62,7 @@ final class UpdateChecker
72
62
  // For all potential options, see UpdateCommand in composer
73
63
  $install
74
64
  ->setUpdate(true)
65
+ ->setInstall(false)
75
66
  ->setDevMode(true)
76
67
  ->setUpdateAllowTransitiveDependencies(Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS)
77
68
  ->setDumpAutoloader(false)
@@ -86,7 +77,7 @@ final class UpdateChecker
86
77
 
87
78
  $install->run();
88
79
 
89
- $installedPackages = $installationManager->getInstalledPackages();
80
+ $installedPackages = $composer->getLocker()->getLockedRepository(true)->getPackages();
90
81
 
91
82
  $updatedPackage = current(array_filter($installedPackages, static function (PackageInterface $package) use ($dependencyName): bool {
92
83
  return $package->getName() === $dependencyName;
@@ -78,6 +78,7 @@ final class Updater
78
78
  $install
79
79
  ->setWriteLock(true)
80
80
  ->setUpdate(true)
81
+ ->setInstall(false)
81
82
  ->setDevMode(true)
82
83
  ->setUpdateAllowList([$dependencyName])
83
84
  ->setUpdateAllowTransitiveDependencies(Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-composer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.171.3
4
+ version: 0.171.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-26 00:00:00.000000000 Z
11
+ date: 2022-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.171.3
19
+ version: 0.171.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.171.3
26
+ version: 0.171.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -203,7 +203,6 @@ files:
203
203
  - helpers/v2/composer.json
204
204
  - helpers/v2/composer.lock
205
205
  - helpers/v2/phpstan.neon
206
- - helpers/v2/src/DependabotInstallationManager.php
207
206
  - helpers/v2/src/DependabotPluginManager.php
208
207
  - helpers/v2/src/ExceptionIO.php
209
208
  - helpers/v2/src/Hasher.php
@@ -1,74 +0,0 @@
1
- <?php
2
-
3
- declare(strict_types=1);
4
-
5
- namespace Dependabot\Composer;
6
-
7
- use Composer\DependencyResolver\Operation\InstallOperation;
8
- use Composer\DependencyResolver\Operation\UninstallOperation;
9
- use Composer\DependencyResolver\Operation\UpdateOperation;
10
- use Composer\Installer\InstallationManager;
11
- use Composer\Package\PackageInterface;
12
- use Composer\Repository\InstalledRepositoryInterface;
13
- use React\Promise\PromiseInterface;
14
-
15
- final class DependabotInstallationManager extends InstallationManager
16
- {
17
- private array $installed = [];
18
- private array $updated = [];
19
- private array $uninstalled = [];
20
-
21
- public function execute(InstalledRepositoryInterface $repo, array $operations, $devMode = true, $runScripts = true): void
22
- {
23
- foreach ($operations as $operation) {
24
- $method = $operation->getOperationType();
25
- // NOTE: skipping download() step
26
- $this->$method($repo, $operation);
27
- }
28
- }
29
-
30
- public function install(InstalledRepositoryInterface $repo, InstallOperation $operation): ?PromiseInterface
31
- {
32
- $this->installed[] = $operation->getPackage();
33
-
34
- return null;
35
- }
36
-
37
- public function update(InstalledRepositoryInterface $repo, UpdateOperation $operation): ?PromiseInterface
38
- {
39
- $this->updated[] = [$operation->getInitialPackage(), $operation->getTargetPackage()];
40
-
41
- return null;
42
- }
43
-
44
- public function uninstall(InstalledRepositoryInterface $repo, UninstallOperation $operation): ?PromiseInterface
45
- {
46
- $this->uninstalled[] = $operation->getPackage();
47
-
48
- return null;
49
- }
50
-
51
- /**
52
- * @return PackageInterface[]
53
- */
54
- public function getInstalledPackages(): array
55
- {
56
- return $this->installed;
57
- }
58
-
59
- /**
60
- * @return PackageInterface[]
61
- */
62
- public function getUpdatedPackages(): array
63
- {
64
- return $this->updated;
65
- }
66
-
67
- /**
68
- * @return PackageInterface[]
69
- */
70
- public function getUninstalledPackages(): array
71
- {
72
- return $this->uninstalled;
73
- }
74
- }