Commit graph

677 commits

Author SHA1 Message Date
Hussam.lawen
94a2a5e527
generate labels keep user labels only 2023-11-06 15:07:06 +02:00
Hussam.lawen
1eefd3365b
Merge commit 'e352c98ce83bfbd99078f62d8705eb938a6ba5b5' into hl/type_vs_labels 2023-11-06 14:24:33 +02:00
Hussam.lawen
db37ee819a
support git providers with no label support 2023-11-06 14:11:49 +02:00
mrT23
e352c98ce8
Merge pull request #431 from Codium-ai/hl/type_vs_labels
Refactoring PR Labels Handling and Display
2023-11-06 02:10:38 -08:00
Hussam.lawen
e96b03da57
add configuration enable_pr_type 2023-11-06 11:58:26 +02:00
Hussam.lawen
1d2aedf169
Don't Display pr labels in the text 2023-11-06 11:35:22 +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
8a79114ed9
Merge pull request #430 from Codium-ai/tr/fix_prompt
Fix PR Description Prompt and Data Preparation
2023-11-06 01:06:26 -08:00
mrT23
6d6d864417
fix prompt 2023-11-06 09:44:59 +02:00
mrT23
7238c81f0c
fix prompt 2023-11-06 09:41:26 +02:00
mrT23
62412f8cd4
fix prompt 2023-11-06 09:38:39 +02:00
mrT23
5d2bdadb45
fix prompt 2023-11-06 09:33:10 +02:00
mrT23
06d030637c
fix prompt 2023-11-06 09:32:46 +02:00
zmeir
8e3fa3926a Extract incremental review checks to separate method 2023-11-06 09:21:22 +02:00
zmeir
92071fcf1c Stack all incremental parameters 2023-11-06 09:13:04 +02:00
mrT23
fed1c160eb
files walkthrough bullets 2023-11-06 08:43:15 +02: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
Hussam.lawen
3548b88463
type and labels 2023-11-05 15:48:39 +02:00
koid
e6ef123ce5 add middleware when initializing fastapi 2023-11-05 15:38:19 +09:00
Ori Kotek
fe3527de3c
Add exception handling for applying repo settings failure 2023-11-03 12:23:49 +02:00
Ori Kotek
b99c769b53
Merge pull request #415 from zmeir/zmeir-patch-2
Refactor Command Handling for Different Triggers
2023-11-02 18:32:42 +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
Hussam Lawen
3ddc7e79d1
Update pr_reviewer_prompts.toml 2023-11-02 11:45:34 +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
KennyDizi
9fbf89670d Improve expression portion of f-strings 2023-11-01 19:11:52 +07:00
KennyDizi
ad1c51c536 Fix SyntaxError: f-string expression part cannot include a backslash 2023-11-01 19:06:29 +07:00
Hussam Lawen
9ab7ccd20d
Merge pull request #416 from zmeir/patch-1
Fix formatting when last commit message contains _
2023-11-01 13:13:31 +02:00
KennyDizi
29a8cf8357 fix typo for ollama 2023-10-31 20:38:27 +07:00
Zohar Meir
7b6a6c7164
Fix formatting when last commit message contains _ 2023-10-31 10:05:13 +02:00
Zohar Meir
cf4d007737
Fix commands list for push trigger 2023-10-31 00:00:48 +02:00
Ori Kotek
775ccb3f25
Refactor _perform_commands function in github_app.py to improve command handling 2023-10-30 20:14:25 +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
e06fb534d3
Merge remote-tracking branch 'origin/main' into ok/fix_gitlab_bug 2023-10-30 16:34:03 +02:00
Ori Kotek
71a341855e
Add log_context to handle_request calls in gitlab_webhook.py 2023-10-30 16:00:09 +02:00
Zohar Meir
816ddeeb9e
Fix call to _get_previous_review_comment
Hey @mrT23, I thinks there's a problem with moving this line to after `self.git_provider.publish_comment(pr_comment)`.

The reason I originally placed it here is because otherwise, if you run `/review --pr_reviewer.remove_previous_review_comment=true` it will publish your review and then immediately after delete it, because it will look for the previous review comment only after you published your new review - so it will take your new review as the previous one. In order to get the real "previous" review you must collect the comments list before publishing a review, so placing this method call first ensures that.

The method `self._get_previous_review_comment()` is a no-op if `pr_reviewer.remove_previous_review_comment=false` so I see no downside in keeping it before `self.git_provider.publish_comment(pr_comment)`

