From 52ee93b3c4a9a59aa38b59072db93e931e9df089 Mon Sep 17 00:00:00 2001 From: Augusto Soto <90541338+SotoAugusto@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:46:21 -0600 Subject: [PATCH] fix(tia): use jq equality in GitHub artifact size lookup (#1930) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `GitHubRemote::artifactSize()` passes `select(.name === "…")` to `gh api --jq`. jq has no `===` operator: gh's embedded jq rejects the filter ("unexpected token"), so the lookup always fails and the baseline download never shows its size. The filter used `==` while it lived in `BaselineSync`, which the strict arch preset ignores. #1841 moved it into `GitHubRemote`, where the preset flags the `==` inside the jq string. Restore `==` and ignore `GitHubRemote` in the strict preset, as `BaselineSync` already is. --- src/Plugins/Tia/Baselines/GitHubRemote.php | 2 +- tests/Arch.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Plugins/Tia/Baselines/GitHubRemote.php b/src/Plugins/Tia/Baselines/GitHubRemote.php index 0ff48ac4..0abcea83 100644 --- a/src/Plugins/Tia/Baselines/GitHubRemote.php +++ b/src/Plugins/Tia/Baselines/GitHubRemote.php @@ -83,7 +83,7 @@ final readonly class GitHubRemote extends BaseRemote 'gh', 'api', sprintf('repos/%s/actions/runs/%s/artifacts', $repo, $runId), '--jq', sprintf( - '.artifacts[] | select(.name === "%s") | .size_in_bytes', + '.artifacts[] | select(.name == "%s") | .size_in_bytes', self::ARTIFACT_NAME, ), ]); diff --git a/tests/Arch.php b/tests/Arch.php index 44d49004..8798eaf7 100644 --- a/tests/Arch.php +++ b/tests/Arch.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Pest\Expectation; +use Pest\Plugins\Tia\Baselines\GitHubRemote; use Pest\Plugins\Tia\BaselineSync; arch()->preset()->php()->ignoring([ @@ -17,6 +18,7 @@ arch()->preset()->php()->ignoring([ arch()->preset()->strict()->ignoring([ BaselineSync::class, + GitHubRemote::class, 'usleep', ]);