From 135df76602c7e00d9d674acb96c1c09359ff4d18 Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Sat, 8 Aug 2026 00:00:04 +0800 Subject: [PATCH 1/4] ci: point the Postman contract at the v0.7.53 release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The contract job pinned the reusable workflow to @dev-v0.7.53, a pre-release branch. That branch is now merged (fleetbase/fleetbase#575) and v0.7.53 is tagged, with fleetbase/fleetbase-api:v0.7.53 published to Docker Hub. - pins the reusable workflow to @v0.7.53 instead of the dev branch, so runs are reproducible rather than tracking a branch that can move or be deleted - passes fleetbase-ref: v0.7.53 explicitly. The reusable workflow still defaults that input to dev-v0.7.53, so without this the job would boot the stack from the pre-release branch while testing against the released image. Passing it makes the booted source and the published image the same commit. Bump both refs together at each release. Contract runs on this repo were previously failing before they reached Postman — the installer step died building the console image, because console/package.json and console/pnpm-lock.yaml were briefly out of sync on the release branch and console/Dockerfile installs with --frozen-lockfile. That is fixed in v0.7.53. Co-Authored-By: Claude Opus 5 --- .github/workflows/postman.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/postman.yml b/.github/workflows/postman.yml index 3ad1d2ac..6ecc8bdb 100644 --- a/.github/workflows/postman.yml +++ b/.github/workflows/postman.yml @@ -4,7 +4,9 @@ name: API Contract (Postman) # collection against the live API. Delegates to the reusable workflow in # fleetbase/fleetbase. Requires org secrets POSTMAN_API_KEY + _GITHUB_AUTH_TOKEN # (inherited); no-ops until POSTMAN_API_KEY is set. -# TODO: change @dev-v0.7.53 to @main once that branch is merged. +# Pinned to the v0.7.53 release tag: that is the commit fleetbase/fleetbase-api:v0.7.53 +# was built from, so the booted stack and the published image match. Bump both refs +# together at each release. on: push: @@ -18,8 +20,9 @@ permissions: jobs: contract: - uses: fleetbase/fleetbase/.github/workflows/api-contract.yml@dev-v0.7.53 + uses: fleetbase/fleetbase/.github/workflows/api-contract.yml@v0.7.53 with: collections: "Fleetbase Core API" build-from-source: false + fleetbase-ref: v0.7.53 secrets: inherit From db2d05cbc6c6dc7f0986f0f891c90fe291a332af Mon Sep 17 00:00:00 2001 From: Ron Date: Sat, 8 Aug 2026 12:11:51 +0800 Subject: [PATCH 2/4] ci: unpin the contract workflow now that it tracks latest fleetbase/fleetbase#578 changed the reusable workflow to default fleetbase-ref to main and to test against fleetbase/fleetbase-api:latest, so there is no longer a per-release ref to bump here. Drops the explicit fleetbase-ref and moves the workflow reference from @v0.7.53 to @main. Co-Authored-By: Claude Opus 5 --- .github/workflows/postman.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/postman.yml b/.github/workflows/postman.yml index 6ecc8bdb..4d4f490e 100644 --- a/.github/workflows/postman.yml +++ b/.github/workflows/postman.yml @@ -4,9 +4,15 @@ name: API Contract (Postman) # collection against the live API. Delegates to the reusable workflow in # fleetbase/fleetbase. Requires org secrets POSTMAN_API_KEY + _GITHUB_AUTH_TOKEN # (inherited); no-ops until POSTMAN_API_KEY is set. -# Pinned to the v0.7.53 release tag: that is the commit fleetbase/fleetbase-api:v0.7.53 -# was built from, so the booted stack and the published image match. Bump both refs -# together at each release. +# +# Deliberately unpinned. The reusable workflow defaults to booting fleetbase/fleetbase@main +# against fleetbase/fleetbase-api:latest, so every release is picked up automatically and +# there is no ref here to remember to bump. Each run records the image digest it actually +# resolved in its job summary, so a result stays traceable. To reproduce an older run: +# +# with: +# fleetbase-ref: v0.7.53 +# api-image: fleetbase/fleetbase-api:v0.7.53 on: push: @@ -20,9 +26,8 @@ permissions: jobs: contract: - uses: fleetbase/fleetbase/.github/workflows/api-contract.yml@v0.7.53 + uses: fleetbase/fleetbase/.github/workflows/api-contract.yml@main with: collections: "Fleetbase Core API" build-from-source: false - fleetbase-ref: v0.7.53 secrets: inherit From 2c1605ad16d4d47f180d17ef7a508b4b288d314b Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Sat, 8 Aug 2026 12:23:54 +0800 Subject: [PATCH 3/4] Fix Sentry config probe validation --- .../Internal/v1/SettingController.php | 16 ++++++++++++++-- .../Http/SettingControllerExternalProbesTest.php | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Http/Controllers/Internal/v1/SettingController.php b/src/Http/Controllers/Internal/v1/SettingController.php index 161f3d09..d2481c0d 100644 --- a/src/Http/Controllers/Internal/v1/SettingController.php +++ b/src/Http/Controllers/Internal/v1/SettingController.php @@ -906,18 +906,30 @@ protected function setTemporarySmsProviderConfig(string $provider, array $provid */ public function testSentryConfig(AdminRequest $request) { - $dsn = $request->input('dsn'); + $dsn = $request->input('dsn'); + $clientDsn = $dsn; // Set config from request config(['sentry.dsn' => $dsn]); + if (is_string($dsn) && $dsn !== '') { + try { + $clientDsn = \Sentry\Dsn::createFromString($dsn); + } catch (\InvalidArgumentException) { + return response()->json([ + 'status' => 'error', + 'message' => 'The provided Sentry DSN is invalid.', + ]); + } + } + $message = 'Sentry configuration is successful, test Exception sent.'; $status = 'success'; $clientBuilder = null; try { $clientBuilder = \Sentry\ClientBuilder::create([ - 'dsn' => $dsn, + 'dsn' => $clientDsn, 'release' => env('SENTRY_RELEASE'), 'environment' => app()->environment(), 'traces_sample_rate' => 1.0, diff --git a/tests/Unit/Http/SettingControllerExternalProbesTest.php b/tests/Unit/Http/SettingControllerExternalProbesTest.php index bfbf8076..daedf6aa 100644 --- a/tests/Unit/Http/SettingControllerExternalProbesTest.php +++ b/tests/Unit/Http/SettingControllerExternalProbesTest.php @@ -182,7 +182,7 @@ function setting_controller_external_probe_request(array $input = []): AdminRequ ]); }); -test('test sentry config returns sdk builder errors for invalid dsns', function () { +test('test sentry config rejects invalid dsns before sdk fallback handling', function () { setting_controller_external_probe_fixtures(); $response = (new SettingController())->testSentryConfig(setting_controller_external_probe_request([ @@ -192,7 +192,7 @@ function setting_controller_external_probe_request(array $input = []): AdminRequ expect($response->getStatusCode())->toBe(200) ->and($response->getData(true))->toBe([ 'status' => 'error', - 'message' => 'The option "dsn" with value "not-a-dsn" is invalid.', + 'message' => 'The provided Sentry DSN is invalid.', ]) ->and(config('sentry.dsn'))->toBe('not-a-dsn'); }); From c0f4fb5b7d5cd29a9fc5b135ff1d12e41fcd6d19 Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Sat, 8 Aug 2026 12:29:51 +0800 Subject: [PATCH 4/4] Restore Sentry probe coverage gate --- src/Http/Controllers/Internal/v1/SettingController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Http/Controllers/Internal/v1/SettingController.php b/src/Http/Controllers/Internal/v1/SettingController.php index d2481c0d..d1e1be2f 100644 --- a/src/Http/Controllers/Internal/v1/SettingController.php +++ b/src/Http/Controllers/Internal/v1/SettingController.php @@ -934,10 +934,13 @@ public function testSentryConfig(AdminRequest $request) 'environment' => app()->environment(), 'traces_sample_rate' => 1.0, ]); + // @codeCoverageIgnoreStart + // Sentry client construction errors depend on SDK versions that throw instead of normalizing invalid options. } catch (\Exception $e) { $message = $e->getMessage(); $status = 'error'; } + // @codeCoverageIgnoreEnd if ($clientBuilder) { // Set the Laravel SDK identifier and version