dependabot-composer 0.261.0 → 0.262.0

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: ad3c2bf542a453e6dd583bcf447762569b5a652828023d2546dba347892320c2
4
- data.tar.gz: edb2cee7203bbf98f8170e4dc7cf1569c9ccc1ee03a0692f3ee9872bfa59f646
3
+ metadata.gz: cef627bd53c4b51bad2f11380088be6de740186425f3e0789a59bb2984fa116d
4
+ data.tar.gz: 8c3c28b458966d465b562bbe54bedeec36c620eabe957be6ce509578b3b1aa6e
5
5
  SHA512:
6
- metadata.gz: 4c1ea090f9355a605c2880eb3ce466550db51c25df3427a004edd6a333be3b9f46bb75940dcac2b7a917bdc6ea8376f87e0c4c6cea897c39a5c215f071781064
7
- data.tar.gz: 209468410090a35cf5b44106682bdc6f80d612eb593e941196d37f2ca48c832f6ce1ea67779c01862b1c6830fd9498af64f62073af47e9e9f08d76b11ceaf3ea
6
+ metadata.gz: 047460f1a9404841034df7d2ff0dacb32d81ac71dc4bd8b562c69c44e62ffcede7804345770dc2f0652be74f0a80418a8b4c647ff128d05675bfad53556ee5da
7
+ data.tar.gz: 2f5c24197c84632f64fc749de6d7350281ada80ad98d31730f98d70352ab6db4fcfac57a7070ef0669643d9ff0fd447ea29c8c2bdb0b4b48800e3a276013cdb3
@@ -8,13 +8,15 @@ use Composer\DependencyResolver\Request;
8
8
  use Composer\Factory;
9
9
  use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
10
10
  use Composer\Installer;
11
+ use Composer\Package\Link;
11
12
  use Composer\Package\PackageInterface;
13
+ use Composer\Package\Version\VersionParser;
12
14
 
13
15
  final class UpdateChecker
14
16
  {
15
17
  public static function getLatestResolvableVersion(array $args): ?string
16
18
  {
17
- [$workingDirectory, $dependencyName, $gitCredentials, $registryCredentials] = $args;
19
+ [$workingDirectory, $dependencyName, $gitCredentials, $registryCredentials, $latestAllowableVersion] = $args;
18
20
 
19
21
  $httpBasicCredentials = [];
20
22
 
@@ -48,10 +50,22 @@ final class UpdateChecker
48
50
  $io->loadConfiguration($config);
49
51
  }
50
52
 
53
+ $package = $composer->getPackage();
54
+
55
+ $versionParser = new VersionParser();
56
+
57
+ $constraint = $versionParser->parseConstraints($latestAllowableVersion); // your version constraint
58
+ $packageLink = new Link($package->getName(), $dependencyName, $constraint);
59
+
60
+ $requires = $package->getRequires();
61
+ $requires[$dependencyName] = $packageLink;
62
+
63
+ $package->setRequires($requires);
64
+
51
65
  $install = new Installer(
52
66
  $io,
53
67
  $config,
54
- $composer->getPackage(), // @phpstan-ignore-line
68
+ $package, // @phpstan-ignore-line
55
69
  $composer->getDownloadManager(),
56
70
  $composer->getRepositoryManager(),
57
71
  $composer->getLocker(),
@@ -148,7 +148,8 @@ module Dependabot
148
148
  Dir.pwd,
149
149
  dependency.name.downcase,
150
150
  git_credentials,
151
- registry_credentials
151
+ registry_credentials,
152
+ @latest_allowable_version.to_s
152
153
  ]
153
154
  )
154
155
  end
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.261.0
4
+ version: 0.262.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-13 00:00:00.000000000 Z
11
+ date: 2024-06-20 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.261.0
19
+ version: 0.262.0
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.261.0
26
+ version: 0.262.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -286,7 +286,7 @@ licenses:
286
286
  - MIT
287
287
  metadata:
288
288
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
289
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.261.0
289
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.262.0
290
290
  post_install_message:
291
291
  rdoc_options: []
292
292
  require_paths: