From 0e001d585dfae9c0524da5c3edca416e99cc3c95 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Fri, 15 Aug 2025 09:40:42 -0700 Subject: [PATCH] improv: organization --- .../workflows/continue-detailed-review.yaml | 2 +- .../workflows/continue-general-review.yaml | 2 +- actions/README.md | 224 ++++++++++++++++++ .../detailed-review/action.yml | 2 +- .../detailed-review}/annotate-diff.js | 0 .../detailed-review}/annotate-diff.test.js | 0 .../detailed-review}/package.json | 0 .../general-review}/action.yml | 0 pr-review-action/README.md | 146 ------------ 9 files changed, 227 insertions(+), 149 deletions(-) create mode 100644 actions/README.md rename {pr-review-action => actions}/detailed-review/action.yml (99%) rename {pr-review-action/scripts => actions/detailed-review}/annotate-diff.js (100%) rename {pr-review-action/scripts => actions/detailed-review}/annotate-diff.test.js (100%) rename {pr-review-action/scripts => actions/detailed-review}/package.json (100%) rename {pr-review-action => actions/general-review}/action.yml (100%) delete mode 100644 pr-review-action/README.md diff --git a/.github/workflows/continue-detailed-review.yaml b/.github/workflows/continue-detailed-review.yaml index dcc8401c5..66eab4635 100644 --- a/.github/workflows/continue-detailed-review.yaml +++ b/.github/workflows/continue-detailed-review.yaml @@ -18,7 +18,7 @@ jobs: timeout-minutes: 10 steps: - name: Run Detailed PR Review - uses: continuedev/continue/pr-review-action/detailed-review@tomasz/con-3480 + uses: continuedev/continue/actions/detailed-review@tomasz/con-3480 with: continue-api-key: ${{ secrets.CONTINUE_API_KEY }} continue-org: continuedev diff --git a/.github/workflows/continue-general-review.yaml b/.github/workflows/continue-general-review.yaml index bbe4f5ff6..4f4b8ed66 100644 --- a/.github/workflows/continue-general-review.yaml +++ b/.github/workflows/continue-general-review.yaml @@ -18,7 +18,7 @@ jobs: timeout-minutes: 10 steps: - name: Run Continue PR Review Action - uses: continuedev/continue/pr-review-action@tomasz/con-3480 + uses: continuedev/continue/actions/general-review@tomasz/con-3480 with: continue-api-key: ${{ secrets.CONTINUE_API_KEY }} continue-org: 'continuedev' diff --git a/actions/README.md b/actions/README.md new file mode 100644 index 000000000..4be910eca --- /dev/null +++ b/actions/README.md @@ -0,0 +1,224 @@ +# Continue PR Review Actions + +GitHub Actions that provide automated code reviews for pull requests using Continue CLI. + +## Available Actions + +This repository provides two GitHub Actions for different review styles: + +### 1. General Review Action +Provides high-level PR assessment with overall feedback and recommendations. + +- **Path:** `continuedev/continue/actions/general-review@v1` +- **Trigger:** `@continue-general-review` +- **Output:** Summary comment with strengths, issues, and recommendations + +### 2. Detailed Review Action +Provides line-by-line inline comments on specific code changes. + +- **Path:** `continuedev/continue/actions/detailed-review@v1` +- **Trigger:** `@continue-detailed-review` +- **Output:** Inline review comments on specific lines of code + +## Quick Start + +### Using Both Actions Together + +```yaml +name: PR Reviews +on: + pull_request: + types: [opened, ready_for_review] + issue_comment: + types: [created] + +permissions: + contents: read + pull-requests: write + issues: write + +jobs: + general-review: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: continuedev/continue/actions/general-review@v1 + with: + continue-api-key: ${{ secrets.CONTINUE_API_KEY }} + continue-org: 'your-org-name' + continue-config: 'your-org-name/review-bot' + + detailed-review: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: continuedev/continue/actions/detailed-review@v1 + with: + continue-api-key: ${{ secrets.CONTINUE_API_KEY }} + continue-org: 'your-org-name' + continue-config: 'your-org-name/review-bot' +``` + +### General Review Only + +```yaml +name: PR General Review +on: + pull_request: + types: [opened, ready_for_review] + issue_comment: + types: [created] + +permissions: + contents: read + pull-requests: write + issues: write + +jobs: + review: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: continuedev/continue/actions/general-review@v1 + with: + continue-api-key: ${{ secrets.CONTINUE_API_KEY }} + continue-org: 'your-org-name' + continue-config: 'your-org-name/review-bot' +``` + +### Detailed Review Only + +```yaml +name: PR Detailed Review +on: + pull_request: + types: [opened, ready_for_review] + issue_comment: + types: [created] + +permissions: + contents: read + pull-requests: write + issues: write + +jobs: + review: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: continuedev/continue/actions/detailed-review@v1 + with: + continue-api-key: ${{ secrets.CONTINUE_API_KEY }} + continue-org: 'your-org-name' + continue-config: 'your-org-name/review-bot' +``` + +## Inputs + +Both actions accept the same inputs: + +| Input | Description | Required | +|-------|-------------|----------| +| `continue-api-key` | API key for Continue service | Yes | +| `continue-org` | Organization for Continue config | Yes | +| `continue-config` | Config path (e.g., "myorg/review-bot") | Yes | + +## Setup Requirements + +### 1. Continue API Key +Add your Continue API key as a secret named `CONTINUE_API_KEY` in your repository: +1. Go to your repository's Settings +2. Navigate to Secrets and variables → Actions +3. Click "New repository secret" +4. Name: `CONTINUE_API_KEY` +5. Value: Your Continue API key + +### 2. Continue Configuration +Set up your review bot configuration in Continue: +1. Create a configuration for your organization +2. Configure the review bot settings +3. Note your organization name and config path + +### 3. Workflow Permissions +The workflow requires these permissions: +- `contents: read` - To checkout and read repository code +- `pull-requests: write` - To post review comments on PRs +- `issues: write` - To respond to comment triggers + +## Triggering Reviews + +Both actions can be triggered in two ways: + +### Automatic Triggers +- When a PR is opened by a team member (OWNER, MEMBER, or COLLABORATOR) +- When a PR is marked as "ready for review" by a team member + +### Manual Triggers +Team members can trigger reviews by commenting on any pull request: +- `@continue-general-review` - Triggers a general review +- `@continue-detailed-review` - Triggers a detailed inline review + +## Review Outputs + +### General Review Output +The general review provides a structured comment that includes: +- **Strengths**: What was done well in the PR +- **Issues Found**: Categorized by severity (Critical, High, Medium, Low) +- **Suggestions**: Improvement recommendations +- **Overall Assessment**: Final recommendation (APPROVE, REQUEST_CHANGES, or COMMENT) + +### Detailed Review Output +The detailed review provides: +- **Inline Comments**: Specific feedback on individual lines of code +- **Position Markers**: Comments appear directly on the changed lines +- **Review Summary**: Overall assessment of the changes +- **Actionable Feedback**: Specific suggestions for each issue found + +## How It Works + +### General Review Process +1. Checks out repository code +2. Fetches PR diff using GitHub CLI +3. Generates a comprehensive review prompt +4. Runs Continue CLI with specified configuration +5. Posts review as a PR comment + +### Detailed Review Process +1. Checks out repository code +2. Fetches PR diff with GitHub API positions +3. Annotates diff with position markers +4. Generates inline review prompt +5. Runs Continue CLI for detailed analysis +6. Posts inline comments using GitHub's review API + +## Versioning + +This action follows semantic versioning. We recommend using the major version tag for automatic updates: + +- `@v1` - Automatically uses the latest v1.x.x release (recommended) +- `@v1.0.0` - Pins to a specific version +- `@main` - Uses the latest code from the main branch (not recommended for production) + +## Troubleshooting + +### Review not triggering +- Ensure the PR author or commenter has appropriate permissions (OWNER, MEMBER, or COLLABORATOR) +- Check that the workflow file is in the default branch +- Verify the Continue API key is correctly set as a repository secret + +### No review output generated +- Check the action logs for any errors +- Verify your Continue configuration is correct +- Ensure your Continue API key is valid + +### Inline comments not appearing (Detailed Review) +- Check that the PR has a valid diff +- Verify GitHub API permissions are correct +- Review action logs for position calculation errors + +## Support + +For issues or questions: +- [Continue Documentation](https://docs.continue.dev) +- [GitHub Issues](https://github.com/continuedev/continue/issues) +- [Discord Community](https://discord.gg/vapESyrFmJ) \ No newline at end of file diff --git a/pr-review-action/detailed-review/action.yml b/actions/detailed-review/action.yml similarity index 99% rename from pr-review-action/detailed-review/action.yml rename to actions/detailed-review/action.yml index 301437f3f..a697d451b 100644 --- a/pr-review-action/detailed-review/action.yml +++ b/actions/detailed-review/action.yml @@ -91,7 +91,7 @@ runs: gh pr diff $PR_NUMBER --color=never > pr_diff.txt # Annotate diff with GitHub API positions - node ${{ github.action_path }}/../scripts/annotate-diff.js pr_diff.txt > pr_diff_annotated.txt + node ${{ github.action_path }}/annotate-diff.js pr_diff.txt > pr_diff_annotated.txt # Debug: Show sample of annotated diff echo "=== SAMPLE OF ANNOTATED DIFF ===" diff --git a/pr-review-action/scripts/annotate-diff.js b/actions/detailed-review/annotate-diff.js similarity index 100% rename from pr-review-action/scripts/annotate-diff.js rename to actions/detailed-review/annotate-diff.js diff --git a/pr-review-action/scripts/annotate-diff.test.js b/actions/detailed-review/annotate-diff.test.js similarity index 100% rename from pr-review-action/scripts/annotate-diff.test.js rename to actions/detailed-review/annotate-diff.test.js diff --git a/pr-review-action/scripts/package.json b/actions/detailed-review/package.json similarity index 100% rename from pr-review-action/scripts/package.json rename to actions/detailed-review/package.json diff --git a/pr-review-action/action.yml b/actions/general-review/action.yml similarity index 100% rename from pr-review-action/action.yml rename to actions/general-review/action.yml diff --git a/pr-review-action/README.md b/pr-review-action/README.md deleted file mode 100644 index 78dffb120..000000000 --- a/pr-review-action/README.md +++ /dev/null @@ -1,146 +0,0 @@ -# Continue PR Review Action - -A GitHub Action that provides automated code review for pull requests using Continue CLI. - -## Usage - -Add this workflow to your repository at `.github/workflows/pr-review.yml`: - -```yaml -name: PR Review -on: - pull_request: - types: [opened, ready_for_review] - issue_comment: - types: [created] - -permissions: - contents: read - pull-requests: write - issues: write - -jobs: - review: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: continuedev/continue/pr-review-action@v1 - with: - continue-api-key: ${{ secrets.CONTINUE_API_KEY }} - continue-org: 'your-org-name' - continue-config: 'your-org-name/review-bot' -``` - -The action automatically handles authorization checks and only runs for: -- PRs opened or marked ready by team members (OWNER, MEMBER, COLLABORATOR) -- Comments containing `@continue-general-review` from team members - -## Inputs - -| Input | Description | Required | -|-------|-------------|----------| -| `continue-api-key` | API key for Continue service | Yes | -| `continue-org` | Organization for Continue config | Yes | -| `continue-config` | Config path (e.g., "myorg/review-bot") | Yes | - -## Setup Requirements - -### 1. Continue API Key -Add your Continue API key as a secret named `CONTINUE_API_KEY` in your repository: -1. Go to your repository's Settings -2. Navigate to Secrets and variables → Actions -3. Click "New repository secret" -4. Name: `CONTINUE_API_KEY` -5. Value: Your Continue API key - -### 2. Continue Configuration -Set up your review bot configuration in Continue: -1. Create a configuration for your organization -2. Configure the review bot settings -3. Note your organization name and config path - -### 3. Workflow Permissions -The workflow requires these permissions: -- `contents: read` - To checkout and read repository code -- `pull-requests: write` - To post review comments on PRs -- `issues: write` - To respond to comment triggers - -## Triggering Reviews - -The action can be triggered in two ways: - -### Automatic Triggers -- When a PR is opened by a team member (OWNER, MEMBER, or COLLABORATOR) -- When a PR is marked as "ready for review" by a team member - -### Manual Trigger -Team members can trigger a review by commenting `@continue-general-review` on any pull request. - -## Versioning - -This action follows semantic versioning. We recommend using the major version tag for automatic updates: - -- `@v1` - Automatically uses the latest v1.x.x release (recommended) -- `@v1.0.0` - Pins to a specific version -- `@main` - Uses the latest code from the main branch (not recommended for production) - -## Minimal Example - -This is the simplest possible configuration: - -```yaml -name: PR Review -on: [pull_request, issue_comment] - -permissions: - contents: read - pull-requests: write - issues: write - -jobs: - review: - runs-on: ubuntu-latest - steps: - - uses: continuedev/continue/pr-review-action@v1 - with: - continue-api-key: ${{ secrets.CONTINUE_API_KEY }} - continue-org: 'acme-corp' - continue-config: 'acme-corp/review-bot' -``` - -## How It Works - -1. The action automatically checks out your repository code -2. Installs the Continue CLI (v1.4.25) -3. Fetches the PR diff using GitHub CLI -4. Generates a comprehensive review prompt -5. Runs the Continue CLI with your specified configuration -6. Posts the review as a comment on the PR - -## Review Output - -The action generates a structured code review that includes: - -- **Strengths**: What was done well in the PR -- **Issues Found**: Categorized by severity (Critical, High, Medium, Low) -- **Suggestions**: Improvement recommendations -- **Overall Assessment**: Final recommendation (APPROVE, REQUEST_CHANGES, or COMMENT) - -## Troubleshooting - -### Review not triggering -- Ensure the PR author or commenter has appropriate permissions (OWNER, MEMBER, or COLLABORATOR) -- Check that the workflow file is in the default branch -- Verify the Continue API key is correctly set as a repository secret - -### No review output generated -- Check the action logs for any errors -- Verify your Continue configuration is correct -- Ensure your Continue API key is valid - -## Support - -For issues or questions: -- [Continue Documentation](https://docs.continue.dev) -- [GitHub Issues](https://github.com/continuedev/continue/issues) -- [Discord Community](https://discord.gg/vapESyrFmJ) \ No newline at end of file