Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6177aad
phpstan fixes
joetannenbaum Mar 11, 2026
ac09285
phpstan fixes
joetannenbaum Mar 11, 2026
d88a4c0
Update JsonApiPaginator.php
joetannenbaum Mar 11, 2026
07d8c3b
Update MetaResource.php
joetannenbaum Mar 11, 2026
4418ed7
Update Auth.php
joetannenbaum Mar 11, 2026
e507734
Update AuthToken.php
joetannenbaum Mar 11, 2026
dda0aa6
Update InstanceUpdate.php
joetannenbaum Mar 11, 2026
ce010a0
Update RepoConfig.php
joetannenbaum Mar 11, 2026
83a083a
Update Ship.php
joetannenbaum Mar 11, 2026
41e9b22
Update DynamicSpinner.php
joetannenbaum Mar 11, 2026
e1de116
Update EnvironmentLogsPrompt.php
joetannenbaum Mar 11, 2026
d5ff503
Update EnvironmentLogsPromptRenderer.php
joetannenbaum Mar 11, 2026
c3e86cb
Update SelectWithContextPrompt.php
joetannenbaum Mar 11, 2026
f9871ff
Update ContextDetector.php
joetannenbaum Mar 11, 2026
97df49f
Update KeyPressListener.php
joetannenbaum Mar 11, 2026
8a9c4d4
Update DataTableRenderer.php
joetannenbaum Mar 11, 2026
d6a9532
deleted unused traits
joetannenbaum Mar 11, 2026
9a01add
Update Validates.php
joetannenbaum Mar 11, 2026
7acd47f
Update CommandMiddlewareManager.php
joetannenbaum Mar 11, 2026
7ea3441
Update ApplicationCreate.php
joetannenbaum Mar 11, 2026
b0c2ebe
Update BackgroundProcessCreate.php
joetannenbaum Mar 11, 2026
90109cd
Update CacheCreate.php
joetannenbaum Mar 11, 2026
7533072
Update Ship.php
joetannenbaum Mar 11, 2026
fee447f
Delete Hyb.php
joetannenbaum Mar 11, 2026
2cb8760
remove redundant array_values
joetannenbaum Mar 11, 2026
b4f32e9
Update BaseCommand.php
joetannenbaum Mar 11, 2026
051d5eb
Update InstanceResolver.php
joetannenbaum Mar 11, 2026
676b902
Update ci.yml
joetannenbaum Mar 11, 2026
0ca7fb5
Update ci.yml
joetannenbaum Mar 11, 2026
434116c
Update ci.yml
joetannenbaum Mar 11, 2026
d45415b
wip
joetannenbaum Mar 11, 2026
bff7f52
wip
joetannenbaum Mar 11, 2026
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
10 changes: 10 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: fix code styling

on: [push]

permissions:
contents: write

jobs:
lint:
uses: laravel/.github/.github/workflows/coding-standards.yml@main
12 changes: 12 additions & 0 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: issues

on:
issues:
types: [labeled]

permissions:
issues: write

jobs:
help-wanted:
uses: laravel/.github/.github/workflows/issues.yml@main
12 changes: 12 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: pull requests

on:
pull_request_target:
types: [opened]

permissions:
pull-requests: write

jobs:
uneditable:
uses: laravel/.github/.github/workflows/pull-requests.yml@main
14 changes: 14 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: static analysis

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
tests:
uses: laravel/.github/.github/workflows/static-analysis.yml@main
37 changes: 37 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: tests

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
tests:
runs-on: ubuntu-latest

name: Tests

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer:v2
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
command: composer install --prefer-dist --no-interaction --no-progress

- name: Run tests
run: vendor/bin/pest
13 changes: 13 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: update changelog

on:
release:
types: [released]

permissions: {}

jobs:
update:
permissions:
contents: write
uses: laravel/.github/.github/workflows/update-changelog.yml@main
4 changes: 2 additions & 2 deletions app/Client/JsonApiPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function isLastPage(Response $response): bool
{
$links = $response->json('links', []);

return ! isset($links['next']) || is_null($links['next']);
return ! isset($links['next']);
}