Additionally, the check for `if previous_review_comment:` is redundant because it's done internally in `self._remove_previous_review_comment`. I thought it looked cleaner without this extra nesting here, but if you think more verbosity is better I'll keep it.
2023-10-30 09:06:51 +02:00
mrT23
c895657310
fixed review 2023-10-29 17:59:46 +02:00
mrT23
e3845283f8
release notes 2023-10-29 14:58:36 +02:00
mrT23
e97a03f522
Merge remote-tracking branch 'origin/main' into tr/final_fixes 2023-10-29 14:38:33 +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
ae375c2ff0
final fixes 2023-10-29 13:01:55 +02:00
mrT23
c27dc436c4
final fixes 2023-10-29 12:29:14 +02:00
mrT23
7374243d0b
enable_custom_labels 2023-10-29 11:40:36 +02:00
mrT23
22c196cb3b
Merge remote-tracking branch 'origin/main' into tr/fix_custom_labels
# Conflicts:
#	pr_agent/git_providers/github_provider.py
2023-10-29 10:58:42 +02:00
mrT23
d772213cfc
fix labels 2023-10-29 08:58:12 +02:00
mrT23
638db96311
github action now also uses .pr_agent.toml 2023-10-28 13:34:32 +03:00
Hussam Lawen
4dffabf397
Merge pull request #396 from Codium-ai/hl/custom_labels
Implement Custom Labels for PRs
2023-10-28 01:37:54 +03:00
Hussam.lawen
6f2bbd3baa
Add documentation 2023-10-28 00:45:59 +03:00
Hussam.lawen
9e41f3780c
disable custom labels by default 2023-10-27 21:22:56 +03:00
Hussam.lawen
f53ec1d0cc
move enable custom labels to custom labels function 2023-10-27 21:12:58 +03:00
Hussam.lawen
a7cb59ca8b
small fix 2023-10-27 08:10:29 +03:00
Hussam.lawen
ca0ea77415
refactor 2023-10-27 07:58:42 +03:00
Hussam.lawen
0cf27e5fee
custom labels disabled by default 2023-10-27 07:54:59 +03:00
Hussam.lawen
f3bdbfc103
Add /generate_labels function + fix issues 2023-10-26 23:28:33 +03:00
Zohar Meir
e6bea76eee
Typo 2023-10-26 17:07:16 +03:00
zmeir
414f2b6767 Fix incremental review if there are no new commits (would have performed a full review instead) 2023-10-26 16:49:55 +03:00
zmeir
6541575a0e Refactor to use pull_request synchronize event 2023-10-26 16:49:54 +03:00
zmeir
02570ea797 Remove previous review comment on push event 2023-10-26 16:46:54 +03:00
Hussam.lawen
16777a5334
Add custom label description 2023-10-25 13:48:27 +03:00
zmeir
65bb70a1dd Added support for automatic review on push event
The new feature can be enabled via the new configuration `github_app.handle_push_event`. To avoid any unwanted side-effects, the current default of this configuration is set to `false`.

The high level flow (assuming the configuration is enabled):
1. receive push event from GitHub
2. extract branch and commits from event
3. find PR url for branch (currently does not support PRs from forks)
4. perform configured commands (e.g. `/describe`, `/review -i`)

The push event flow is guarded by a backlog queue so that multiple push events on the same branch won't trigger multiple duplicate runs of the PR-Agent commands.
Example timeline:
1. push 1 - start handling event
2. push 2 - waiting to be handled while push 1 event is still running
3. push 3 - event is dropped since handling it and handling push 2 is the same, so it is redundant
4. push 1 finished being handled
5. push 2 awakens from wait and continues handling (potentially reviewing the commits of both push 2 and push 3)

All of these options are configurable and can be enabled/disabled as per the user's desire.

