Skip to content

Commit 0fc0ac3

Browse files
committed
Merge remote-tracking branch 'upstream/main' into settledresult-throw-bc-fix
2 parents 03884cd + 91a7001 commit 0fc0ac3

18 files changed

+136
-191
lines changed

.github/workflows/tests.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ on:
44
push:
55
branches:
66
- main
7-
87
pull_request:
9-
types: [ opened, synchronize, reopened ]
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
1012

1113
jobs:
1214
test:
1315
runs-on: ubuntu-latest
16+
1417
strategy:
1518
fail-fast: false
1619
matrix:
17-
php: ['8.1', '8.2', '8.3' ]
18-
laravel: [ '8.*', '9.*', '10.*', '11.*' ]
19-
guzzle: [ '6.*', '7.*' ]
20-
dependency-version: [ prefer-lowest, prefer-stable ]
20+
php: ['8.1', '8.2', '8.3']
21+
laravel: ['8.*', '9.*', '10.*', '11.*', '12.*']
22+
guzzle: ['6.*', '7.*']
23+
dependency-version: [prefer-lowest, prefer-stable]
2124
include:
2225
- laravel: 8.*
2326
testbench: 6.*
@@ -27,8 +30,10 @@ jobs:
2730
testbench: 8.*
2831
- laravel: 11.*
2932
testbench: 9.*
30-
33+
- laravel: 12.*
34+
testbench: 10.*
3135
exclude:
36+
# Laravel 8 exclusions
3237
- laravel: 8.*
3338
php: 8.1
3439
dependency-version: prefer-lowest
@@ -39,23 +44,31 @@ jobs:
3944
php: 8.3
4045
dependency-version: prefer-lowest
4146

47+
# Laravel 9 exclusions
4248
- laravel: 9.*
4349
php: 8.2
4450
dependency-version: prefer-lowest
4551
- laravel: 9.*
4652
php: 8.3
4753
dependency-version: prefer-lowest
4854

55+
# Laravel 11 exclusions
4956
- laravel: 11.*
5057
php: 8.1
5158

52-
# Guzzle restrictions
59+
# Laravel 12 exclusions
60+
- laravel: 12.*
61+
php: 8.1
62+
63+
# Guzzle exclusions
5364
- laravel: 9.*
5465
guzzle: 6.*
5566
- laravel: 10.*
5667
guzzle: 6.*
5768
- laravel: 11.*
5869
guzzle: 6.*
70+
- laravel: 12.*
71+
guzzle: 6.*
5972

6073
name: P${{ matrix.php }} / L${{ matrix.laravel }} / G${{ matrix.guzzle }} / ${{ matrix.dependency-version }}
6174

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,15 @@ You can write functions in any of the following runtimes and execute them straig
2222

2323
- Node.js 20
2424
- Node.js 18
25-
- Node.js 16
2625
- Python 3.12
2726
- Python 3.11
2827
- Python 3.10
2928
- Python 3.9
30-
- Python 3.8
3129
- Java 21
3230
- Java 17
3331
- Java 11
3432
- Java 8
3533
- .NET 8
36-
- .NET 7
3734
- .NET 6
3835
- Ruby 3.3
3936
- Ruby 3.2
@@ -42,7 +39,7 @@ You can write functions in any of the following runtimes and execute them straig
4239

4340
Any runtime that [Lambda supports](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html), you can use!
4441

