From 3814e01824df9b425988a068c486ba15b0557ee6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 08:37:59 +0000 Subject: [PATCH 1/8] Initial plan From dc3ffea1324e1fbd9a64cd26a8d30ed2aa340cb5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 08:49:30 +0000 Subject: [PATCH 2/8] Fix Claude code review workflows to checkout PR head commit Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com> --- .github/workflows/claude-code-review.yml | 22 +++++++++++++++++++--- .github/workflows/claude.yml | 22 +++++++++++++++++++--- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 94900b23e5..e79cf152a1 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -9,8 +9,8 @@ jobs: claude-review: if: | github.event_name == 'workflow_dispatch' || - (github.event_name == 'issue_comment' && - github.event.issue.pull_request && + (github.event_name == 'issue_comment' && + github.event.issue.pull_request && contains(github.event.comment.body, '/claude_review')) runs-on: ubuntu-latest @@ -21,10 +21,26 @@ jobs: id-token: write steps: + - name: Get PR details + id: pr-details + if: github.event_name == 'issue_comment' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_NUMBER="${{ github.event.issue.number }}" + PR_DATA=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER}") + PR_HEAD_SHA=$(echo "$PR_DATA" | jq -r '.head.sha') + echo "pr_head_sha=$PR_HEAD_SHA" >> $GITHUB_OUTPUT + echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT + - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 1 + # For workflow_dispatch, checkout default branch + # For issue_comment on PR, checkout the PR head commit + ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_head_sha || github.ref }} + fetch-depth: 0 - name: Run Claude Code Review id: claude-review diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 6e549ec365..2fc3465f3d 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -9,8 +9,8 @@ jobs: claude: if: | github.event_name == 'workflow_dispatch' || - (github.event_name == 'issue_comment' && - github.event.issue.pull_request && + (github.event_name == 'issue_comment' && + github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) runs-on: ubuntu-latest permissions: @@ -20,10 +20,26 @@ jobs: id-token: write actions: read # Required for Claude to read CI results on PRs steps: + - name: Get PR details + id: pr-details + if: github.event_name == 'issue_comment' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_NUMBER="${{ github.event.issue.number }}" + PR_DATA=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER}") + PR_HEAD_SHA=$(echo "$PR_DATA" | jq -r '.head.sha') + echo "pr_head_sha=$PR_HEAD_SHA" >> $GITHUB_OUTPUT + echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT + - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 1 + # For workflow_dispatch, checkout default branch + # For issue_comment on PR, checkout the PR head commit + ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_head_sha || github.ref }} + fetch-depth: 0 - name: Run Claude Code id: claude From c3c3796ef3f7145e2e04586f3e0656c347fd777d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 08:51:34 +0000 Subject: [PATCH 3/8] Document Claude code review workflow fix and architecture Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com> --- CLAUDE.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 087f56963c..74894cca78 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,52 @@ -# AGENTS.md +# CLAUDE.md -This file provides guidance to AI coding assistants when working with this codebase. Designed for OpenAI Codex, GitHub Copilot, Claude, Cursor, and other AI development tools. +This file provides guidance for using Claude AI with this YDB Embedded UI codebase and documents the Claude code review workflow configuration. + +## Claude Code Review Workflows + +This repository includes two GitHub Actions workflows for Claude AI integration: + +### 1. Claude Code Review (`claude-code-review.yml`) + +- **Trigger**: Comment `/claude_review` on any PR +- **Purpose**: Automated code review focusing on coding standards and best practices +- **Model**: `claude-opus-4-20250514` + +### 2. Claude Code (`claude.yml`) + +- **Trigger**: Comment `@claude` on any PR or assign `claude-bot` to an issue +- **Purpose**: Interactive Claude assistance for development tasks +- **Model**: `claude-opus-4-20250514` + +### Workflow Architecture + +Both workflows use a robust reference resolution system to ensure Claude reviews the latest changes: + +1. **PR Reference Resolution**: When triggered by issue comments on PRs, workflows: + + - Fetch the current PR details via GitHub API + - Extract the head commit SHA (latest changes) + - Checkout the actual PR head instead of the base branch + +2. **Fallback Logic**: For manual workflow dispatches, falls back to the default branch + +3. **Full Git History**: Uses `fetch-depth: 0` to provide complete context for reviews + +### Recent Fix (Issue #2651) + +**Problem**: Claude was reviewing stale data because workflows checked out the base branch instead of PR head. + +**Solution**: Added dynamic reference resolution: + +```yaml +ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_head_sha || github.ref }} +``` + +This ensures Claude always reviews the current state of the PR, including any recent commits. + +--- + +# Project Development Guide ## Project Overview From 7040bdf0cd5b378a84cf18dc8f96801ca048727c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:08:30 +0000 Subject: [PATCH 4/8] Add validation and testing for Claude workflow fix Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com> --- .github/workflows/claude-code-review.yml | 26 ++++ .github/workflows/claude.yml | 26 ++++ .../scripts/test-claude-workflow-fix.sh | 113 ++++++++++++++++++ CLAUDE.md | 29 +++++ 4 files changed, 194 insertions(+) create mode 100755 .github/workflows/scripts/test-claude-workflow-fix.sh diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index e79cf152a1..6e616d9dd4 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -42,6 +42,32 @@ jobs: ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_head_sha || github.ref }} fetch-depth: 0 + - name: Validate checkout (verification step) + run: | + echo "=== Workflow Checkout Validation ===" + echo "Event type: ${{ github.event_name }}" + if [ "${{ github.event_name }}" = "issue_comment" ]; then + echo "PR number: ${{ steps.pr-details.outputs.pr_number }}" + echo "Expected PR head SHA: ${{ steps.pr-details.outputs.pr_head_sha }}" + fi + echo "Checked out commit: $(git rev-parse HEAD)" + echo "Current branch/ref: $(git symbolic-ref HEAD 2>/dev/null || echo 'detached HEAD')" + echo "=== Validation Complete ===" + + # Verify we checked out the correct commit for PR comments + if [ "${{ github.event_name }}" = "issue_comment" ]; then + CURRENT_SHA=$(git rev-parse HEAD) + EXPECTED_SHA="${{ steps.pr-details.outputs.pr_head_sha }}" + if [ "$CURRENT_SHA" = "$EXPECTED_SHA" ]; then + echo "✅ SUCCESS: Checked out correct PR head commit" + else + echo "❌ ERROR: Checked out $CURRENT_SHA but expected $EXPECTED_SHA" + exit 1 + fi + else + echo "✅ SUCCESS: Workflow dispatch - using default ref" + fi + - name: Run Claude Code Review id: claude-review uses: anthropics/claude-code-action@beta diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 2fc3465f3d..a4181b0947 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -41,6 +41,32 @@ jobs: ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_head_sha || github.ref }} fetch-depth: 0 + - name: Validate checkout (verification step) + run: | + echo "=== Workflow Checkout Validation ===" + echo "Event type: ${{ github.event_name }}" + if [ "${{ github.event_name }}" = "issue_comment" ]; then + echo "PR number: ${{ steps.pr-details.outputs.pr_number }}" + echo "Expected PR head SHA: ${{ steps.pr-details.outputs.pr_head_sha }}" + fi + echo "Checked out commit: $(git rev-parse HEAD)" + echo "Current branch/ref: $(git symbolic-ref HEAD 2>/dev/null || echo 'detached HEAD')" + echo "=== Validation Complete ===" + + # Verify we checked out the correct commit for PR comments + if [ "${{ github.event_name }}" = "issue_comment" ]; then + CURRENT_SHA=$(git rev-parse HEAD) + EXPECTED_SHA="${{ steps.pr-details.outputs.pr_head_sha }}" + if [ "$CURRENT_SHA" = "$EXPECTED_SHA" ]; then + echo "✅ SUCCESS: Checked out correct PR head commit" + else + echo "❌ ERROR: Checked out $CURRENT_SHA but expected $EXPECTED_SHA" + exit 1 + fi + else + echo "✅ SUCCESS: Workflow dispatch - using default ref" + fi + - name: Run Claude Code id: claude uses: anthropics/claude-code-action@beta diff --git a/.github/workflows/scripts/test-claude-workflow-fix.sh b/.github/workflows/scripts/test-claude-workflow-fix.sh new file mode 100755 index 0000000000..949d6a521e --- /dev/null +++ b/.github/workflows/scripts/test-claude-workflow-fix.sh @@ -0,0 +1,113 @@ +#!/bin/bash + +# Test script to validate Claude workflow checkout fix +# This script can be run manually to verify the workflow logic works correctly + +set -e + +echo "=== Testing Claude Workflow Checkout Fix ===" +echo + +# Test 1: Simulate fetching PR details like the workflow does +echo "Test 1: Simulating PR details API call" +echo "Note: This test requires a valid GitHub token and PR number" +echo + +if [ -z "$GITHUB_TOKEN" ]; then + echo "⚠️ GITHUB_TOKEN not set - skipping API test" + echo " To test with real data, set GITHUB_TOKEN environment variable" +else + if [ -z "$1" ]; then + echo "⚠️ No PR number provided - skipping API test" + echo " Usage: $0 " + else + PR_NUMBER="$1" + REPO="${GITHUB_REPOSITORY:-ydb-platform/ydb-embedded-ui}" + + echo "Fetching PR details for #$PR_NUMBER in $REPO..." + PR_DATA=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ + "https://api.github.com/repos/$REPO/pulls/$PR_NUMBER") + + if echo "$PR_DATA" | jq -e '.head.sha' > /dev/null 2>&1; then + PR_HEAD_SHA=$(echo "$PR_DATA" | jq -r '.head.sha') + echo "✅ Successfully fetched PR head SHA: $PR_HEAD_SHA" + else + echo "❌ Failed to fetch PR details" + echo "Response: $PR_DATA" + exit 1 + fi + fi +fi + +echo + +# Test 2: Validate the conditional logic used in workflows +echo "Test 2: Testing conditional checkout logic" +echo + +test_checkout_ref() { + local event_name="$1" + local pr_head_sha="$2" + local github_ref="$3" + + if [ "$event_name" = "issue_comment" ] && [ -n "$pr_head_sha" ]; then + echo "$pr_head_sha" + else + echo "$github_ref" + fi +} + +# Test workflow_dispatch scenario +WORKFLOW_DISPATCH_REF=$(test_checkout_ref "workflow_dispatch" "" "refs/heads/main") +echo "Workflow dispatch ref: $WORKFLOW_DISPATCH_REF" +if [ "$WORKFLOW_DISPATCH_REF" = "refs/heads/main" ]; then + echo "✅ Workflow dispatch correctly uses github.ref" +else + echo "❌ Workflow dispatch logic failed" + exit 1 +fi + +# Test issue_comment scenario +ISSUE_COMMENT_REF=$(test_checkout_ref "issue_comment" "abc123def456" "refs/heads/main") +echo "Issue comment ref: $ISSUE_COMMENT_REF" +if [ "$ISSUE_COMMENT_REF" = "abc123def456" ]; then + echo "✅ Issue comment correctly uses PR head SHA" +else + echo "❌ Issue comment logic failed" + exit 1 +fi + +echo + +# Test 3: Validate that jq is available (required for parsing GitHub API response) +echo "Test 3: Checking dependencies" +echo + +if command -v jq >/dev/null 2>&1; then + echo "✅ jq is available" +else + echo "❌ jq is not available - required for parsing GitHub API responses" + exit 1 +fi + +if command -v curl >/dev/null 2>&1; then + echo "✅ curl is available" +else + echo "❌ curl is not available - required for GitHub API calls" + exit 1 +fi + +echo + +echo "=== All Tests Passed! ===" +echo +echo "The Claude workflow fix should work correctly:" +echo "• When triggered by '/claude_review' or '@claude' comments on PRs" +echo "• The workflow will checkout the PR's head commit instead of the default branch" +echo "• The validation step will verify the correct commit was checked out" +echo +echo "To test manually:" +echo "1. Create a PR with some changes" +echo "2. Add a comment with '/claude_review' or '@claude'" +echo "3. Check the workflow logs for the 'Validate checkout' step" +echo "4. Verify it shows '✅ SUCCESS: Checked out correct PR head commit'" \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md index 74894cca78..bb23aa16f9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -44,6 +44,35 @@ ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_hea This ensures Claude always reviews the current state of the PR, including any recent commits. +### Testing the Workflow Fix + +To verify the Claude workflows are correctly checking out PR head commits: + +1. **Automatic Validation**: Both workflows include a validation step that: + + - Logs the event type and commit SHA being checked out + - Verifies the checked out commit matches the expected PR head + - Fails with a clear error if the wrong commit is checked out + +2. **Manual Testing**: + + - Create a test PR with some changes + - Add a comment with `/claude_review` or `@claude` + - Check the workflow logs for "Validate checkout (verification step)" + - Look for `✅ SUCCESS: Checked out correct PR head commit` + +3. **Test Script**: Run `.github/workflows/scripts/test-claude-workflow-fix.sh` to validate the logic locally + +4. **Expected Log Output**: + ``` + === Workflow Checkout Validation === + Event type: issue_comment + PR number: 123 + Expected PR head SHA: abc123def456... + Checked out commit: abc123def456... + ✅ SUCCESS: Checked out correct PR head commit + ``` + --- # Project Development Guide From fcc520dd507f5cb24bdaffc9e24bae0668d404aa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:18:25 +0000 Subject: [PATCH 5/8] chore: remove unnecessary test script and add conventional commit guidance Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com> --- .github/copilot-instructions.md | 1 + .../scripts/test-claude-workflow-fix.sh | 113 ------------------ 2 files changed, 1 insertion(+), 113 deletions(-) delete mode 100755 .github/workflows/scripts/test-claude-workflow-fix.sh diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 1f8c43606b..5655b46ffe 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -98,6 +98,7 @@ This is a React-based monitoring and management interface for YDB clusters. The - Run `npm run lint` and `npm run typecheck` before committing - Follow conventional commit message format +- Use conventional commit format for PR titles (fix:, feat:, chore:, docs:, etc.) - Ensure all user-facing text is internationalized - Test with a local YDB instance when possible diff --git a/.github/workflows/scripts/test-claude-workflow-fix.sh b/.github/workflows/scripts/test-claude-workflow-fix.sh deleted file mode 100755 index 949d6a521e..0000000000 --- a/.github/workflows/scripts/test-claude-workflow-fix.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash - -# Test script to validate Claude workflow checkout fix -# This script can be run manually to verify the workflow logic works correctly - -set -e - -echo "=== Testing Claude Workflow Checkout Fix ===" -echo - -# Test 1: Simulate fetching PR details like the workflow does -echo "Test 1: Simulating PR details API call" -echo "Note: This test requires a valid GitHub token and PR number" -echo - -if [ -z "$GITHUB_TOKEN" ]; then - echo "⚠️ GITHUB_TOKEN not set - skipping API test" - echo " To test with real data, set GITHUB_TOKEN environment variable" -else - if [ -z "$1" ]; then - echo "⚠️ No PR number provided - skipping API test" - echo " Usage: $0 " - else - PR_NUMBER="$1" - REPO="${GITHUB_REPOSITORY:-ydb-platform/ydb-embedded-ui}" - - echo "Fetching PR details for #$PR_NUMBER in $REPO..." - PR_DATA=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ - "https://api.github.com/repos/$REPO/pulls/$PR_NUMBER") - - if echo "$PR_DATA" | jq -e '.head.sha' > /dev/null 2>&1; then - PR_HEAD_SHA=$(echo "$PR_DATA" | jq -r '.head.sha') - echo "✅ Successfully fetched PR head SHA: $PR_HEAD_SHA" - else - echo "❌ Failed to fetch PR details" - echo "Response: $PR_DATA" - exit 1 - fi - fi -fi - -echo - -# Test 2: Validate the conditional logic used in workflows -echo "Test 2: Testing conditional checkout logic" -echo - -test_checkout_ref() { - local event_name="$1" - local pr_head_sha="$2" - local github_ref="$3" - - if [ "$event_name" = "issue_comment" ] && [ -n "$pr_head_sha" ]; then - echo "$pr_head_sha" - else - echo "$github_ref" - fi -} - -# Test workflow_dispatch scenario -WORKFLOW_DISPATCH_REF=$(test_checkout_ref "workflow_dispatch" "" "refs/heads/main") -echo "Workflow dispatch ref: $WORKFLOW_DISPATCH_REF" -if [ "$WORKFLOW_DISPATCH_REF" = "refs/heads/main" ]; then - echo "✅ Workflow dispatch correctly uses github.ref" -else - echo "❌ Workflow dispatch logic failed" - exit 1 -fi - -# Test issue_comment scenario -ISSUE_COMMENT_REF=$(test_checkout_ref "issue_comment" "abc123def456" "refs/heads/main") -echo "Issue comment ref: $ISSUE_COMMENT_REF" -if [ "$ISSUE_COMMENT_REF" = "abc123def456" ]; then - echo "✅ Issue comment correctly uses PR head SHA" -else - echo "❌ Issue comment logic failed" - exit 1 -fi - -echo - -# Test 3: Validate that jq is available (required for parsing GitHub API response) -echo "Test 3: Checking dependencies" -echo - -if command -v jq >/dev/null 2>&1; then - echo "✅ jq is available" -else - echo "❌ jq is not available - required for parsing GitHub API responses" - exit 1 -fi - -if command -v curl >/dev/null 2>&1; then - echo "✅ curl is available" -else - echo "❌ curl is not available - required for GitHub API calls" - exit 1 -fi - -echo - -echo "=== All Tests Passed! ===" -echo -echo "The Claude workflow fix should work correctly:" -echo "• When triggered by '/claude_review' or '@claude' comments on PRs" -echo "• The workflow will checkout the PR's head commit instead of the default branch" -echo "• The validation step will verify the correct commit was checked out" -echo -echo "To test manually:" -echo "1. Create a PR with some changes" -echo "2. Add a comment with '/claude_review' or '@claude'" -echo "3. Check the workflow logs for the 'Validate checkout' step" -echo "4. Verify it shows '✅ SUCCESS: Checked out correct PR head commit'" \ No newline at end of file From 4a36d2bfe9469b98c1deca5cacb0423069663d1d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:26:17 +0000 Subject: [PATCH 6/8] revert: remove unnecessary CLAUDE.md documentation changes Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com> --- CLAUDE.md | 79 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 77 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index bb23aa16f9..087f56963c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,81 +1,6 @@ -# CLAUDE.md +# AGENTS.md -This file provides guidance for using Claude AI with this YDB Embedded UI codebase and documents the Claude code review workflow configuration. - -## Claude Code Review Workflows - -This repository includes two GitHub Actions workflows for Claude AI integration: - -### 1. Claude Code Review (`claude-code-review.yml`) - -- **Trigger**: Comment `/claude_review` on any PR -- **Purpose**: Automated code review focusing on coding standards and best practices -- **Model**: `claude-opus-4-20250514` - -### 2. Claude Code (`claude.yml`) - -- **Trigger**: Comment `@claude` on any PR or assign `claude-bot` to an issue -- **Purpose**: Interactive Claude assistance for development tasks -- **Model**: `claude-opus-4-20250514` - -### Workflow Architecture - -Both workflows use a robust reference resolution system to ensure Claude reviews the latest changes: - -1. **PR Reference Resolution**: When triggered by issue comments on PRs, workflows: - - - Fetch the current PR details via GitHub API - - Extract the head commit SHA (latest changes) - - Checkout the actual PR head instead of the base branch - -2. **Fallback Logic**: For manual workflow dispatches, falls back to the default branch - -3. **Full Git History**: Uses `fetch-depth: 0` to provide complete context for reviews - -### Recent Fix (Issue #2651) - -**Problem**: Claude was reviewing stale data because workflows checked out the base branch instead of PR head. - -**Solution**: Added dynamic reference resolution: - -```yaml -ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_head_sha || github.ref }} -``` - -This ensures Claude always reviews the current state of the PR, including any recent commits. - -### Testing the Workflow Fix - -To verify the Claude workflows are correctly checking out PR head commits: - -1. **Automatic Validation**: Both workflows include a validation step that: - - - Logs the event type and commit SHA being checked out - - Verifies the checked out commit matches the expected PR head - - Fails with a clear error if the wrong commit is checked out - -2. **Manual Testing**: - - - Create a test PR with some changes - - Add a comment with `/claude_review` or `@claude` - - Check the workflow logs for "Validate checkout (verification step)" - - Look for `✅ SUCCESS: Checked out correct PR head commit` - -3. **Test Script**: Run `.github/workflows/scripts/test-claude-workflow-fix.sh` to validate the logic locally - -4. **Expected Log Output**: - ``` - === Workflow Checkout Validation === - Event type: issue_comment - PR number: 123 - Expected PR head SHA: abc123def456... - Checked out commit: abc123def456... - ✅ SUCCESS: Checked out correct PR head commit - ``` - ---- - -# Project Development Guide +This file provides guidance to AI coding assistants when working with this codebase. Designed for OpenAI Codex, GitHub Copilot, Claude, Cursor, and other AI development tools. ## Project Overview From 593db13b50e3982de263b6f9ed6d46df506da7e0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:30:42 +0000 Subject: [PATCH 7/8] remove: excessive validation steps from Claude workflows Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com> --- .github/workflows/claude-code-review.yml | 26 ------------------------ .github/workflows/claude.yml | 26 ------------------------ 2 files changed, 52 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 6e616d9dd4..e79cf152a1 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -42,32 +42,6 @@ jobs: ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_head_sha || github.ref }} fetch-depth: 0 - - name: Validate checkout (verification step) - run: | - echo "=== Workflow Checkout Validation ===" - echo "Event type: ${{ github.event_name }}" - if [ "${{ github.event_name }}" = "issue_comment" ]; then - echo "PR number: ${{ steps.pr-details.outputs.pr_number }}" - echo "Expected PR head SHA: ${{ steps.pr-details.outputs.pr_head_sha }}" - fi - echo "Checked out commit: $(git rev-parse HEAD)" - echo "Current branch/ref: $(git symbolic-ref HEAD 2>/dev/null || echo 'detached HEAD')" - echo "=== Validation Complete ===" - - # Verify we checked out the correct commit for PR comments - if [ "${{ github.event_name }}" = "issue_comment" ]; then - CURRENT_SHA=$(git rev-parse HEAD) - EXPECTED_SHA="${{ steps.pr-details.outputs.pr_head_sha }}" - if [ "$CURRENT_SHA" = "$EXPECTED_SHA" ]; then - echo "✅ SUCCESS: Checked out correct PR head commit" - else - echo "❌ ERROR: Checked out $CURRENT_SHA but expected $EXPECTED_SHA" - exit 1 - fi - else - echo "✅ SUCCESS: Workflow dispatch - using default ref" - fi - - name: Run Claude Code Review id: claude-review uses: anthropics/claude-code-action@beta diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index a4181b0947..2fc3465f3d 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -41,32 +41,6 @@ jobs: ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_head_sha || github.ref }} fetch-depth: 0 - - name: Validate checkout (verification step) - run: | - echo "=== Workflow Checkout Validation ===" - echo "Event type: ${{ github.event_name }}" - if [ "${{ github.event_name }}" = "issue_comment" ]; then - echo "PR number: ${{ steps.pr-details.outputs.pr_number }}" - echo "Expected PR head SHA: ${{ steps.pr-details.outputs.pr_head_sha }}" - fi - echo "Checked out commit: $(git rev-parse HEAD)" - echo "Current branch/ref: $(git symbolic-ref HEAD 2>/dev/null || echo 'detached HEAD')" - echo "=== Validation Complete ===" - - # Verify we checked out the correct commit for PR comments - if [ "${{ github.event_name }}" = "issue_comment" ]; then - CURRENT_SHA=$(git rev-parse HEAD) - EXPECTED_SHA="${{ steps.pr-details.outputs.pr_head_sha }}" - if [ "$CURRENT_SHA" = "$EXPECTED_SHA" ]; then - echo "✅ SUCCESS: Checked out correct PR head commit" - else - echo "❌ ERROR: Checked out $CURRENT_SHA but expected $EXPECTED_SHA" - exit 1 - fi - else - echo "✅ SUCCESS: Workflow dispatch - using default ref" - fi - - name: Run Claude Code id: claude uses: anthropics/claude-code-action@beta From 25e4e79d074df0e00c7a4f6fc6d3f5469d8bd1dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:44:47 +0000 Subject: [PATCH 8/8] fix: update copilot instructions for conventional commit PR titles Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com> --- .github/copilot-instructions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 5655b46ffe..d99079e80e 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -98,7 +98,8 @@ This is a React-based monitoring and management interface for YDB clusters. The - Run `npm run lint` and `npm run typecheck` before committing - Follow conventional commit message format -- Use conventional commit format for PR titles (fix:, feat:, chore:, docs:, etc.) +- Use conventional commit format for PR titles with lowercase subjects (e.g., "fix: update api endpoints", "feat: add new component", "chore: update dependencies") +- PR title subjects must be lowercase (no proper nouns, sentence-case, start-case, pascal-case, or upper-case) - Ensure all user-facing text is internationalized - Test with a local YDB instance when possible