Skip to content
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

wiki #729

Merged
merged 3 commits into from
Mar 2, 2024
Merged

wiki #729

merged 3 commits into from
Mar 2, 2024

Conversation

mrT23
Copy link
Collaborator

@mrT23 mrT23 commented Feb 29, 2024

aaa

@codiumai-pr-agent-pro codiumai-pr-agent-pro bot added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 29, 2024
Copy link
Contributor

PR Description updated to latest commit (384101d)

Copy link
Contributor

codiumai-pr-agent-pro bot commented Feb 29, 2024

Old

⏱️ Estimated effort to review [1-5]

2, because the changes are primarily documentation updates, introducing a new configuration method via a wiki page and reorganizing existing content. The complexity is low, and the changes are straightforward to review.

🧪 Relevant tests

No

🔍 Possible issues

The README.md update includes a date "Feb 29, 2024" which is not a valid date since 2024 is not a leap year. This might confuse users or be a typo.

The Usage.md file introduces a new configuration method via wiki pages. It's important to ensure that access control and edit history are considered to prevent unauthorized changes.

🔒 Security concerns

No, the changes are related to documentation and do not introduce any direct security concerns. However, it's important to consider the security implications of allowing configuration through wiki pages, as mentioned in the possible issues.


✨ Review tool usage guide:

Overview:
The review tool scans the PR code changes, and generates a PR review. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:

/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...

With a configuration file, use the following template:

[pr_reviewer]
some_config1=...
some_config2=...
Utilizing extra instructions

The review tool can be configured with extra instructions, which can be used to guide the model to a feedback tailored to the needs of your project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify the relevant sub-tool, and the relevant aspects of the PR that you want to emphasize.

Examples for extra instructions:

