diff --git a/.github/workflows/visual-regression.yml b/.github/workflows/visual-regression.yml index cd16ad22ce6..c8aa9ceaa6a 100644 --- a/.github/workflows/visual-regression.yml +++ b/.github/workflows/visual-regression.yml @@ -11,6 +11,7 @@ jobs: outputs: matched: ${{ steps.filter.outputs.matched }} is_fork: ${{ steps.fork-check.outputs.is_fork }} + can_autocommit: ${{ steps.autocommit-check.outputs.can_autocommit }} # kilocode_change steps: - uses: actions/checkout@v6 # kilocode_change # kilocode_change start @@ -40,7 +41,19 @@ jobs: else echo "is_fork=false" >> "$GITHUB_OUTPUT" fi - + # kilocode_change start + - name: Check baseline auto-commit permissions + id: autocommit-check + env: + BOT_PAT: ${{ secrets.BOT_PAT }} + run: | + if [ "${{ steps.fork-check.outputs.is_fork }}" != "true" ] && [ -n "$BOT_PAT" ]; then + echo "can_autocommit=true" >> "$GITHUB_OUTPUT" + else + echo "can_autocommit=false" >> "$GITHUB_OUTPUT" + fi + # kilocode_change end + # kilocode_change start visual-regression: needs: check-paths if: needs.check-paths.outputs.matched == 'true' @@ -50,21 +63,22 @@ jobs: steps: - name: Checkout (internal) - if: needs.check-paths.outputs.is_fork != 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' # kilocode_change uses: actions/checkout@v6 # kilocode_change with: lfs: true - token: ${{ secrets.BOT_PAT || github.token }} # kilocode_change + # LLM note: use BOT_PAT only when later baseline pushes are allowed; github.token is read-only on Dependabot PRs. + token: ${{ secrets.BOT_PAT }} # kilocode_change ref: ${{ github.head_ref }} - - name: Checkout (fork) - if: needs.check-paths.outputs.is_fork == 'true' + - name: Checkout (read-only) + if: needs.check-paths.outputs.can_autocommit != 'true' # kilocode_change uses: actions/checkout@v6 # kilocode_change with: lfs: true - name: Check if HEAD is a baseline update commit - if: needs.check-paths.outputs.is_fork != 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' # kilocode_change id: check-baseline-commit run: | COMMIT_MSG=$(git log -1 --format=%s) @@ -74,6 +88,7 @@ jobs: else echo "is_baseline_update=false" >> "$GITHUB_OUTPUT" fi + # kilocode_change end - name: Setup Bun uses: oven-sh/setup-bun@v2 @@ -143,23 +158,23 @@ jobs: } " working-directory: packages/kilo-ui - - - name: Check for baseline changes (fork PRs) - if: needs.check-paths.outputs.is_fork == 'true' + # kilocode_change start + - name: Check for baseline changes (read-only PRs) + if: needs.check-paths.outputs.can_autocommit != 'true' # kilocode_change run: | git add packages/kilo-docs/public/img/screenshot-tests/kilo-ui/ if git diff --cached --quiet; then echo "No visual regression detected." else echo "::error::Visual regression detected. Screenshot baselines have changed." - echo "::error::Since this PR is from a fork, updated screenshots cannot be committed automatically." + echo "::error::Since this PR cannot receive baseline commits automatically, updated screenshots cannot be committed." echo "::error::Please ask a Kilo developer for help updating the screenshots." git diff --cached --stat exit 1 fi - name: Fail if baselines still changing after auto-update - if: needs.check-paths.outputs.is_fork != 'true' && steps.check-baseline-commit.outputs.is_baseline_update == 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' && steps.check-baseline-commit.outputs.is_baseline_update == 'true' # kilocode_change run: | git add packages/kilo-docs/public/img/screenshot-tests/kilo-ui/ if git diff --cached --quiet; then @@ -173,10 +188,10 @@ jobs: fi - name: Commit and push new baselines (if any) - if: needs.check-paths.outputs.is_fork != 'true' && steps.check-baseline-commit.outputs.is_baseline_update != 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' && steps.check-baseline-commit.outputs.is_baseline_update != 'true' # kilocode_change id: commit-baselines env: - GH_TOKEN: ${{ secrets.BOT_PAT || github.token }} # kilocode_change + GH_TOKEN: ${{ secrets.BOT_PAT }} # kilocode_change run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" @@ -192,10 +207,11 @@ jobs: fi - name: Fail if baselines changed - if: needs.check-paths.outputs.is_fork != 'true' && steps.commit-baselines.outputs.changed == 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' && steps.commit-baselines.outputs.changed == 'true' # kilocode_change run: | echo "::error::Visual regression baselines changed. New baselines have been committed to the branch. Please pull and review." exit 1 + # kilocode_change end - name: Upload test results on failure if: failure() @@ -204,7 +220,7 @@ jobs: name: visual-regression-results path: packages/kilo-ui/test-results/ retention-days: 7 - + # kilocode_change start visual-regression-vscode: needs: check-paths if: needs.check-paths.outputs.matched == 'true' @@ -218,21 +234,22 @@ jobs: steps: - name: Checkout (internal) - if: needs.check-paths.outputs.is_fork != 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' # kilocode_change uses: actions/checkout@v6 # kilocode_change with: lfs: true - token: ${{ secrets.BOT_PAT || github.token }} # kilocode_change + # LLM note: use BOT_PAT only when later baseline pushes are allowed; github.token is read-only on Dependabot PRs. + token: ${{ secrets.BOT_PAT }} # kilocode_change ref: ${{ github.head_ref }} - - name: Checkout (fork) - if: needs.check-paths.outputs.is_fork == 'true' + - name: Checkout (read-only) + if: needs.check-paths.outputs.can_autocommit != 'true' # kilocode_change uses: actions/checkout@v6 # kilocode_change with: lfs: true - name: Check if HEAD is a baseline update commit - if: needs.check-paths.outputs.is_fork != 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' # kilocode_change id: check-baseline-commit-vscode run: | COMMIT_MSG=$(git log -1 --format=%s) @@ -242,6 +259,7 @@ jobs: else echo "is_baseline_update=false" >> "$GITHUB_OUTPUT" fi + # kilocode_change end - name: Setup Bun uses: oven-sh/setup-bun@v2 @@ -343,23 +361,23 @@ jobs: } " working-directory: packages/kilo-vscode - - - name: Check for baseline changes (fork PRs) - if: needs.check-paths.outputs.is_fork == 'true' + # kilocode_change start + - name: Check for baseline changes (read-only PRs) + if: needs.check-paths.outputs.can_autocommit != 'true' # kilocode_change run: | git add packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/ if git diff --cached --quiet; then echo "No visual regression detected." else echo "::error::Visual regression detected. Screenshot baselines have changed." - echo "::error::Since this PR is from a fork, updated screenshots cannot be committed automatically." + echo "::error::Since this PR cannot receive baseline commits automatically, updated screenshots cannot be committed." echo "::error::Please ask a Kilo developer for help updating the screenshots." git diff --cached --stat exit 1 fi - name: Fail if baselines still changing after auto-update - if: needs.check-paths.outputs.is_fork != 'true' && steps.check-baseline-commit-vscode.outputs.is_baseline_update == 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' && steps.check-baseline-commit-vscode.outputs.is_baseline_update == 'true' # kilocode_change run: | git add packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/ if git diff --cached --quiet; then @@ -373,10 +391,10 @@ jobs: fi - name: Commit and push new baselines (if any) - if: needs.check-paths.outputs.is_fork != 'true' && steps.check-baseline-commit-vscode.outputs.is_baseline_update != 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' && steps.check-baseline-commit-vscode.outputs.is_baseline_update != 'true' # kilocode_change id: commit-baselines-vscode env: - GH_TOKEN: ${{ secrets.BOT_PAT || github.token }} # kilocode_change + GH_TOKEN: ${{ secrets.BOT_PAT }} # kilocode_change run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" @@ -392,10 +410,11 @@ jobs: fi - name: Fail if baselines changed - if: needs.check-paths.outputs.is_fork != 'true' && steps.commit-baselines-vscode.outputs.changed == 'true' + if: needs.check-paths.outputs.can_autocommit == 'true' && steps.commit-baselines-vscode.outputs.changed == 'true' # kilocode_change run: | echo "::error::Visual regression baselines changed. New baselines have been committed to the branch. Please pull and review." exit 1 + # kilocode_change end - name: Upload test results on failure if: failure() diff --git a/ci-failing-test-runs-last-10-days.md b/ci-failing-test-runs-last-10-days.md index 7ab7b4c0585..b1fe70a2233 100644 --- a/ci-failing-test-runs-last-10-days.md +++ b/ci-failing-test-runs-last-10-days.md @@ -2,6 +2,8 @@ Scope: failed GitHub Actions jobs in test-oriented workflows (`test`, `test-vscode`, `Visual Regression Tests`, `smoke-test`) for `Kilo-Org/kilocode`. Forbidden string and annotation/check-only workflows are intentionally excluded. +LLM note: this generated inventory was added so reviewers can trace which CI failures were considered and which were classified as unrelated, already fixed, or fixed by this PR. + Total failed jobs listed: 679 ## Failed Jobs diff --git a/packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/testing/MockCliServer.kt b/packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/testing/MockCliServer.kt index b8be1290adf..e2a95bf754e 100644 --- a/packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/testing/MockCliServer.kt +++ b/packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/testing/MockCliServer.kt @@ -186,6 +186,7 @@ class MockCliServer : AutoCloseable { port = srv.localPort val ready = CountDownLatch(1) executor.submit { acceptLoop(srv, ready) } + // LLM note: tests connect immediately after start(), so publish accept-loop readiness instead of racing CI scheduling. check(ready.await(5, TimeUnit.SECONDS)) { "Mock CLI accept loop did not start" } return port } diff --git a/packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/prompt/MentionNavigatorTest.kt b/packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/prompt/MentionNavigatorTest.kt index 8ebf64e3354..9de781de644 100644 --- a/packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/prompt/MentionNavigatorTest.kt +++ b/packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/prompt/MentionNavigatorTest.kt @@ -52,6 +52,7 @@ class MentionNavigatorTest : BasePlatformTestCase() { val resolved = CountDownLatch(2) provider.validate(text, -1) { resolved.countDown() } assertTrue("mention validation did not complete", resolved.await(5, TimeUnit.SECONDS)) + // LLM note: the callback can fire before cross-thread mention state is observable to mouse-event assertions. waitFor { provider.mentionAt(text, 6)?.resolved == true && provider.mentionAt(text, 20)?.resolved == false