protected function getPageItems(Response $response, Request $request): array
Expand All @@ -49,7 +49,7 @@ protected function applyPagination(Request $request): Request
if ($this->currentResponse instanceof Response) {
$links = $this->currentResponse->json('links', []);

if (isset($links['next']) && ! is_null($links['next'])) {
if (isset($links['next'])) {
$nextUrl = parse_url($links['next']);
parse_str($nextUrl['query'] ?? '', $queryParams);

Expand Down
2 changes: 1 addition & 1 deletion app/Client/Requests/UpdateDatabaseClusterRequestData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class UpdateDatabaseClusterRequestData extends RequestData
{
/**
* @param array<string, mixed>|null $config
* @param array<string, mixed> $config
*/
public function __construct(
public readonly string $clusterId,
Expand Down
2 changes: 1 addition & 1 deletion app/Client/Resources/MetaResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public function ipAddresses(): array
{
$response = $this->send(new ListIpAddressesRequest);

return $response->json() ?? [];
return $response->json();
}
}
2 changes: 1 addition & 1 deletion app/Commands/ApplicationCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function createApplication()
label: 'Region',
options: collect($regions)->mapWithKeys(fn (Region $region) => [
$region->value => $region->label,
]),
])->toArray(),
default: $value ?? $this->getDefaultRegion(),
required: true,
),
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/ApplicationUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected function defineFields(Application $application): void
$this->form()->define(
'slack_channel',
fn ($resolver) => $resolver->fromInput(
fn ($value) => $this->getNewSlackChannel($value ?? $application->slackChannel),
fn ($value) => $value ?? $application->slackChannel,
),
)->setPreviousValue($application->slackChannel);
}
Expand Down
10 changes: 6 additions & 4 deletions app/Commands/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function handle()
'Creating auth session...',
);
} catch (SaloonRequestException $e) {
if ($e->getResponse()?->status() === 422) {
if ($e->getResponse()->status() === 422) {
$errors = $e->getResponse()->json('errors', []);

foreach ($errors as $field => $messages) {
Expand Down Expand Up @@ -90,7 +90,7 @@ public function handle()
'Exchanging code for tokens...',
);
} catch (SaloonRequestException $e) {
if ($e->getResponse()?->status() === 422) {
if ($e->getResponse()->status() === 422) {
$message = $e->getResponse()->json('message', 'Invalid exchange code.');

error($message);
Expand Down Expand Up @@ -141,14 +141,16 @@ protected function findAvailablePort(int $startPort = 49513, int $maxAttempts =

protected function startServer(): void
{
$this->serverSocket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);

if ($this->serverSocket === false) {
if ($socket === false) {
error('Failed to create server socket.');

return;
}

$this->serverSocket = $socket;

socket_set_option($this->serverSocket, SOL_SOCKET, SO_REUSEADDR, 1);

if (! socket_bind($this->serverSocket, '127.0.0.1', $this->port)) {
Expand Down
1 change: 1 addition & 0 deletions app/Commands/AuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function handle()
'add' => $this->addToken($tokens),
'remove' => $this->removeToken($tokens),
'list' => $this->listTokens($tokens),
default => null,
};
}

Expand Down
2 changes: 1 addition & 1 deletion app/Commands/BackgroundProcessCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ protected function addWorkerParams(): void
fn ($resolver) => $resolver
->fromInput(fn (?string $value) => confirm(
label: 'Run in maintenance mode?',
default: $value ?? $this->getWorkerDefult('force'),
default: (bool) ($value ?? $this->getWorkerDefult('force')),
hint: 'Force the worker to run even in maintenance mode',
))
->nonInteractively(fn () => $this->getWorkerDefult('force'))
Expand Down
1 change: 1 addition & 0 deletions app/Commands/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ protected function outputJsonIfWanted(mixed $data): void
protected function resolve(string $argument): ValueResolver
{
return new ValueResolver(
$argument,
$argument,
$this->isInteractive(),
match (true) {
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/CacheCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected function createCache()
->filter(fn (Region $region) => in_array($region->value, $type->regions))
->mapWithKeys(fn (Region $region) => [
$region->value => $region->label,
]),
])->toArray(),
default: $value ?? $this->getDefaultRegion(),
required: true,
))
Expand Down
16 changes: 14 additions & 2 deletions app/Commands/DatabaseRestoreCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class DatabaseRestoreCreate extends BaseCommand
{
protected $signature = 'database-restore:create
{cluster? : The database cluster ID or name}
{name? : The name of the restore}
{--snapshot= : Snapshot ID to restore from}
{--point-in-time= : Point-in-time (ISO 8601) to restore to}
{--json : Output as JSON}';
Expand All @@ -31,6 +32,16 @@ public function handle()
$snapshotId = $this->option('snapshot');
$pointInTime = $this->option('point-in-time');

$this->form()->prompt(
'name',
fn ($resolver) => $resolver->fromInput(
fn (?string $value) => text(
label: 'Name',
default: $value ?? '',
),
),
);

if (! $snapshotId && ! $pointInTime && $this->isInteractive()) {
$snapshots = spin(
fn () => $this->client->databaseSnapshots()->list($cluster->id)->collect(),
Expand Down Expand Up @@ -77,9 +88,10 @@ public function handle()
$restored = spin(
fn () => $this->client->databaseRestores()->create(
new CreateDatabaseRestoreRequestData(
name: $this->form()->get('name'),
clusterId: $cluster->id,
snapshotId: $snapshotId,
pointInTime: $pointInTime,
databaseSnapshotId: $snapshotId,
restoreTime: $pointInTime,
),
),
'Creating restore...',
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/InstanceDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function handle()

intro('Deleting Instance');

$instance = $this->resolvers()->instance()->resolve($this->argument('instance'));
$instance = $this->resolvers()->instance()->from($this->argument('instance'));

if (! $this->option('force')) {
if (! confirm("Delete instance '{$instance->name}'?")) {
Expand Down
4 changes: 2 additions & 2 deletions app/Commands/InstanceUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ protected function defineFields(EnvironmentInstance $instance): void
fn ($resolver) => $resolver->fromInput(
fn ($value) => confirm(
label: 'Use sleep mode?',
default: $value ?? $instance->environment?->usesHibernation ?? true,
default: $value ?? $instance->environment->usesHibernation ?? true,
),
),
'hibernation',
)->setPreviousValue($instance->environment?->usesHibernation)->setLabel('Hibernation');
)->setPreviousValue($instance->environment->usesHibernation)->setLabel('Hibernation');

$this->form()->define(
'sleep_timeout',
Expand Down
6 changes: 0 additions & 6 deletions app/Commands/RepoConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ public function handle(Git $git, LocalConfig $localConfig)

$organization = $this->resolveOrganization();

if (! $organization) {
error('No organization selected');

return self::FAILURE;
}

$application = $this->selectApplication($localConfig->get('application_id'));

if ($application === null) {
Expand Down
12 changes: 6 additions & 6 deletions app/Commands/Ship.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected function createApplication(string $defaultRegion, string $repository):
fn (Region $region) => [
$region->value => $region->label,
],
),
)->toArray(),
default: $value ?? $defaultRegion,
);
}),
Expand Down Expand Up @@ -645,7 +645,7 @@ protected function getWebsocketCluster(): ?WebsocketCluster
$cluster = select(
label: 'Websocket cluster',
options: $options->toArray(),
default: $clusters->first()?->id ?? null,
default: $clusters->first()->id ?? null,
required: true,
);

Expand Down Expand Up @@ -673,8 +673,8 @@ protected function getDatabase(DatabaseCluster $database): ?Database

$schema = select(
label: 'Database',
options: $options,
default: $database->schemas[0]?->id ?? null,
options: $options->toArray(),
default: $database->schemas[0]->id ?? null,
required: true,
);

Expand Down Expand Up @@ -712,7 +712,7 @@ protected function getDatabaseCluster(): ?DatabaseCluster
$database = select(
label: 'Database cluster',
options: $options->toArray(),
default: $databases->first()?->id ?? null,
default: $databases->first()->id ?? null,
required: true,
);

Expand Down Expand Up @@ -759,7 +759,7 @@ protected function pushCustomEnvironmentVariables(Application $application): voi

$varsToAdd = multiselect(
label: 'Add local environment variables to Cloud environment?',
options: $varOptions,
options: $varOptions->toArray(),
);

if (count($varsToAdd) === 0) {
Expand Down
2 changes: 1 addition & 1 deletion app/Concerns/HandlesAvatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function normalizeSvg(string $content): string
}

/**
* @return list<string, string>
* @return list<string>
*/
protected function getAvatarFromPath(string $path): array
{
Expand Down
Loading
Loading