diff --git a/INSTALL.md b/INSTALL.md index 31042b60..4593dccf 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -123,7 +123,7 @@ jobs: OPENAI_KEY: ${{ secrets.OPENAI_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` -** if you want to pin your action to a specific commit for stability reasons +** if you want to pin your action to a specific release (v0.7 for example) for stability reasons, use: ```yaml on: pull_request: @@ -140,7 +140,7 @@ jobs: steps: - name: PR Agent action step id: pragent - uses: Codium-ai/pr-agent@ + uses: Codium-ai/pr-agent@v0.7 env: OPENAI_KEY: ${{ secrets.OPENAI_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 380132e1..af0b5af2 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ CodiumAI `PR-Agent` is an open-source tool aiming to help developers review pull See the [usage guide](./Usage.md) for instructions how to run the different tools from [CLI](./Usage.md#working-from-a-local-repo-cli), or by [online usage](./Usage.md#online-usage), as well as additional details on optional commands and configurations. +[Release notes](./RELEASE_NOTES.md) +

Example results:

/describe:

diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 00000000..bdb0165b --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,25 @@ +## [Version 0.7] - 2023-09-20 + +### Docker Tags +- codiumai/pr-agent:0.7 +- codiumai/pr-agent:0.7-github_app +- codiumai/pr-agent:0.7-bitbucket-app +- codiumai/pr-agent:0.7-gitlab_webhook +- codiumai/pr-agent:0.7-github_polling +- codiumai/pr-agent:0.7-github_action + +### Added::Algo +- New tool /similar_issue - Currently on GitHub app and CLI: indexes the issues in the repo, find the most similar issues to the target issue. +- Describe markers: Empower the /describe tool with a templating capability (see more details in https://github.com/Codium-ai/pr-agent/pull/273). +- New feature in the /review tool - added an estimated effort estimation to the review (https://github.com/Codium-ai/pr-agent/pull/306). + +### Added::Infrastructure +- Implementation of a GitLab webhook. +- Implementation of a BitBucket app. + +### Fixed +- Protection against no code suggestions generated. +- Resilience to repositories where the languages cannot be automatically detected. + + + diff --git a/pr_agent/algo/git_patch_processing.py b/pr_agent/algo/git_patch_processing.py index 1a2bd22b..58d05235 100644 --- a/pr_agent/algo/git_patch_processing.py +++ b/pr_agent/algo/git_patch_processing.py @@ -40,12 +40,16 @@ def extend_patch(original_file_str, patch_str, num_lines) -> str: extended_patch_lines.extend( original_lines[start1 + size1 - 1:start1 + size1 - 1 + num_lines]) + res = list(match.groups()) + for i in range(len(res)): + if res[i] is None: + res[i] = 0 try: - start1, size1, start2, size2 = map(int, match.groups()[:4]) + start1, size1, start2, size2 = map(int, res[:4]) except: # '@@ -0,0 +1 @@' case - start1, size1, size2 = map(int, match.groups()[:3]) + start1, size1, size2 = map(int, res[:3]) start2 = 0 - section_header = match.groups()[4] + section_header = res[4] extended_start1 = max(1, start1 - num_lines) extended_size1 = size1 + (start1 - extended_start1) + num_lines extended_start2 = max(1, start2 - num_lines) @@ -207,10 +211,15 @@ __old hunk__ old_content_lines = [] if match: prev_header_line = header_line + + res = list(match.groups()) + for i in range(len(res)): + if res[i] is None: + res[i] = 0 try: - start1, size1, start2, size2 = map(int, match.groups()[:4]) + start1, size1, start2, size2 = map(int, res[:4]) except: # '@@ -0,0 +1 @@' case - start1, size1, size2 = map(int, match.groups()[:3]) + start1, size1, size2 = map(int, res[:3]) start2 = 0 elif line.startswith('+'):