Commit graph

502 commits

Author SHA1 Message Date
CT Wu
ca95e876eb Enhance Bitbucket provider functionality and update secret configuration template. 2025-04-08 17:52:52 +08:00
sharoneyal
14971c4f5f
Add support for documentation content exceeding token limits (#1670)
* - Add support for documentation content exceeding token limits via two phase operation:
1. Ask LLM to rank headings which are most likely to contain an answer to a user question
2. Provide the corresponding files for the LLM to search for an answer.

- Refactor of help_docs to make the code more readable
- For the purpose of getting canonical path: git providers to use default branch and not the PR's source branch.
- Refactor of token counting and making it clear on when an estimate factor will be used.

* Code review changes:
1. Correctly handle exception during retry_with_fallback_models (to allow fallback model to run in case of failure)
2. Better naming for default_branch in bitbucket cloud provider
2025-04-03 11:51:26 +03:00
mrT23
02d9aed7fe
Fix GitLab provider to use default branch instead of target branch for repo settings 2025-03-29 19:39:56 +03:00
Eyal Sharon
e422f50cfe Fix for bug in get_canonical_url_parts when a new issue created, without git url provided. 2025-03-27 17:29:02 +02:00
Eyal Sharon
255e1d0fc1 Missing class member 2025-03-26 14:29:50 +02:00
Eyal Sharon
7117e9fe0e Github Provider: Support publishing a comment on a non pr issue 2025-03-26 13:36:37 +02:00
Eyal Sharon
605eef64e7 Generate git url correctly in case invoked from both user and GitHub app contexts 2025-03-25 12:08:00 +02:00
Eyal Sharon
b161672218 Remove redundant abstractmethod for _prepare_clone_url_with_token 2025-03-24 15:56:45 +02:00
Eyal Sharon
fb324d106c Remove non implemented method _prepare_clone_url_with_token from providers which don't support it and instead, issue a warning in base class. 2025-03-24 14:06:06 +02:00
Eyal Sharon
a4387b5829 Fix more /improve suggestions 2025-03-24 11:19:23 +02:00
Eyal Sharon
477ebf4926 Code recommendations from /improve 2025-03-24 10:54:50 +02:00
Eyal Sharon
e14fc7e02d Fix missing self.bearer_token for bitbucket related providers 2025-03-24 10:21:23 +02:00
Eyal Sharon
1bd65934df Merge origin/main into es/help_docs 2025-03-23 20:04:58 +02:00
Eyal Sharon
dd80276f3f Support cloning repo
Support forcing accurate token calculation (claude)
Help docs: Add desired branch in case of user supplied git repo, with default set to "main"
Better documentation for getting canonical url parts
2025-03-23 09:55:58 +02:00
cdornano
e925f31ac0
Update azuredevops_provider.py
Will make qodo agent comments "Active" by default, and not "ByDesign" which is renders to "unknown" on Azure DevOps PRs. With this, PR authors are obliged to treat the PR comment of the qodo agent before Merging. This will help companies in analysing the impact of qodo agent on their PR, as every comment needs to be treated as either "Resolved" "Won't fix" "Close"
2025-03-21 12:57:03 +00:00
Eyal Sharon
5e7e353670 Added help_docs feature. 2025-03-20 23:48:01 +02:00
mrT23
9a9acef0e8
fix: handle empty commits and errors in GitLab provider's get_latest_commit_url 2025-02-26 21:24:53 +02:00
Hussam.lawen
0a4c02c8b3
feat: enhance Azure DevOps integration with improved error handling and PR commands 2025-02-26 16:40:46 +02:00
Hussam Lawen
d91245a9d3
Update pr_agent/git_providers/github_provider.py
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
2025-02-20 20:12:49 +02:00
Hussam Lawen
bfdaac0a05
Update pr_agent/git_providers/github_provider.py
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
2025-02-20 20:11:25 +02:00
Wonchae Lee
56978d9793
Update pr_agent/git_providers/github_provider.py
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
2025-02-20 12:32:29 -05:00
Wonchae Lee
6433e827f4
Update pr_agent/git_providers/github_provider.py
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
2025-02-20 12:32:22 -05:00
Wonchae Lee
c0e78ba522
Update pr_agent/git_providers/github_provider.py
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
2025-02-20 12:32:14 -05:00
Wonchae Lee
45d776a1f7
Update pr_agent/git_providers/github_provider.py
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
2025-02-20 12:32:06 -05:00
Wonchae Lee
6e19e77e5e
Update pr_agent/git_providers/github_provider.py
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
2025-02-20 12:31:25 -05:00
WonOfAKind
0f63d8685f Added sub-issue fetching to enhance PR analysis 2025-02-12 19:40:36 -05:00
mrT23
24bf875db6
fix: handle GitHub permission errors when editing comments 2025-02-03 07:51:44 +02:00
Griffin Anspach
664f1938c9 Remove false log that file was modified, but no patch found for bitbucket server 2025-01-20 14:56:10 -05:00
polacekpavel
fe6540275c fix(local_git): add interface method stubs for local git provider compatibility 2025-01-15 18:19:36 +01:00
med8bra
bd611bc1c2
fix(azure-provider): handle renamed files as new files
This fixes a bug when azure-provider tries to fetch original content of a renamed file and fails since the file doesn't exist in base yet.
Also handles case when `diff_type` includes multiple actions as `edit, rename`.

This can be improved to fetch the actual old content using the old path before renaming, but IMO for azure devops since its dying anyway, this fix should be enough.
2025-01-13 22:22:13 +01:00
Tal
8819293770
Merge pull request #1406 from vishwamartur/support-personal-spaces
Support pull requests in personal spaces in Bitbucket Server
2025-01-01 09:26:29 +02:00
mrT23
95d0fafa75
refactor: optimize file content loading and improve rate limit handling 2024-12-29 11:25:33 +02:00
Vishwanath Martur
4688b20284 Support pull requests in personal spaces in Bitbucket Server
Related to #1148

Update `_parse_pr_url` method in `pr_agent/git_providers/bitbucket_server_provider.py` to handle URLs with `/users/`.

* Add logic to check for both `/projects/` and `/users/` in the URL path and process them accordingly.
* Modify the method to raise a `ValueError` if neither `/projects/` nor `/users/` is found in the URL.
* Update the `workspace_slug` to include a `~` prefix if the URL contains `/users/`.

Add test case for URL with `/users/` in `tests/unittest/test_bitbucket_provider.py`.

* Ensure the new test case verifies the correct parsing of URLs with `/users/`.
2024-12-22 00:42:11 +05:30
mrT23
7e8361b5fd
feat: enhance code review output with collapsible code snippets and variable links 2024-12-19 20:30:56 +02:00
Trung Dinh
e3d779c30d Fix typo model_weak 2024-12-08 22:09:48 +07:00
Trung Dinh
3c31048afc Update model in git provider 2024-12-08 22:00:37 +07:00
Patrick Decat
a825aec5f3
Add publish_output_progress config support to AzureDevOps, BitBucket and Gitlab providers 2024-11-28 17:15:24 +01:00
mrT23
f08b20c667
Improve logging and error handling in Azure DevOps provider for code suggestions 2024-11-21 13:37:48 +02:00
mrT23
eb0c959ca9
Add validation for committable comments within PR hunks in GitHub provider 2024-11-20 17:28:13 +02:00
mrT23
741a70ad9d
Add detailed diff code generation for GitLab suggestions and improve comment formatting 2024-11-20 17:26:36 +02:00
mrT23
22ee03981e
Add diff code generation for Bitbucket code suggestions and improve logging 2024-11-20 17:25:10 +02:00
mrT23
2f4545dc15
Refactor byte decoding in Bitbucket server provider using decode_if_bytes function 2024-11-12 08:26:33 +02:00
mrT23
cbd490b3d7
use a more modern version 2024-11-12 08:23:11 +02:00
mrT23
065777040f
Improve PR file content retrieval and logging verbosity handling 2024-11-12 08:06:02 +02:00
Tal
5c5a3e267c
Merge branch 'main' into introduce-pre-commit 2024-11-08 09:54:21 +02:00
mrT23
2f5e8472b9
Add PRDescriptionHeader enum for consistent "Changes walkthrough" usage across modules 2024-10-30 08:48:08 +02:00
Yu Ishikawa
81dea65856 Format files by pre-commit run -a
Signed-off-by: Yu Ishikawa <yu-iskw@users.noreply.github.com>
2024-10-30 10:00:36 +09:00
mrT23
597f1c6f83
Add PRDescriptionHeader enum for consistent "Changes walkthrough" usage across modules 2024-10-28 08:12:56 +02:00
mrT23
27abe48a34
feat: import Range utility in GitHubProvider for enhanced functionality 2024-10-14 09:43:58 +03:00
mrT23
8fe504a7ec
feat: import Range utility in GitHubProvider for enhanced functionality 2024-10-14 09:40:57 +03:00
mrT23
f6ba49819a
feat: enhance GitHubProvider with improved error handling and URL parsing
- Add traceback logging for exceptions in diff file retrieval
- Improve URL parsing to handle '/api/v3' paths and validate GitHub URLs
- Modify `publish_comment` to return None for temporary comments
- Update constructor to accept an optional GitHub client parameter
2024-10-14 09:18:06 +03:00
Cory Ball
a476e85fa7 bug-fix_azuredevops-new-file 2024-10-08 01:13:44 -05:00
mrT23
e2b5489495
feat: add error handling for invalid repo settings configuration
- Implement error handling for invalid TOML configurations in repo settings.
- Log warnings and send comments to PRs when configuration errors occur.
- Introduce `handle_configurations_errors` function to manage error reporting.
- Ensure compatibility with different markdown formats for error messages.
2024-10-07 09:13:17 +03:00
yzongyue
ce8e637800 get_line_link compatible with old gitlab versions 2024-09-15 14:56:08 +08:00
eddielu
29028d43cf
Set azure devops default status to ByDesign 2024-09-13 18:01:08 -07:00
Tal
3ea691e70a
Merge pull request #1216 from Codium-ai/tr/azure_parsing
fix: improve Azure DevOps PR URL parsing and add unit tests
2024-09-12 09:09:24 +03:00
mrT23
01ba6fe63d
feat: enhance error handling and logging, update AI metadata terminology
- Improved error handling and logging in `pr_processing.py` and `github_polling.py` to provide more detailed error information.
- Updated AI metadata terminology from "AI-generated file summary" to "AI-generated changes summary" across multiple files for consistency.
- Added a placeholder method `publish_file_comments` in `azuredevops_provider.py`.
- Refined logging messages in `azuredevops_provider.py` for better clarity.
2024-09-10 17:44:26 +03:00
mrT23
e444da8378
fix: improve Azure DevOps PR URL parsing and add unit tests 2024-09-10 08:19:22 +03:00
mrT23
1a9638cf87
bug fix: remove unused get_pr_description method from Azure DevOps provider 2024-09-09 16:25:34 +03:00
mrT23
8706f643ef
enable ai_metadata 2024-09-08 16:26:26 +03:00
mrT23
d01cfe443c
avoid_full_files 2024-09-07 11:44:24 +03:00
Tal
d4d9a7f8b4
Merge pull request #1172 from MaxHoecker/bugfix/bb-2-way-diff-fix
Bugfix/bb 2 way diff fix
2024-09-03 16:24:42 +03:00
mrT23
2c496b9d4e
fix: improve PR patch decoding and clean up Bitbucket provider code
- Add fallback encodings for PR patch decoding to handle non-UTF-8 encodings.
- Update logging messages for better clarity.
- Remove unnecessary blank lines and fix minor formatting issues.
- Ensure full files are retrieved in `get_diff_files` method.
2024-09-01 08:38:26 +03:00
mhoecke1
cf14e45674 further cleaned up code based on feedback 2024-08-30 10:10:39 -04:00
mhoecke1
29c50758bc implementing more feedback, choosing a different Bitbucket diff strategy depending on API version, and expanded unit test cases 2024-08-28 17:13:36 -04:00
mhoecke1
0442cdcd3d adding config value for old Bitbucket Server diff functionality 2024-08-26 16:07:21 -04:00
mhoecke1
a99ebf8953 implementing PR bot feedback 2024-08-23 11:18:42 -04:00
mhoecke1
2a9e3ee1ef removing unnecessary if check 2024-08-23 10:57:58 -04:00
mhoecke1
2beefab89a BB server 2 way diff fixes 2024-08-23 10:47:27 -04:00
mrT23
229d7b34c7
Limit comment body length and adjust logging levels in GitHub provider 2024-08-18 08:24:27 +03:00
mrT23
a6f772c6d5
Refactor comment deletion method to 'remove_comment' in git providers and update references 2024-08-18 08:19:25 +03:00
mrT23
4a71ec90c6
Add null check for 'suggestion' in publish_code_suggestions method in gitlab_provider.py 2024-08-16 09:04:45 +03:00
mrT23
3456c8e039
Add 'original_suggestion' parameter to publish_inline_comment methods across git providers for enhanced inline comment handling 2024-08-16 08:58:51 +03:00
Tal
01c18d7d98
Merge pull request #1134 from Codium-ai/tr/err_protections
Tr/err protections
2024-08-14 08:17:19 +03:00
mrT23
8414e109c5
Update logging levels and add error handling for empty data in PR tools and providers 2024-08-14 08:02:34 +03:00
mrT23
8adfca5b3c
Add error handling for short diffs and improve logging in Bitbucket provider 2024-08-14 07:54:11 +03:00
Tal
672cdc03ab
Merge pull request #1133 from Codium-ai/tr/err_protections
Add error handling for empty diff files in utils.py and optimize file…
2024-08-13 22:36:00 +03:00
mrT23
86a9cfedc8
Add error handling for empty diff files in utils.py and optimize file content retrieval in Bitbucket provider 2024-08-13 22:33:07 +03:00
Tal
7ac9f27b70
Merge pull request #1132 from Codium-ai/tr/err_protections
Add error handling for missing GitLab URL and improve inline comment …
2024-08-13 19:05:00 +03:00
mrT23
a3b3d6c77a
Add error handling for missing GitLab URL and improve inline comment logic in gitlab_provider.py 2024-08-13 19:00:09 +03:00
Stephen Quinn
2e41701d07 fixes 2024-08-13 16:21:46 +01:00
Stephen Quinn
578f56148a
Merge branch 'Codium-ai:main' into main 2024-08-13 16:04:55 +01:00
mrT23
a2fb415c53
Add git_files attribute to Bitbucket provider class for enhanced file handling 2024-08-13 12:39:45 +03:00
mrT23
1aa6dd9b5d
Add error handling for missing file paths in Bitbucket provider and improve file validation logic 2024-08-13 11:28:21 +03:00
Stephen Quinn
11d69e05aa fix git provider 2024-08-13 09:25:59 +01:00
mrT23
5252e1826d
Add handling for empty diffs in Bitbucket provider to avoid logging errors 2024-08-13 09:45:45 +03:00
mrT23
396d11aa45
Improve logging and diff filtering in Bitbucket provider
- Enhance logging to include both kept and filtered file names
- Add conditional check to filter diff elements based on original and current diffs
2024-08-13 08:59:45 +03:00
mrT23
8589941ffe
Improve Bitbucket diff handling for new and deleted files and add error protection for missing file links 2024-08-12 21:15:26 +03:00
Tal
4228f92e7e
Merge pull request #1119 from Codium-ai/hl/limit_long_comments
Hl/limit long comments
2024-08-12 16:25:42 +03:00
Hussam.lawen
9c1ab06491
fix long comments 2024-08-12 12:27:09 +03:00
mrT23
5c4bc0a008
Add Bitbucket diff handling and improve error logging
- Implement `publish_file_comments` method placeholder
- Enhance `is_supported` method to include `publish_file_comments`
- Refactor diff splitting logic to handle Bitbucket-specific headers
- Improve error handling and logging for file content retrieval
- Add `get_pr_owner_id` method to retrieve PR owner ID
- Update `_get_pr_file_content` to fetch file content from remote link
- Fix variable name typo in `extend_patch` function in `git_patch_processing.py`
2024-08-12 09:48:26 +03:00
mrT23
7438190ed1
set_claude_model 2024-08-11 11:43:57 +03:00
mrT23
8a75d3101d
Enhance PR description handling and improve logging for invalid file extensions in Bitbucket provider 2024-08-07 16:32:36 +03:00
KennyDizi
aef9a04b32 Fix use requests HTTPError 2024-08-02 07:58:23 +07:00
KennyDizi
fe4e642a47 Removed unused json import 2024-08-02 07:57:09 +07:00
Tal
23ec25c949
Merge pull request #1079 from MarkRx/feature/bitbucket-server-multi-line-suggestion-workaround
Use code blocks instead of suggestion blocks for Bitbucket Server multi-line suggestions
2024-08-01 09:29:18 +03:00
MarkRx
288e9bb8ca Fix Bitbucket Server 401 unauthorized when posting inline coments; fix Bitbucket loading .pr_agent.toml 2024-07-30 16:19:57 -04:00
MarkRx
95f23de7ec Use code blocks instead of suggestion blocks for Bitbucket Server multi-line suggestions to workaround BSERV-4553 2024-07-30 10:43:56 -04:00
Tal
3a77652660
Merge pull request #1061 from MarkRx/feature/bitbucket-server-get-line-link
Implement BitbucketServerProvider.get_line_link
2024-07-27 16:04:09 +03:00
MarkRx
81d07a55d7 Implement BitbucketServerProvider.get_line_link 2024-07-26 12:34:12 -04:00