45-
Sidecar is maintained by [Aaron Francis](https://twitter.com/aarondfrancis), go follow me on Twitter!
42+
Sidecar is maintained by [Aaron Francis](https://twitter.com/aarondfrancis), go follow me on Twitter!
4643

4744
### What It Looks Like
4845

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
],
1212
"require": {
1313
"php": "^8.1",
14-
"illuminate/filesystem": "^8|^9|^10|^11",
15-
"illuminate/console": "^8|^9|^10|^11",
16-
"illuminate/support": "^8|^9|^10|^11",
14+
"illuminate/filesystem": "^8|^9|^10|^11|^12.0",
15+
"illuminate/console": "^8|^9|^10|^11|^12.0",
16+
"illuminate/support": "^8|^9|^10|^11|^12.0",
1717
"maennchen/zipstream-php": "^3.1",
1818
"guzzlehttp/guzzle": "^6.5.8|^7.2",
1919
"aws/aws-sdk-php": "^3.216.1"
2020
},
2121
"require-dev": {
22-
"orchestra/testbench": "^5|^6|^7|^8|^9",
22+
"orchestra/testbench": "^5|^6|^7|^8|^9|^10.0",
2323
"mockery/mockery": "^1.3.3",
2424
"phpunit/phpunit": ">=8.5.23|^9|^10"
2525
},

docs/functions/customization.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ Lambda supports multiple languages through the use of runtimes. You can choose a
99

1010
- Node.js 20: `nodejs20.x`
1111
- Node.js 18: `nodejs18.x`
12-
- Node.js 16: `nodejs16.x`
1312
- Python 3.12: `python3.12`
1413
- Python 3.11: `python3.11`
1514
- Python 3.10: `python3.10`
1615
- Python 3.9: `python3.9`
17-
- Python 3.8: `python3.8`
1816
- Java 21: `java21`
1917
- Java 17: `java17`
2018
- Java 11: `java11`
2119
- Java 8: `java8.al2`
2220
- .NET 8: `dotnet8`
23-
- .NET 7: `dotnet7`
2421
- .NET 6: `dotnet6`
2522
- Ruby 3.3: `ruby3.3`
2623
- Ruby 3.2: `ruby3.2`
@@ -231,6 +228,26 @@ You likely won't need to change this, but if you do, *you must include the envir
231228
}
232229
```
233230

231+
### Description
232+
233+
By default, Sidecar will generate a description for your Lambda function based on the deployment environment and the name of your app.
234+
235+
You likely won't need to customise it, however, you can if you want, although it has no direct impact.
236+
237+
```php
238+
class ExampleFunction extends LambdaFunction
239+
{
240+
public function description()
241+
{
242+
return sprintf('%s [%s]: Sidecar function `%s`.', ...[
243+
config('sidecar.app_name'),
244+
Sidecar::getEnvironment(),
245+
static::class,
246+
]);
247+
}
248+
}
249+
```
250+
234251
## Tags
235252

236253
A key-value array of strings of tags to be applied to your function, this can be used to organize your functions by owner, project or departement.

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</testsuite>
1111
</testsuites>
1212
<php>
13-
13+
<server name="APP_ENV" value="testing"/>
1414
</php>
1515
<source>
1616
<include>

src/LambdaFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function description()
161161
{
162162
return sprintf('%s [%s]: Sidecar function `%s`.', ...[
163163
config('sidecar.app_name'),
164-
config('app.env'),
164+
Sidecar::getEnvironment(),
165165
static::class,
166166
]);
167167
}

src/Runtime.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ abstract class Runtime
88

99
public const NODEJS_18 = 'nodejs18.x';
1010

11+
/** @deprecated */
1112
public const NODEJS_16 = 'nodejs16.x';
1213

1314
/** @deprecated */
@@ -21,6 +22,7 @@ abstract class Runtime
2122

2223
public const PYTHON_39 = 'python3.9';
2324

25+
/** @deprecated */
2426
public const PYTHON_38 = 'python3.8';
2527

2628
/** @deprecated */
@@ -39,6 +41,7 @@ abstract class Runtime
3941

4042
public const DOT_NET_8 = 'dotnet8';
4143

44+
/** @deprecated */
4245
public const DOT_NET_7 = 'dotnet7';
4346

4447
public const DOT_NET_6 = 'dotnet6';

tests/Unit/Commands/ActivateTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public function assertEvents($deployed = true, $activated = true)
6767
}
6868
}
6969

70-
/** @test */
71-
public function it_should_activate_functions()
70+
public function test_it_should_activate_functions()
7271
{
7372
$this->mockActivating();
7473

@@ -88,8 +87,7 @@ protected function mockInvokeAsync($with = [], $return = null)
8887
return $this->mockMethod('invokeAsync', $with, $return);
8988
}
9089

91-
/** @test */
92-
public function it_should_pre_warm_functions_if_the_latest_version_is_different()
90+
public function test_it_should_pre_warm_functions_if_the_latest_version_is_different()
9391
{
9492
// The latest version is not the active version.
9593
$this->lambda->shouldReceive('latestVersionHasAlias')
@@ -128,8 +126,7 @@ public function it_should_pre_warm_functions_if_the_latest_version_is_different(
128126
$this->artisan('sidecar:activate --pre-warm');
129127
}
130128

131-
/** @test */
132-
public function it_should_not_pre_warm_functions_if_the_latest_version_is_the_same()
129+
public function test_it_should_not_pre_warm_functions_if_the_latest_version_is_the_same()
133130
{
134131
$this->lambda->shouldReceive('latestVersionHasAlias')
135132
->andReturn(true);
@@ -152,8 +149,7 @@ public function it_should_not_pre_warm_functions_if_the_latest_version_is_the_sa
152149
$this->artisan('sidecar:activate --pre-warm');
153150
}
154151

155-
/** @test */
156-
public function it_should_activate_functions_with_env()
152+
public function test_it_should_activate_functions_with_env()
157153
{
158154
$this->mockActivating();
159155

tests/Unit/Commands/ConfigureTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ protected function createRolePayload()
157157
];
158158
}
159159

160-
/** @test */
161-
public function basic_happy_path()
160+
public function test_basic_happy_path()
162161
{
163162
$this->mockS3(function ($mock) {
164163
$this->mockHeadBucketNotFound($mock);

tests/Unit/Commands/DeployTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
class DeployTest extends DeploymentTest
1313
{
14-
/** @test */
15-
public function it_deploys_the_functions_in_the_config()
14+
public function test_it_deploys_the_functions_in_the_config()
1615
{
1716
$this->lambda->shouldReceive('functionExists')->andReturn(false);
1817
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -27,8 +26,7 @@ public function it_deploys_the_functions_in_the_config()
2726
$this->assertEvents($deployed = true, $activated = false);
2827
}
2928

30-
/** @test */
31-
public function it_deploys_and_activates_the_functions_in_the_config()
29+
public function test_it_deploys_and_activates_the_functions_in_the_config()
3230
{
3331
$this->lambda->shouldReceive('functionExists')->andReturn(false);
3432
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -46,8 +44,7 @@ public function it_deploys_and_activates_the_functions_in_the_config()
4644
$this->assertEvents($deployed = true, $activated = true);
4745
}
4846

49-
/** @test */
50-
public function it_uses_a_fake_environment()
47+
public function test_it_uses_a_fake_environment()
5148
{
5249
$this->lambda->shouldReceive('functionExists')->andReturn(false);
5350
$this->lambda->shouldReceive('getVersions')->andReturn([]);

0 commit comments

Comments
 (0)