Additional minor changes in this PR:
1. Created `DefaultDictWithTimeout` utility class to avoid too much boilerplate code in managing caches for outdated triggers.
2. Guard against running increment review when there are no new commits.
3. Minor styling changes for incremented review text.
2023-10-25 11:15:23 +03:00
Hussam.lawen
1a89c7eadf
refactor + add description options 2023-10-24 22:28:57 +03:00
Hussam.lawen
07617eab5a
add custom labels 2023-10-24 22:06:27 +03:00
Krystal Boozel
f9e4c2b098
Update configuration.toml 2023-10-23 21:34:12 -04:00
Hussam.lawen
fa24413201
Custom Labels 2023-10-23 16:29:33 +03:00
mrT23
b6cabda586
quick fix 2023-10-19 17:24:37 +03:00
mrT23
abbce60f18
Merge remote-tracking branch 'origin/main' 2023-10-19 17:10:30 +03:00
mrT23
5daaaf2c1d
quick fix 2023-10-19 17:10:21 +03:00
mrT23
e8f207691e
Merge pull request #391 from Codium-ai/tr/readme
Update and Enhance DESCRIBE.md Documentation
2023-10-19 02:03:50 -07:00
mrT23
b0dce4ceae
describe 2023-10-19 12:02:12 +03:00
Ori Kotek
fc494296d7
Merge pull request #387 from Codium-ai/ok/json_logging_in_bitbucket
Enhancing Logging in Bitbucket, GitLab, and Google Cloud Storage Secret Provider
2023-10-19 11:59:26 +03:00
Hussam Lawen
1b6fb3ea53
Merge pull request #385 from Codium-ai/hl/fix_add_docs_in_scripts
Add Blacklist for Non-Editable File Extensions in Documentation
2023-10-19 11:21:36 +03:00
mrT23
a2c3db463a
use_bullet_points 2023-10-19 10:45:42 +03:00
mrT23
21a1cc970e
- update readme
- minor prompts change
2023-10-19 09:16:20 +03:00
Ori Kotek
1314898cbf
Enhance logging in bitbucket_app, gitlab_webhook, and google_cloud_storage_secret_provider with JSON format and additional context 2023-10-18 16:44:03 +03:00
Ori Kotek
ff04d459d7
Update Bitbucket Pipeline instructions in INSTALL.md, remove redundant functionality 2023-10-18 15:46:43 +03:00
Hussam Lawen
88ca501c0c
Merge pull request #377 from zmeir/zmeir-review_incremental_detect_header
Get previous incremental review
2023-10-18 00:30:42 +03:00
mrT23
d41fe0cf79
comment 2023-10-17 19:45:04 +03:00
Hussam.lawen
3673924fe9
Add docs editable blacklist of file extensions like sql, yaml... 2023-10-17 18:50:39 +03:00
mrT23
d5c098de73
another protection 2023-10-17 10:21:05 +03:00
mrT23
9f5c0daa8e
protection 2023-10-17 09:43:48 +03:00
Marius Anderie
e6f1e0520a remove azure.com url restriction 2023-10-16 20:38:14 +02:00
Zohar Meir
d8de89ae33
Get previous incremental review
When getting the last commit in `/review -i` consider also the last __incremental__ review, not just the last __full__ review

Full disclosure I'm not really sure the `/review -i` feature work very well - I might be wrong but it seemed like the actual review in fact addressed all the changes in the PR, and not just the ones from the last review (even though it adds a link to the commit of the last review).  
I think the commit list gathered in `/review -i` doesn't propagate the actual list the reviewer uses. Again, I might be wrong, just took a brief glance at it.
2023-10-16 16:37:10 +03:00
Ori Kotek
83e670c5df
Enhance logging context in github_app server with server type 2023-10-16 16:13:09 +03:00
Ori Kotek
c324d88be3
Refactor logging system to use custom logger across the codebase 2023-10-16 14:56:00 +03:00
Ori Kotek
e7258e732b
Refactor repo-specific settings application into a utility function, fix merge bug 2023-10-14 01:39:05 +03:00
mrT23
e2417ebe88
Merge pull request #363 from Codium-ai/tr/pr_suggestions
publish each suggestion seperatly only on gitlab
2023-10-08 17:01:44 +03:00
mrT23
da98fd712f
note 2023-10-08 16:58:22 +03:00
mrT23
e6548f4fe1
simpler solution 2023-10-08 16:57:22 +03:00
mrT23
e66fed2468
Merge pull request #362 from zmeir/zmeir-fix_help_message_for_bot
Fixed help message for bot user
2023-10-08 16:52:18 +03:00
mrT23
1b3fb49f9c
publish each suggestion seperatly only on gitlab 2023-10-08 16:50:25 +03:00
Zohar Meir
8f9f09ecbf
Fixed help message for bot user
This changes the help message to display properly when running a custom deployment of the PR-Agent app (i.e. not via GitHub Actions, and with the setting `github_app.override_deployment_type=false`)
2023-10-08 16:19:11 +03:00
jamesrom
92e9012fb6 Error handling 2023-10-07 09:39:53 +11:00
jamesrom
43dc648b05 Simplify filter 2023-10-06 22:44:29 +11:00
jamesrom
baa0e95227 Code comments for ignore.toml 2023-10-06 21:53:10 +11:00
jamesrom
b27f57d05d Update settings, documentation 2023-10-06 21:03:36 +11:00
mrT23
fd8c90041c
azure 2023-10-06 08:31:31 +03:00