From 4c6e90b9555b992f367f44de0ec43b0af13738a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Irman=C4=8Dnik?= Date: Mon, 24 Mar 2025 15:00:39 +0100 Subject: [PATCH 1/6] Testing --- lib/main.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index f118b72..8809e6f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -18,6 +18,8 @@ Future main() async { uiReceivePort.listen((message) async { print("🔷 Received message '$message' in UI"); + + print("TESTING 123"); }); await initializeService(); From 7538dd8df132e58aa998f2ffefe1ea0b2e2fed19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Irman=C4=8Dnik?= Date: Mon, 24 Mar 2025 15:10:12 +0100 Subject: [PATCH 2/6] test --- .github/workflows/gpt_pr_review.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gpt_pr_review.yml b/.github/workflows/gpt_pr_review.yml index 560442c..f261b6c 100644 --- a/.github/workflows/gpt_pr_review.yml +++ b/.github/workflows/gpt_pr_review.yml @@ -1,6 +1,6 @@ on: pull_request: - types: [opened, synchronize] + types: [opened, reopened] jobs: code_review_job: @@ -8,7 +8,7 @@ jobs: name: ChatGPT Code Review steps: - name: GenAI Code Review - uses: cirolini/genai-code-review@v2 + uses: cirolini/genai-code-review@v3.0.3 with: openai_api_key: ${{ secrets.openai_api_key }} github_token: ${{ secrets.GH_TOKEN }} From 22c9033866d1d9762350126c9ec838e1150d4f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Irman=C4=8Dnik?= Date: Mon, 24 Mar 2025 15:11:21 +0100 Subject: [PATCH 3/6] test --- .github/workflows/gpt_pr_review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gpt_pr_review.yml b/.github/workflows/gpt_pr_review.yml index f261b6c..8ce7665 100644 --- a/.github/workflows/gpt_pr_review.yml +++ b/.github/workflows/gpt_pr_review.yml @@ -8,7 +8,7 @@ jobs: name: ChatGPT Code Review steps: - name: GenAI Code Review - uses: cirolini/genai-code-review@v3.0.3 + uses: cirolini/genai-code-review@v3 with: openai_api_key: ${{ secrets.openai_api_key }} github_token: ${{ secrets.GH_TOKEN }} From c9b5e698246988f1affab7e5622d4ce7d9e82137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Irman=C4=8Dnik?= Date: Mon, 24 Mar 2025 15:12:58 +0100 Subject: [PATCH 4/6] test --- .github/workflows/gpt_pr_review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gpt_pr_review.yml b/.github/workflows/gpt_pr_review.yml index 8ce7665..70855bd 100644 --- a/.github/workflows/gpt_pr_review.yml +++ b/.github/workflows/gpt_pr_review.yml @@ -8,7 +8,7 @@ jobs: name: ChatGPT Code Review steps: - name: GenAI Code Review - uses: cirolini/genai-code-review@v3 + uses: dlidstrom/genai-code-review@v3 with: openai_api_key: ${{ secrets.openai_api_key }} github_token: ${{ secrets.GH_TOKEN }} From 06ac101509215296cb5f11b0dcd88f9fc3bfcee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Irman=C4=8Dnik?= Date: Mon, 24 Mar 2025 15:18:18 +0100 Subject: [PATCH 5/6] test --- .github/workflows/gpt_pr_review.yml | 50 ++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gpt_pr_review.yml b/.github/workflows/gpt_pr_review.yml index 70855bd..b075db1 100644 --- a/.github/workflows/gpt_pr_review.yml +++ b/.github/workflows/gpt_pr_review.yml @@ -1,20 +1,46 @@ +name: Automated Code Review by Cody + on: pull_request: types: [opened, reopened] jobs: - code_review_job: + code_review: runs-on: ubuntu-latest - name: ChatGPT Code Review steps: - - name: GenAI Code Review - uses: dlidstrom/genai-code-review@v3 + - name: Checkout code + uses: actions/checkout@v3 + + - name: Clone cody-code-reviewer repository + run: | + git clone https://github.com/codylabs/cody-code-reviewer.git + cd cody-code-reviewer + + - name: Set up Python 3.9 + uses: actions/setup-python@v4 with: - openai_api_key: ${{ secrets.openai_api_key }} - github_token: ${{ secrets.GH_TOKEN }} - github_pr_id: ${{ github.event.number }} - openai_model: "gpt-3.5-turbo" # optional - openai_temperature: 0.5 # optional - openai_max_tokens: 2048 # optional - mode: files # files or patch - # custom_prompt: "" # optional \ No newline at end of file + python-version: "3.9" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run Code Review Model + run: | + python src/review_pull_request.py ${{ github.event.pull_request.number }} ${{ github.repository }} > ${{ github.workspace }}/output.txt + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + # Optional: update to a model of your choice from https://platform.openai.com/docs/models + OPENAI_MODEL: "gpt-4o" + + - name: Comment on Pull Request + run: | + python src/comment_on_pr.py ${{ github.event.pull_request.number }} "${{ secrets.GH_TOKEN }}" ${{ github.repository }} + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + +permissions: + contents: read + pull-requests: write \ No newline at end of file From bd5da5523ad6a5172a1c3966fc7f114ba5b8cecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Irman=C4=8Dnik?= Date: Mon, 24 Mar 2025 15:22:22 +0100 Subject: [PATCH 6/6] test --- .github/workflows/gpt_pr_review.yml | 48 ++++++++--------------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/.github/workflows/gpt_pr_review.yml b/.github/workflows/gpt_pr_review.yml index b075db1..12a3e02 100644 --- a/.github/workflows/gpt_pr_review.yml +++ b/.github/workflows/gpt_pr_review.yml @@ -1,46 +1,22 @@ -name: Automated Code Review by Cody +name: AI Code Reviewer on: pull_request: - types: [opened, reopened] - + types: + - opened + - reopened +permissions: write-all jobs: - code_review: + review: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout Repo uses: actions/checkout@v3 - - name: Clone cody-code-reviewer repository - run: | - git clone https://github.com/codylabs/cody-code-reviewer.git - cd cody-code-reviewer - - - name: Set up Python 3.9 - uses: actions/setup-python@v4 + - name: AI Code Reviewer + uses: your-username/ai-code-reviewer@main with: - python-version: "3.9" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Run Code Review Model - run: | - python src/review_pull_request.py ${{ github.event.pull_request.number }} ${{ github.repository }} > ${{ github.workspace }}/output.txt - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # The GITHUB_TOKEN is there by default so you just need to keep it like it is and not necessarily need to add it as secret as it will throw an error. [More Details](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret) OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - # Optional: update to a model of your choice from https://platform.openai.com/docs/models - OPENAI_MODEL: "gpt-4o" - - - name: Comment on Pull Request - run: | - python src/comment_on_pr.py ${{ github.event.pull_request.number }} "${{ secrets.GH_TOKEN }}" ${{ github.repository }} - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - -permissions: - contents: read - pull-requests: write \ No newline at end of file + OPENAI_API_MODEL: "gpt-4" # Optional: defaults to "gpt-4" + exclude: "**/*.json, **/*.md" # Optional: exclude patterns separated by commas \ No newline at end of file