Skip to content

Commit 13e1ec1

Browse files
simonhampclaude
andcommitted
Add full_build flag to satis API request for buildAll
When buildAll() is called (no explicit plugin names), the API request now includes full_build: true so the satis server knows to perform a complete rebuild rather than a partial one. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 97ca788 commit 13e1ec1

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

app/Services/SatisService.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function buildAll(?string $githubToken = null): array
2626
{
2727
$plugins = $this->getApprovedPlugins();
2828

29-
return $this->triggerBuild($plugins, $githubToken);
29+
return $this->triggerBuild($plugins, $githubToken, fullBuild: true);
3030
}
3131

3232
/**
@@ -122,7 +122,7 @@ protected function getApprovedPlugins(): array
122122
/**
123123
* @param array<int, array{name: string, repository_url: string, type: string, is_official?: bool}> $plugins
124124
*/
125-
protected function triggerBuild(array $plugins, ?string $githubToken = null): array
125+
protected function triggerBuild(array $plugins, ?string $githubToken = null, bool $fullBuild = false): array
126126
{
127127
if (! $this->apiUrl || ! $this->apiKey) {
128128
return [
@@ -141,7 +141,10 @@ protected function triggerBuild(array $plugins, ?string $githubToken = null): ar
141141
$githubToken ??= config('services.github.token');
142142

143143
try {
144-
$payload = ['plugins' => $plugins];
144+
$payload = [
145+
'plugins' => $plugins,
146+
'full_build' => $fullBuild,
147+
];
145148

146149
if ($githubToken) {
147150
$payload['github_token'] = $githubToken;

tests/Feature/SatisSync/SatisSyncTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,12 @@ public function test_build_all_only_includes_paid_plugins(): void
142142
$this->assertEquals(1, $result['plugins_count']);
143143

144144
Http::assertSent(function ($request) use ($paidPlugin) {
145-
$plugins = $request->data()['plugins'] ?? [];
145+
$data = $request->data();
146+
$plugins = $data['plugins'] ?? [];
146147

147-
return count($plugins) === 1 && $plugins[0]['name'] === $paidPlugin->name;
148+
return count($plugins) === 1
149+
&& $plugins[0]['name'] === $paidPlugin->name
150+
&& $data['full_build'] === true;
148151
});
149152
}
150153
}

0 commit comments

Comments
 (0)