[pr_reviewer] # /review #
extra_instructions="""
In the 'possible issues' section, emphasize the following:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

How to enable\disable automation
  • When you first install PR-Agent app, the default mode for the review tool is:
pr_commands = ["/review", ...]

meaning the review tool will run automatically on every PR, with the default configuration.
Edit this field to enable/disable the tool, or to change the used configurations

Auto-labels

The review tool can auto-generate two specific types of labels for a PR:

  • a possible security issue label, that detects possible security issues (enable_review_labels_security flag)
  • a Review effort [1-5]: x label, where x is the estimated effort to review the PR (enable_review_labels_effort flag)
Extra sub-tools

The review tool provides a collection of possible feedbacks about a PR.
It is recommended to review the possible options, and choose the ones relevant for your use case.
Some of the feature that are disabled by default are quite useful, and should be considered for enabling. For example:
require_score_review, require_soc2_ticket, and more.

Auto-approve PRs

By invoking:

/review auto_approve

The tool will automatically approve the PR, and add a comment with the approval.

To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set in a pre-defined configuration file the following:

[pr_reviewer]
enable_auto_approval = true

(this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository)

You can also enable auto-approval only if the PR meets certain requirements, such as that the estimated_review_effort is equal or below a certain threshold, by adjusting the flag:

[pr_reviewer]
maximal_review_effort = 5
More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the review usage page for a comprehensive guide on using this tool.

Copy link
Contributor

codiumai-pr-agent-pro bot commented Feb 29, 2024

PR Code Suggestions

CategorySuggestions                                                                                                                                                       
Enhancement
Add descriptions for each new section in the Table of Contents for better clarity.

Consider adding a brief description or summary for each new section added to the Table of
Contents. This helps readers understand what each section covers without having to
navigate to it.

Usage.md [5-18]

-- [Configuration](#configuration)
-- [Ignoring files from analysis](#ignoring-files-from-analysis)
-- [Extra instructions](#extra_instructions)
-- [Working with large PRs](#working-with-large-prs)
-- [Changing a model](#changing-a-model)
-- [Patch Extra Lines](#patch-extra-lines)
+- [Configuration](#configuration) - Learn how to configure PR-Agent for your projects.
+- [Ignoring files from analysis](#ignoring-files-from-analysis) - Instructions on how to exclude files from PR-Agent's analysis.
+- [Extra instructions](#extra_instructions) - How to add additional instructions for PR-Agent.
+- [Working with large PRs](#working-with-large-prs) - Tips for handling large pull requests.
+- [Changing a model](#changing-a-model) - Guide on switching between different PR-Agent models.
+- [Patch Extra Lines](#patch-extra-lines) - Adjusting PR-Agent to handle extra lines in patches.
 
Provide examples for common use cases in the section on ignoring files from analysis.

For the section on ignoring files from analysis, consider adding examples or templates for
common use cases, such as ignoring all files in a directory or specific file types, to
help users quickly adapt the configuration for their needs.

Usage.md [356]

-To ignore files or directories, edit the **[ignore.toml](/pr_agent/settings/ignore.toml)** configuration file.
+To ignore files or directories, edit the **[ignore.toml](/pr_agent/settings/ignore.toml)** configuration file. For example, to ignore all files in the `vendor/` directory, add `glob = ['vendor/**']` to your `ignore.toml`.
 
Suggest adding a visual representation of configuration precedence for clarity.

When introducing the concept of configuration precedence, it might be helpful to include a
diagram or flowchart that visually represents how configurations are overridden. This can
make it easier for users to understand the hierarchy at a glance.

Usage.md [51]

-In terms of precedence, wiki configurations will override local configurations, and local configurations will override global configurations.
+In terms of precedence, wiki configurations will override local configurations, and local configurations will override global configurations. Consider adding a visual representation (e.g., a flowchart) to clearly illustrate this hierarchy.
 
Maintainability
Use consistent formatting and descriptions for links to configuration files and guides.

To maintain consistency and readability, consider using a consistent format for linking to
configuration files and guides. For example, always use relative links and provide a brief
description of what the link leads to.

Usage.md [41-44]

-The different tools and sub-tools used by CodiumAI PR-Agent are adjustable via the **[configuration file](pr_agent/settings/configuration.toml)**.
-The [Tools Guide](./docs/TOOLS_GUIDE.md) provides a detailed description of the different tools and their configurations.
+Configure PR-Agent using the **[configuration file](pr_agent/settings/configuration.toml)**, which allows for customization of tools and sub-tools.
+For a detailed description of the different tools and their configurations, see the [Tools Guide](./docs/TOOLS_GUIDE.md).
 
Best practice
Add security considerations for new configuration methods.

When introducing new configuration methods, such as the Wiki configuration file, it's
beneficial to explain the security implications or considerations, especially since
configurations might contain sensitive data.

Usage.md [57]

-You can set configurations by creating a page called `.pr_agent.toml` in the wiki of the repo.
+You can set configurations by creating a page called `.pr_agent.toml` in the wiki of the repo. Ensure to review the security settings of your wiki to prevent unauthorized access to sensitive configuration details.
 

✨ Improve tool usage guide:

Overview:
The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.
When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:

/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...

With a configuration file, use the following template:

[pr_code_suggestions]
some_config1=...
some_config2=...
Enabling\disabling automation

When you first install the app, the default mode for the improve tool is:

pr_commands = ["/improve --pr_code_suggestions.summarize=true", ...]

meaning the improve tool will run automatically on every PR, with summarization enabled. Delete this line to disable the tool from running automatically.

Utilizing extra instructions

Extra instructions are very important for the improve tool, since they enable to guide the model to suggestions that are more relevant to the specific needs of the project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify relevant aspects that you want the model to focus on.

Examples for extra instructions:

[pr_code_suggestions] # /improve #
extra_instructions="""
Emphasize the following aspects:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

A note on code suggestions quality
  • While the current AI for code is getting better and better (GPT-4), it's not flawless. Not all the suggestions will be perfect, and a user should not accept all of them automatically.
  • Suggestions are not meant to be simplistic. Instead, they aim to give deep feedback and raise questions, ideas and thoughts to the user, who can then use his judgment, experience, and understanding of the code base.
  • Recommended to use the 'extra_instructions' field to guide the model to suggestions that are more relevant to the specific needs of the project, or use the custom suggestions 💎 tool
  • With large PRs, best quality will be obtained by using 'improve --extended' mode.
More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the improve usage page for a more comprehensive guide on using this tool.

@mrT23
Copy link
Collaborator Author

mrT23 commented Mar 1, 2024

