From 824a5559740a71cbc6ab86cbc7f9e2154fb96cf8 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Mon, 19 Jan 2026 14:15:18 -0500 Subject: [PATCH] fix(ci): Use git stash to preserve artifacts before checking out main Fixed perf-aggregate-report job failure caused by artifact files conflicting with git checkout. The issue: - Job downloads artifacts from perf-report (reports/4.2.5/*) - Tries to checkout main with 'git checkout -B main origin/main' - Fails because artifact files would be overwritten The solution: 1. Stash all artifact files and generated content 2. Checkout main branch cleanly 3. Pull latest changes from origin/main 4. Pop stash to restore artifacts 5. Add and commit aggregated report This preserves the artifact files while properly syncing with remote main. --- .gitlab-ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 464f556..e677fbc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -334,8 +334,14 @@ perf-aggregate-report: - git config user.email "ci@unturf.com" - git config user.name "GitLab CI" - git fetch origin main - - git checkout -B main origin/main - - echo "Step 6 - Committing aggregated report..." + - echo "Step 6 - Stashing artifact files temporarily..." + - git add -A + - git stash push -m "Temporary stash of artifacts and generated files" + - echo "Step 7 - Checking out main branch..." + - git checkout main + - git pull origin main || echo "Already up to date" + - echo "Step 8 - Restoring artifacts and committing..." + - git stash pop || echo "No stash to pop" - git add reports/ AGGREGATED-PERFORMANCE.md - | if git diff --cached --quiet; then @@ -344,6 +350,7 @@ perf-aggregate-report: git commit -m "perf: Update aggregated performance analysis [ci skip]" fi - git push origin main || echo "Nothing to push" + - echo "Step 9 - Verifying results..." - echo "✓ Aggregated report generated with charts" - ls -lh AGGREGATED-PERFORMANCE.md - ls -lh reports/aggregated-*.png 2>/dev/null || echo " (charts may not have generated)"