Skip to content

Commit 16da29e

Browse files
Merge branch '10.3' into 11.0
2 parents 57e8095 + 4d7bcdc commit 16da29e

File tree

10 files changed

+73
-11
lines changed

10 files changed

+73
-11
lines changed

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
* Removed models API
1111
* Bumped min PHP to 7.2.5
1212

13-
[11.0.0-RC1]: https://github.com/GitLabPHP/Client/compare/10.2.0...11.0.0-RC1
13+
[11.0.0-RC1]: https://github.com/GitLabPHP/Client/compare/10.3.0...11.0.0-RC1
14+
15+
## [10.3.0] - UPCOMING
16+
17+
[10.3.0]: https://github.com/GitLabPHP/Client/compare/10.2.0...10.3.0
1418

1519
## [10.2.0] - UPCOMING
1620

1721
* Added variable_type to addVariable and updateVariable
22+
* Added get pipeline bridget jobs method
23+
24+
[10.2.0]: https://github.com/GitLabPHP/Client/compare/10.1.2...10.2.0
25+
26+
## [10.1.2] - 2020-11-09
27+
28+
* Fixed comparing repositories
1829

19-
[10.2.0]: https://github.com/GitLabPHP/Client/compare/10.1.1...10.2.0
30+
[10.1.2]: https://github.com/GitLabPHP/Client/compare/10.1.1...10.1.2
2031

2132
## [10.1.1] - 2020-10-26
2233

psalm-baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="4.0.1@b1e2e30026936ef8d5bf6a354d1c3959b6231f44">
2+
<files psalm-version="4.1.1@16bfbd9224698bd738c665f33039fade2a1a3977">
33
<file src="src/Api/AbstractApi.php">
44
<InvalidArgument occurrences="1"/>
55
</file>

src/Api/Jobs.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,27 @@ public function pipelineJobs($project_id, int $pipeline_id, array $parameters =
8787
);
8888
}
8989

90+
/**
91+
* @param int|string $project_id
92+
* @param int $pipeline_id
93+
* @param array $parameters {
94+
*
95+
* @var string|string[] $scope The scope of bridge jobs to show, one or array of: created, pending, running, failed,
96+
* success, canceled, skipped, manual; showing all jobs if none provided.
97+
* }
98+
*
99+
* @return mixed
100+
*/
101+
public function pipelineBridges($project_id, int $pipeline_id, array $parameters = [])
102+
{
103+
$resolver = $this->createOptionsResolver();
104+
105+
return $this->get(
106+
$this->getProjectPath($project_id, 'pipelines/').self::encodePath($pipeline_id).'/bridges',
107+
$resolver->resolve($parameters)
108+
);
109+
}
110+
90111
/**
91112
* @param int|string $project_id
92113
* @param int $job_id

src/Api/MergeRequests.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ public function all($project_id = null, array $parameters = [])
115115
$resolver->setDefined('with_merge_status_recheck')
116116
->setAllowedTypes('with_merge_status_recheck', 'bool')
117117
;
118+
$resolver->setDefined('approved_by_ids')
119+
->setAllowedTypes('approved_by_ids', 'array')
120+
->setAllowedValues('approved_by_ids', function (array $value) {
121+
return \count($value) === \count(\array_filter($value, 'is_int'));
122+
})
123+
;
118124

119125
$path = null === $project_id ? 'merge_requests' : $this->getProjectPath($project_id, 'merge_requests');
120126

tests/Api/JobsTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,28 @@ public function shouldGetPipelineJobs(): void
5353
$this->assertEquals($expectedArray, $api->pipelineJobs(1, 2, ['scope' => [Jobs::SCOPE_PENDING, Jobs::SCOPE_RUNNING]]));
5454
}
5555

56+
/**
57+
* @test
58+
*/
59+
public function shouldGetPipelineBridges(): void
60+
{
61+
$expectedArray = [
62+
['id' => 1, 'name' => 'A bridge job'],
63+
['id' => 2, 'name' => 'Another bridge job'],
64+
];
65+
66+
$api = $this->getApiMock();
67+
$api->expects($this->once())
68+
->method('get')
69+
->with('projects/1/pipelines/2/bridges', [
70+
'scope' => ['pending', 'running'],
71+
])
72+
->will($this->returnValue($expectedArray))
73+
;
74+
75+
$this->assertEquals($expectedArray, $api->pipelineBridges(1, 2, ['scope' => [Jobs::SCOPE_PENDING, Jobs::SCOPE_RUNNING]]));
76+
}
77+
5678
/**
5779
* @test
5880
*/

tests/Api/MergeRequestsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function shouldGetAllWithParams(): void
6666
'source_branch' => 'develop',
6767
'target_branch' => 'master',
6868
'with_merge_status_recheck' => true,
69+
'approved_by_ids' => [1],
6970
])
7071
->will($this->returnValue($expectedArray))
7172
;
@@ -84,6 +85,7 @@ public function shouldGetAllWithParams(): void
8485
'source_branch' => 'develop',
8586
'target_branch' => 'master',
8687
'with_merge_status_recheck' => true,
88+
'approved_by_ids' => [1],
8789
]));
8890
}
8991

vendor-bin/phpstan/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"require": {
3-
"php": "^7.2.5",
4-
"phpstan/phpstan": "~0.12.51",
3+
"php": "^7.2.5 || ^8.0",
4+
"phpstan/phpstan": "~0.12.54",
55
"phpstan/phpstan-deprecation-rules": "~0.12.5",
66
"phpstan/phpstan-strict-rules": "~0.12.5",
77
"thecodingmachine/phpstan-strict-rules": "~0.12.1",
8-
"ergebnis/phpstan-rules": "~0.15.2"
8+
"ergebnis/phpstan-rules": "~0.15.3"
99
},
1010
"config": {
1111
"preferred-install": "dist"

vendor-bin/phpunit/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
3-
"php": "^7.2.5",
4-
"phpunit/phpunit": "^8.5.8 || ^9.3.7"
3+
"php": "^7.2.5 || ^8.0",
4+
"phpunit/phpunit": "^8.5.8 || ^9.4.2"
55
},
66
"config": {
77
"preferred-install": "dist"

vendor-bin/psalm/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
3-
"php": "^7.3",
4-
"psalm/phar": "~4.0.1"
3+
"php": "^7.2.5 || ^8.0",
4+
"psalm/phar": "~4.1.1"
55
},
66
"config": {
77
"preferred-install": "dist"

vendor-bin/rector/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"php": "^7.2.5",
4-
"rector/rector-prefixed": "0.8.42"
4+
"rector/rector-prefixed": "0.8.48"
55
},
66
"config": {
77
"preferred-install": "dist"

0 commit comments

Comments
 (0)