-
Notifications
You must be signed in to change notification settings - Fork 323
Fixed get_code_region_around_line() boundary issue #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+2
−2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5caf864
to
478b786
Compare
Hi, due to the change of licensing, we are going to have to close this PR |
Marti2203
added a commit
that referenced
this pull request
Mar 25, 2025
* add PyTest framework * update pytest yml * update CI * activate workflow * fix branch name * add missing checkout * add correct docker command * add sonar source files * output converage to both term and xml * use acr-pytest for container name * Update pytest.yml * Update sonar-project.properties * sonar fix and update sonar exclusions * add coverage file path * reduce code duplication * add temp dir in workflow for coverage report * update sonar config * use tox and pytest outside container * add missing tox.ini file * separate pytest and build workflow * fix conda env name in workflow * update shell to use login mode for pytest workflow * update conda config * set PYTHONPATH inside tox.ini * update tox.ini * include Coverage.py in tox * add passenv to tox * change build yaml to only run on PR merge * remove redundant deps in tox.ini * abort Sonarqube Scan if coverage.xml is missing * specify source and test files for sonar * add test_search_utils * change build to docker_build * update tox usage in workflow and documentation * add test for search_utils.py * fix get_code_region_around_line * update testcase (need to clarify class signature) * fix sonar issues and update README * add empty test files for search subdir * add testcase for internal methods of SearchBackend * update tox.ini for more accurate coverage percentage * fix test_search_utils * add tests and add `converage` to whitelist for tox testenv * update test cases * update test_saerch_backend * add testcases for search subdir * update TESTING.md with setup instructions for adding `conda-forge` * update tox.ini * implement fix from PR #81 * Fake error * Fix failing test * Fix fake error and add new one * Update app/data_structures.py Co-authored-by: autocoderover[bot] <182712390+autocoderover[bot]@users.noreply.github.com> * Update app/data_structures.py Co-authored-by: autocoderover[bot] <182712390+autocoderover[bot]@users.noreply.github.com> * Bump litellm from 1.44.8 to 1.53.1.dev1 (#88) * Bump litellm from 1.44.8 to 1.53.1.dev1 Bumps [litellm](https://github.com/BerriAI/litellm) from 1.44.8 to 1.53.1.dev1. - [Release notes](https://github.com/BerriAI/litellm/releases) - [Commits](BerriAI/litellm@v1.44.8...v1.53.1.dev1) --- updated-dependencies: - dependency-name: litellm dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Update requirements.txt --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Martin Mirchev <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: WangGLJoseph <[email protected]> Co-authored-by: Martin Mirchev <[email protected]> Co-authored-by: autocoderover[bot] <182712390+autocoderover[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Marti2203
added a commit
that referenced
this pull request
Mar 26, 2025
* add PyTest framework * update pytest yml * update CI * activate workflow * fix branch name * add missing checkout * add correct docker command * add sonar source files * output converage to both term and xml * use acr-pytest for container name * Update pytest.yml * Update sonar-project.properties * sonar fix and update sonar exclusions * add coverage file path * reduce code duplication * add temp dir in workflow for coverage report * update sonar config * use tox and pytest outside container * add missing tox.ini file * separate pytest and build workflow * fix conda env name in workflow * update shell to use login mode for pytest workflow * update conda config * set PYTHONPATH inside tox.ini * update tox.ini * include Coverage.py in tox * add passenv to tox * change build yaml to only run on PR merge * remove redundant deps in tox.ini * abort Sonarqube Scan if coverage.xml is missing * specify source and test files for sonar * add test_search_utils * change build to docker_build * update tox usage in workflow and documentation * add test for search_utils.py * fix get_code_region_around_line * update testcase (need to clarify class signature) * fix sonar issues and update README * add empty test files for search subdir * add testcase for internal methods of SearchBackend * update tox.ini for more accurate coverage percentage * fix test_search_utils * add tests and add `converage` to whitelist for tox testenv * update test cases * update test_saerch_backend * add testcases for search subdir * update TESTING.md with setup instructions for adding `conda-forge` * update tox.ini * add empty test files for api subdir * implement fix from PR #81 * Fake error * Fix failing test * Fix fake error and add new one * Update app/data_structures.py Co-authored-by: autocoderover[bot] <182712390+autocoderover[bot]@users.noreply.github.com> * update readme * improve coverage of search_manage.py * improve coverage for search_utils * show only analysis cov * add empty test_sbfl * remove redundant import stmts * add test cases for sbfl.py * run actions on pytest-unit branch * add testing for api/validation.py * refactor common test utils and make it a package, add test cases * ensure coverage on new code * add test cases for api/eval_helper.py * enable printing branch coverage on CI * cover some missing branches in search_backend * complete coverage for search/search_backend.py * remove redundant collection * add test for gpt.py * update test for catching BadRequestError * disable pytest output capturing to show stdout * improve coverage of test_gpt.py * refactor common test code to pytest_utils * add unit test for model/claude.py * remove redundant declaration (refactored into pytest_utils) * add tests for models * add tests for azure.py * test bedrock * add problematic definition for Sonar scan * try changing sonar.sources to include test/ * modify sonar scan config * revert to previous sonar config for showing coverage data * finish testing models submodule * add empty test agent files * update ci * improve coverage of test_agent_search * test_patch_utils * test_agent_reproducer * test_agent_write_patch * test_agent_select * test_agent_reviewer * test_agent_proxy and refactor DummyModel to pytest_utils * test main app dir classes * test_manage * add unit test for GitHubTask and LocalTask * test_inference * move app test files * add test files * update build files for osx-arm64 envO * add app level testing * add tests for running raw tasks * improve coverage * setup multi-env for tox pytest * update ci yaml * update ci yaml to refer to github secrets for LLM API keys * add anthropic integration test (negative case with dummy api key) * update integration test ci * integration test with anthropic * remove logging * add simple openai integration test * remove print * update integration * update ci branch names * add missing eof `fi` * update logging * update env setup files * setup python black * setup pyright * remove logging * update ci * update actions * update ci yml * update regex for test branches --------- Co-authored-by: WangGLJoseph <[email protected]> Co-authored-by: Martin Mirchev <[email protected]> Co-authored-by: autocoderover[bot] <182712390+autocoderover[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the
get_code_region_around_line()
function,line_no
is 1-based, so we need to ensure that the last valid line is included in the output.If
line_no + window_size
exceedslen(file_content)
, the current implementation excludes the last line due to the exclusive nature ofrange(start, end)
.To fix this issue, I added
1
tolen(file_content)
, ensuring that the last line is included.Additionally,
i
inrange(start, end)
is 1-based becausestart
andend
are derived fromline_no
, which follows 1-based indexing.Without adjusting the index in the
else
block, usingfile_content[i]
would be off by one, potentially leading to anIndexError
or retrieving the wrong lines.To fix this, I replaced
file_content[i]
withfile_content[i - 1]