PR Review

(Review updated until commit 2b94651)

⏱️ Estimated effort to review [1-5]

2, because the PR mainly involves documentation updates and a minor configuration change. The documentation changes are straightforward and mostly involve adding new sections and instructions. The configuration change is simple and only adds a new boolean flag.

🧪 Relevant tests

No

🔍 Possible issues

Image accessibility: The new README.md includes an image hosted on an external server, which might not be accessible in all environments or could potentially lead to broken images if the URL changes or the server goes down.

🔒 Security concerns

No

Code feedback:
relevant fileREADME.md
suggestion      

Consider hosting the image (wiki_configuration.png) used in the README.md on a more reliable platform like GitHub itself to ensure it remains accessible and to avoid potential broken links in the future. You can upload images directly to the repository or use GitHub's user content domain to host images for README files. [important]

relevant line

relevant filepr_agent/settings/configuration.toml
suggestion      

Ensure that the new use_wiki_settings_file configuration option is properly documented in the project's configuration documentation. This helps users understand its purpose and how it affects the precedence of configuration settings. [important]

relevant lineuse_wiki_settings_file=true

relevant fileUsage.md
suggestion      

For the wiki configuration instructions, recommend specifying the exact location or format of the .pr_agent.toml wiki page. This could help users unfamiliar with GitHub wikis to correctly set up their configuration without confusion. [medium]

relevant lineYou can set configurations by creating a page called `.pr_agent.toml` in the wiki of the repo.

relevant fileUsage.md
suggestion      

Consider adding a troubleshooting section or FAQ regarding the new configuration methods, especially for common issues users might face when setting up or using the wiki configuration page. This could improve user experience and reduce the number of support requests. [medium]

relevant lineIn terms of precedence, wiki configurations will override local configurations, and local configurations will override global configurations.


✨ Review tool usage guide:

Overview:
The review tool scans the PR code changes, and generates a PR review. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:

/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...

With a configuration file, use the following template:

[pr_reviewer]
some_config1=...
some_config2=...
Utilizing extra instructions

The review tool can be configured with extra instructions, which can be used to guide the model to a feedback tailored to the needs of your project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify the relevant sub-tool, and the relevant aspects of the PR that you want to emphasize.

Examples for extra instructions:

[pr_reviewer] # /review #
extra_instructions="""
In the 'possible issues' section, emphasize the following:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

How to enable\disable automation
  • When you first install PR-Agent app, the default mode for the review tool is:
pr_commands = ["/review", ...]

meaning the review tool will run automatically on every PR, with the default configuration.
Edit this field to enable/disable the tool, or to change the used configurations

Auto-labels

The review tool can auto-generate two specific types of labels for a PR:

  • a possible security issue label, that detects possible security issues (enable_review_labels_security flag)
  • a Review effort [1-5]: x label, where x is the estimated effort to review the PR (enable_review_labels_effort flag)
Extra sub-tools

The review tool provides a collection of possible feedbacks about a PR.
It is recommended to review the possible options, and choose the ones relevant for your use case.
Some of the feature that are disabled by default are quite useful, and should be considered for enabling. For example:
require_score_review, require_soc2_ticket, and more.

Auto-approve PRs

By invoking:

/review auto_approve

The tool will automatically approve the PR, and add a comment with the approval.

To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set in a pre-defined configuration file the following:

[pr_reviewer]
enable_auto_approval = true

(this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository)

You can also enable auto-approval only if the PR meets certain requirements, such as that the estimated_review_effort is equal or below a certain threshold, by adjusting the flag:

[pr_reviewer]
maximal_review_effort = 5
More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the review usage page for a comprehensive guide on using this tool.

@mrT23
Copy link
Collaborator Author

mrT23 commented Mar 1, 2024

Persistent review updated to latest commit 2b94651

@mrT23
Copy link
Collaborator Author

mrT23 commented Mar 2, 2024

/review auto_approve

Copy link
Contributor

Auto-approved PR

@mrT23 mrT23 merged commit 9a02882 into main Mar 2, 2024
1 check passed
@mrT23 mrT23 deleted the tr/wiki branch March 2, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request Review effort [1-5]: 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants