-
Notifications
You must be signed in to change notification settings - Fork 633
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
Enhancement: Automatic Tool Configuration for Bitbucket App #519
Conversation
…_app.py and configuration.toml, update Usage.md
/describe |
PR Description updated to latest commit (81da328) |
PR Analysis
PR Feedback
How to useInstructions
|
PR Code Suggestions💡 Suggestion: Refactor the code to reduce the complexity and improve readability by extracting the logic of applying automatic tools into a separate function. File: pr_agent/servers/bitbucket_app.py (97-108) Example code:Existing code: if pr_url:
with get_logger().contextualize(**log_context):
apply_repo_settings(pr_url)
auto_review = get_setting_or_env("BITBUCKET_APP.AUTO_REVIEW", None)
if auto_review is None or is_true(auto_review): # by default, auto review is enabled
await PRReviewer(pr_url).run()
auto_describe = get_setting_or_env("BITBUCKET_APP.AUTO_DESCRIBE", None)
if is_true(auto_describe): # by default, auto describe is disabled
await PRDescription(pr_url).run()
auto_improve = get_setting_or_env("BITBUCKET_APP.AUTO_IMPROVE", None)
if is_true(auto_improve): # by default, auto improve is disabled
await PRCodeSuggestions(pr_url).run() Improved code: if pr_url:
with get_logger().contextualize(**log_context):
apply_repo_settings(pr_url)
await apply_auto_tools(pr_url)
async def apply_auto_tools(pr_url):
auto_review = get_setting_or_env("BITBUCKET_APP.AUTO_REVIEW", None)
if auto_review is None or is_true(auto_review): # by default, auto review is enabled
await PRReviewer(pr_url).run()
auto_describe = get_setting_or_env("BITBUCKET_APP.AUTO_DESCRIBE", None)
if is_true(auto_describe): # by default, auto describe is disabled
await PRDescription(pr_url).run()
auto_improve = get_setting_or_env("BITBUCKET_APP.AUTO_IMPROVE", None)
if is_true(auto_improve): # by default, auto improve is disabled
await PRCodeSuggestions(pr_url).run() |
Enhancement: Automatic Tool Configuration for Bitbucket App
Type
Enhancement
Description
This PR introduces automatic tool configuration for the Bitbucket app. The main changes include:
bitbucket_app.py
to enable or disable automatic tools when a new PR is opened.Usage.md
to include instructions on how to set up automatic tools for Bitbucket Self-Hosted App.configuration.toml
.PR changes walkthrough
1 files
bitbucket_app.py
pr_agent/servers/bitbucket_app.py
The file has been updated to include automatic tool
configuration. This allows for automatic running of tools
such as PRReviewer, PRDescription, and PRCodeSuggestions
when a new PR is opened, based on the settings defined in
the configuration file.
1 files
Usage.md
Usage.md
Instructions on how to set up automatic tools for Bitbucket
Self-Hosted App have been added. This includes setting
environment variables for `auto_review`, `auto_describe`,
and `auto_improve` in the `.pr_agent.toml` file.
1 files
configuration.toml
pr_agent/settings/configuration.toml
Optional settings for automatic tools have been added. These
settings (`auto_review`, `auto_describe`, `auto_improve`)
can be uncommented and set in the `.pr_agent.toml` file to
enable or disable automatic tools when a new PR is opened.