From 34ab21424676589963ca8bddf71362f18cf4c44d Mon Sep 17 00:00:00 2001 From: Michael Pond Date: Thu, 15 Aug 2024 09:39:56 -0400 Subject: [PATCH 1/3] adding renovate file --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..81c9d06 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>cds-snc/renovate-config" + ] + } \ No newline at end of file From b6f05d7200f7fef89335822e17dc2abcf6c57fb5 Mon Sep 17 00:00:00 2001 From: Michael Pond Date: Thu, 15 Aug 2024 09:51:46 -0400 Subject: [PATCH 2/3] updating the docs and yaml --- .github/workflows/code_review.yml | 4 ++-- README.md | 21 +++++++++------------ action.yml | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/code_review.yml b/.github/workflows/code_review.yml index 3edcf77..79c3486 100644 --- a/.github/workflows/code_review.yml +++ b/.github/workflows/code_review.yml @@ -1,4 +1,4 @@ -name: Code Review with OpenAI +name: CDS Code Review with OpenAI on: pull_request: types: @@ -12,7 +12,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Code Review - uses: freeedcom/ai-codereviewer@main + uses: cds-snc/cds-ai-codereviewer@main with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} diff --git a/README.md b/README.md index 566a3ea..8ba4b3f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# AI Code Reviewer +# CDS AI Code Reviewer -AI Code Reviewer is a GitHub Action that leverages OpenAI's GPT-4 API to provide intelligent feedback and suggestions on +CDS AI Code Reviewer is a GitHub Action that leverages OpenAI's GPT-4 API to provide intelligent feedback and suggestions on your pull requests. This powerful tool helps improve code quality and saves developers time by automating the code review process. @@ -22,7 +22,7 @@ review process. 3. Create a `.github/workflows/main.yml` file in your repository and add the following content: ```yaml -name: AI Code Reviewer +name: CDS AI Code Reviewer on: pull_request: @@ -37,8 +37,8 @@ jobs: - name: Checkout Repo uses: actions/checkout@v3 - - name: AI Code Reviewer - uses: your-username/ai-code-reviewer@main + - name: CDS AI Code Reviewer + uses: cds-snc/cds-ai-code-reviewer@main with: 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 }} @@ -46,21 +46,18 @@ jobs: exclude: "**/*.json, **/*.md" # Optional: exclude patterns separated by commas ``` -4. Replace `your-username` with your GitHub username or organization name where the AI Code Reviewer repository is - located. +4. Customize the `exclude` input if you want to ignore certain file patterns from being reviewed. -5. Customize the `exclude` input if you want to ignore certain file patterns from being reviewed. - -6. Commit the changes to your repository, and AI Code Reviewer will start working on your future pull requests. +5. Commit the changes to your repository, and CDS AI Code Reviewer will start working on your future pull requests. ## How It Works -The AI Code Reviewer GitHub Action retrieves the pull request diff, filters out excluded files, and sends code chunks to +The CDS AI Code Reviewer GitHub Action retrieves the pull request diff, filters out excluded files, and sends code chunks to the OpenAI API. It then generates review comments based on the AI's response and adds them to the pull request. ## Contributing -Contributions are welcome! Please feel free to submit issues or pull requests to improve the AI Code Reviewer GitHub +Contributions are welcome! Please feel free to submit issues or pull requests to improve the CDS AI Code Reviewer GitHub Action. Let the maintainer generate the final package (`yarn build` & `yarn package`). diff --git a/action.yml b/action.yml index 976aed7..b2a61e4 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -name: "AI Code Review Action" +name: "CDS AI Code Review Action" description: "Perform code reviews and comment on diffs using OpenAI API." inputs: GITHUB_TOKEN: From 286acdd3bff0570d53be344effa9de3626b9778b Mon Sep 17 00:00:00 2001 From: Michael Pond Date: Thu, 15 Aug 2024 09:55:21 -0400 Subject: [PATCH 3/3] Adding PR Template --- .github/PULL_REQUEST_TEMPLATE.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..7ea3027 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,28 @@ + +# Summary | Résumé + + +> 1-3 sentence description of the changed you're proposing, including a link to +> a GitHub Issue # or Trello card if applicable. + +--- + +> Description en 1 à 3 phrases de la modification proposée, avec un lien vers le +> problème (« issue ») GitHub ou la fiche Trello, le cas échéant. + +> **Note**: Ajoutez vous une nouvelle page par Articles GC? Assurez vous d'ajouter le chemin dans les [règles WAF](https://github.com/cds-snc/notification-utils/tree/main/.github/actions/waffles#supporting-a-new-url-within-gcnotify). + +# Test instructions | Instructions pour tester la modification + +> Sequential steps (1., 2., 3., ...) that describe how to test this change. This +> will help a developer test things out without too much detective work. Also, +> include any environmental setup steps that aren't in the normal README steps +> and/or any time-based elements that this requires. + +--- + +> Étapes consécutives (1., 2., 3., …) qui décrivent la façon de tester la +> modification. Elles aideront les développeurs à faire des tests sans avoir à +> jouer au détective. Veuillez aussi inclure toutes les étapes de configuration +> de l’environnement qui ne font pas partie des étapes normales dans le fichier +> README et tout élément temporel requis. \ No newline at end of file