Commit graph

330 commits

Author SHA1 Message Date
Hussam.lawen
fff52e9e26
Add ask line feature 2024-02-15 14:25:22 +02:00
mrT23
d2ad8b1dbd
Refactor publish_persistent_comment method to include name parameter 2024-02-15 08:45:17 +02:00
yochail
9ff62dce08
Add legacy url support 2024-02-12 18:40:06 -05:00
Yochai Lehman
076d8e7187 fix PR code suggestions 2024-02-11 17:17:25 -05:00
Yochai Lehman
22d0c275d7 fix PR comments 2024-02-11 17:13:59 -05:00
Yochai Lehman
9a54be5414 add webhook support 2024-02-11 16:52:49 -05:00
Tal
ec2aab805d
Merge pull request #650 from yochail/yocail/support_azure_inline_comment
Support Azure Inline Comment
2024-02-11 10:54:10 -08:00
yochail
47060ddcac
fix PR comments
- added line position
- added try-catch per comment
2024-02-11 12:40:36 -05:00
Hussam.lawen
0e08520c0c
match pr-pro 2024-02-11 13:21:59 +02:00
Hussam.lawen
73d2b1565d
Implement edit comment 2024-02-11 12:31:30 +02:00
Hussam.lawen
a40643bbba
add return response 2024-02-11 12:20:06 +02:00
yochail
ba854c228b
Update azuredevops_provider.py 2024-02-10 22:36:01 -05:00
yochail
d8ea2731ea add support for azure inline commnets 2024-02-11 03:27:47 +00:00
mrT23
555151602f
rstrip() 2024-02-09 11:26:43 +02:00
mrT23
f74b35fb6f
Merge remote-tracking branch 'origin/main' into hl/pr_review_table 2024-02-09 11:05:13 +02:00
mrT23
f8e1bd3d4c
get_pr_url 2024-02-09 11:02:23 +02:00
mrT23
fa077dc516
formatting 2024-02-08 18:55:58 +02:00
mrT23
b190b1879e
auto approval 2024-02-06 09:09:07 +02:00
mrT23
2ee329674f
insert_br_after_x_chars 2024-02-05 09:20:36 +02:00
Tal
2430a1a608
Merge pull request #594 from Codium-ai/tr/fallback_bad_review_comment
Enhanced Comment Verification and Fallback Mechanism for Inline Comment Publishing
2024-01-20 02:04:06 -08:00
mrT23
e54388d807
s 2024-01-20 11:59:45 +02:00
mrT23
d942bdb8bd
s 2024-01-20 11:56:17 +02:00
Sagi Medina
d7858efbbe
Merge pull request #581 from Codium-ai/sm/azure_devops
Enhancement of AzureDevopsProvider with new functionalities and refactoring
2024-01-18 16:28:28 +02:00
mrT23
9f5c2e5f17
feat: Refactor comment verification in github_provider.py 2024-01-14 11:55:07 +02:00
mrT23
7377f4e4b2
feat: Refactor comment verification in github_provider.py 2024-01-14 11:49:51 +02:00
mrT23
d6f4c1638d
feat: Refactor comment verification in github_provider.py 2024-01-14 10:49:05 +02:00
zmeir
b9951fce62 Typo when parsing the suggestion part 2024-01-10 11:59:45 +02:00
zmeir
19c14b940e Try fixing invalid inline comments 2024-01-09 09:54:29 +02:00
samanhappy
36f1cfb51f Enhancement: Update GitLab link generation to support self-managed GitLab server and different projects 2024-01-09 15:11:27 +08:00
zmeir
28c5ad1d8b nit 2024-01-08 13:06:03 +02:00
zmeir
2bb5ae8c0d Remove redundant condition (status 422 already means the same) 2024-01-08 13:05:10 +02:00
zmeir
b0bffdec84 Refactor and add configuration toggle 2024-01-08 12:00:20 +02:00
mrT23
46a38473e4
Merge remote-tracking branch 'origin/main' into tr/unique_titles 2024-01-08 10:30:58 +02:00
mrT23
c9e55be275
s 2024-01-08 10:30:47 +02:00
mrT23
8bb2eb48af
s 2024-01-08 09:43:34 +02:00
mrT23
9cfb8ce475
s 2024-01-08 09:39:19 +02:00
Sagi Medina
b776e5069c
feat: Refactor AzureDevopsProvider class in azuredevops_provider.py
- Reorder class methods and constructor for better readability
- Add error logging for failed operations
- Implement get_pr_description_full method
- Update get_pr_description method to always return full description
- Modify _parse_pr_url method to return workspace_slug, repo_slug, and pr_number
- Make _get_azure_devops_client a static method
- Add error handling in get_pr_id method
2024-01-08 09:15:34 +02:00
Sagi Medina
c8bca487e5
feat: Implement methods in AzureDevopsProvider for publishing code suggestions, labels, and removing comments 2024-01-08 08:59:12 +02:00
mrT23
3ea08a6cf5
feat: Add debug logs to git_provider and pr_description modules 2024-01-07 19:57:49 +02:00
mrT23
3154ebbf9f
feat: Add debug logs to git_provider and pr_description modules 2024-01-07 19:56:05 +02:00
zmeir
22d17985a1 Less noisy fallback for publish_code_suggestions in case of invalid comments
As a first option, `publish_code_suggestions` will try to post all review comments in a single GitHub review. This is preferred because it will group all comments together in the GitHub UI under the same review, and will trigger just one notification for any viewers of the PR.

If just one of the comments is malformed, the entire API request will fail and none of the comments will be posted to the PR. In the current implementation, the fallback mechanism is to just post each comment separately with `try/except` and skip the invalid comments. This works, but potentially creates a lot of noise in the PR as each comment is posted as in a separate review, creating multiple notifications.

This suggested fallback is based on a similar idea, but without creating multiple review notifications. The it works is by iterating over the potential comments, and starting a PENDING review for the current comment. The review is not submitted and does not trigger a notification, but it is verified against the GitHub API, and so we can verify if the comment is valid. After checking all comments we then submit a single review with all the verified comments which is guaranteed to succeed.

The end result is having the exact same comments posted to the PR as with the current fallback method, but the downside is having twice as many API calls (for each comment we have 1 extra API call to delete the pending review).
2024-01-07 16:00:44 +02:00
mrT23
6d18a0c843
feat: Improve user description extraction in git_provider.py 2024-01-04 18:34:00 +02:00
mrT23
7762bf59bf
feat: Update user description extraction and placement in PR description 2024-01-04 18:01:55 +02:00
Zohar Meir
8d2da74380
Find user description in a case-insensitive way 2024-01-04 09:41:55 +02:00
zmeir
560d30dbb1 Fix get_user_description
The headers changed from "PR Type"/"PR Description"/etc to "Type"/"Description"/etc
2024-01-03 12:20:51 +02:00
mrT23
663632e2d9
fixed bug 2023-12-24 10:27:48 +02:00
mrT23
5c49ff216a
feat: Update inline comment creation in git providers and improve code suggestion handling
- Update `create_inline_comment` method in various git providers to include `absolute_position` parameter
- Remove `create_inline_comment` method from providers that do not support inline comments
- Enhance `find_line_number_of_relevant_line_in_file` function to handle absolute position
- Modify `pr_code_suggestions.py` to handle improved code inclusion in suggestions
- Add `include_improved_code` configuration option in `configuration.toml` and update documentation accordingly
2023-12-24 09:44:08 +02:00
Hussam.lawen
89c30ab5dc
feat: Add repository labels retrieval function in gitlab_provider.py 2023-12-13 17:21:58 +02:00
Hussam.lawen
fdc776887d
Refactor labels 2023-12-11 16:47:38 +02:00
mrT23
02c0c89b13
feat: Add exception handling for discussion creation in gitlab_provider.py 2023-12-11 08:29:09 +02:00
mrT23
429aed04b1
s 2023-12-06 16:32:53 +02:00
mrT23
eeb20b055a
feat: Add line count to file patch info and enhance PR description formatting 2023-12-06 15:29:45 +02:00
mrT23
cf3401536a
feat: Remove 'Refactoring' label from custom labels and update related descriptions 2023-12-05 07:48:21 +02:00
mrT23
21a7a0f136
feat: Enhance link generation for relevant lines and refactor code in git providers and PR description tools 2023-12-04 21:06:56 +02:00
mrT23
37812dfede
feat: Update pr_url assignment in github_provider.py for GitHub Actions compatibility 2023-12-03 11:34:17 +02:00
mrT23
586785ffde
feat: Add pr_url attribute to git providers and final update message in PR description 2023-12-03 10:46:02 +02:00
mrT23
c22084c7ac
feat: Add exception handling for missing previous review in github_provider.py 2023-12-01 11:56:03 +02:00
mrT23
51e1278cd7
feat: Enhance inline comment publishing in Bitbucket provider and add logging for no suggestions in pr_code_suggestions.py 2023-11-28 18:29:35 +02:00
mrT23
b1c374808d
feat: Add line link generation in Bitbucket provider and improve markdown formatting in pr_code_suggestions.py and IMRPOVE.md 2023-11-26 17:12:02 +02:00
mrT23
5cbbaf44c9
feat: Add line link generation for GitLab and improve markdown formatting in pr_code_suggestions.py 2023-11-26 13:42:57 +02:00
mrT23
f96d4924e7
feat: Add line link generation in git providers and refactor code suggestions generation 2023-11-26 11:57:45 +02:00
mrT23
d8ae32fc55
language_extension_map 2023-11-26 08:52:55 +02:00
mrT23
9465b7b577
refactor: Move clip_tokens function from pr_processing to utils module, and add tests 2023-11-26 08:29:47 +02:00
mrT23
b3238e90f2
s 2023-11-26 08:10:01 +02:00
mrT23
46d4d04e94
Merge pull request #455 from lukefx/bitbucket-server
Added BitBucket Server and Data Center support
2023-11-25 21:33:26 -08:00
Luca Simone
0f6564f42d feat: Added server and documentation 2023-11-25 17:37:44 +01:00
Ori Kotek
613ccb4c34
Add support for base_url in GitHub SDK 2023-11-21 16:48:36 +02:00
Luca Simone
b62e0967d5 fix: Revert back to exception since context.get will not throw KeyError 2023-11-17 10:08:40 +01:00
Luca Simone
26dc2e9d21
fix: raising exception instead of empty string
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-16 11:19:46 +01:00
Luca Simone
d78a71184d
fix: Use checked exception KeyError for missing key
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-16 10:59:01 +01:00
Luca Simone
eae30c32a2
fix: Use checked exception for ValueError
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-16 10:58:35 +01:00
Luca Simone
3fae5cbd8d feat: Added BitBucket Server
Signed-off-by: Luca Simone <info@lucasimone.info>
2023-11-15 15:47:44 +01:00
mrT23
c4899a6c54
bitbucket 2023-11-15 12:11:02 +02:00
mrT23
24d82e65cb
gitlab 2023-11-15 09:45:10 +02:00
mrT23
2567a6cf27
gitlab 2023-11-15 09:40:45 +02:00
mrT23
94cb6b9795
more feedback 2023-11-15 09:06:26 +02:00
Zohar Meir
7d89b82967
Fix get_user_description in case pr_description.enable_pr_type=false
Fixes an issue when getting the user description after a PR-Agent description was already generated, in case the configuration setting `pr_description.enable_pr_type` was `false`.
2023-11-13 14:41:14 +02:00
mrT23
737792d83c
publish_persistent_comment 2023-11-09 15:24:55 +02:00
mrT23
7e5889061c
publish_persistent_comment 2023-11-09 15:20:31 +02:00
mrT23
755e04cf65
bitbucket finally works 2023-11-08 20:41:55 +02:00
mrT23
44d6c95714
response 2023-11-08 20:38:18 +02:00
mrT23
14610d5375
persistent
s
2023-11-08 20:16:08 +02:00
mrT23
a1e32d8331
s 2023-11-08 14:36:59 +02:00
mrT23
0293412a42
s 2023-11-08 14:31:08 +02:00
mrT23
10ec0a1812
s 2023-11-08 14:21:03 +02:00
mrT23
69b68b78f5
s 2023-11-08 14:17:59 +02:00
mrT23
39e5102a2e
fix added files 2023-11-08 12:47:18 +02:00
mrT23
4c484f8e86
Merge pull request #423 from zmeir/zmeir-external-incremental_review_thresholds
Implementing Thresholds for Incremental PR Reviews
2023-11-06 01:07:01 -08:00
mrT23
e37daf6987
link to change 2023-11-06 08:27:34 +02:00
mrT23
8fc663911f
fixe bitbucket get_repo_settings bug 2023-11-06 08:15:43 +02:00
Ori Kotek
fe3527de3c
Add exception handling for applying repo settings failure 2023-11-03 12:23:49 +02:00
Ori Kotek
c0b3c76884
Merge remote-tracking branch 'origin/main' into ok/bitbucket_fix 2023-11-02 15:27:11 +02:00
Ori Kotek
e1370a8385
Update publish_inline_comments in bitbucket_provider.py to use 'position' instead of 'start_line' 2023-11-02 15:24:47 +02:00
zmeir
c623c3baf4 Added new configurations to prevent too frequent incremental commits on push trigger 2023-11-02 12:24:54 +02:00
Zohar Meir
15573e2286
Fix error in get_main_pr_languages when the diff is empty
This can happen for example when you have one commit add a line to a file and the next commit deletes that line. Then if those are the only 2 commits in the PR the diff will be empty.
2023-11-02 10:10:54 +02:00
Ori Kotek
73bb70fef4
Update get_repo_settings in bitbucket_provider.py to fetch file via API request 2023-10-30 18:36:46 +02:00
Ori Kotek
4bda9dfe04
Update get_repo_settings to decode file from target branch in gitlab_provider.py 2023-10-30 17:01:49 +02:00
Ori Kotek
e74bb80668
Refactor get_repo_settings method in gitlab_provider.py to decode file contents 2023-10-30 16:45:47 +02:00
Ori Kotek
61d3e1ebf4
Merge pull request #394 from zmeir/zmeir-external-push_trigger
Added support for automatic review on push event
2023-10-29 13:04:33 +02:00
mrT23
638db96311
github action now also uses .pr_agent.toml 2023-10-28 13:34:32 +03:00