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

Add docs portal #757

Merged
merged 15 commits into from
Mar 10, 2024
Merged

Add docs portal #757

merged 15 commits into from
Mar 10, 2024

Conversation

almog-lv
Copy link
Contributor

@almog-lv almog-lv commented Mar 9, 2024

User description

  • Added all documentation portal files to /docs
  • Removed previous docs files
  • Added docs-ci workflow after every push to main AND change in docs/** path
  • Added GitHub pages settings to pr-agent project
  • Removed all images

Type

enhancement, documentation


Description

  • Updated and expanded documentation for PR-Agent, including installation guides, usage guides, and tool-specific documentation.
  • Added new sections for running PR-Agent with GitHub Actions, setting up a polling server, and using PR-Agent with Azure DevOps.
  • Introduced documentation for new tools such as Similar Code, Custom Suggestions, and CI Feedback.
  • Enhanced the documentation portal with custom CSS, an overview page, and a comprehensive index for easier navigation.

Changes walkthrough

Relevant files
Enhancement
2 files
footer.html
Custom Footer with Social Links and Copyright                       

docs/overrides/partials/footer.html

  • Added custom footer HTML with social media links and copyright
    information for CodiumAI.
  • +100/-0 
    custom.css
    Custom CSS for Documentation Portal Theme                               

    docs/docs/css/custom.css

    • Added custom CSS for the documentation portal theme.
    +98/-0   
    Documentation
    24 files
    github.md
    Update GitHub Actions Documentation and Add Polling Server
    Instructions

    docs/docs/installation/github.md

  • Updated GitHub Actions usage documentation.
  • Added new section for running as a polling server.
  • +25/-238
    index.md
    Documentation Portal Overview and Features Table                 

    docs/docs/index.md

  • Created an overview page for the documentation portal.
  • Added a features table comparing PR-Agent features across different
    git providers.
  • Included example results from PR-Agent tools.
  • Described PR-Agent Pro benefits and why to use PR-Agent.
  • +184/-0 
    automations_and_usage.md
    Comprehensive Guide on PR-Agent Usage and Automation         

    docs/docs/usage-guide/automations_and_usage.md

  • Detailed explanation on how to use PR-Agent locally, online, and
    through automation.
  • Described GitHub App, GitHub Action, GitLab Webhook, BitBucket App,
    and Azure DevOps provider usage.
  • +200/-0 
    additional_configurations.md
    Guide on Additional Configurations for PR-Agent                   

    docs/docs/usage-guide/additional_configurations.md

  • Instructions on ignoring files from analysis and adding extra
    instructions.
  • Guidance on handling large PRs, changing models, and editing prompts.
  • +218/-0 
    describe.md
    Updated Describe Tool Documentation with Configuration and Usage Tips

    docs/docs/tools/describe.md

  • Updated documentation for the Describe tool with configuration options
    and usage tips.
  • Added information on handling custom labels and using markers
    template.
  • +20/-30 
    improve.md
    Improve Tool Documentation Update                                               

    docs/docs/tools/improve.md

  • Detailed explanation of the Improve tool including configuration
    options and usage tips.
  • Discussed the difference between summarized and committable code
    suggestions.
  • +13/-21 
    locally.md
    Local Installation Guide for PR-Agent                                       

    docs/docs/installation/locally.md

  • Instructions for using Docker image and running PR-Agent from source.
  • +84/-0   
    index.md
    Core Abilities and PR Compression Strategy                             

    docs/docs/core-abilities/index.md

  • Explained PR compression strategy and repo language prioritization.
  • Introduced adaptive and token-aware file patch fitting.
  • +23/-13 
    configuration_options.md
    Configuration Options for PR-Agent Tools                                 

    docs/docs/usage-guide/configuration_options.md

    • Described how to configure PR-Agent tools and provided examples.
    +56/-0   
    bitbucket.md
    Bitbucket Installation Guide for PR-Agent                               

    docs/docs/installation/bitbucket.md

  • Instructions for running PR-Agent as a Bitbucket Pipeline and setting
    up a hosted Bitbucket app.
  • +70/-0   
    custom_labels.md
    Guide on Generating and Using Custom Labels with PR-Agent

    docs/docs/tools/custom_labels.md

    • Explained how to generate and use custom labels with PR-Agent.
    +9/-8     
    custom_suggestions.md
    Custom Suggestions Tool Documentation                                       

    docs/docs/tools/custom_suggestions.md

  • Detailed explanation of the Custom Suggestions tool including
    configuration options.
  • +6/-14   
    azure.md
    Azure DevOps Provider Installation Guide for PR-Agent       

    docs/docs/installation/azure.md

  • Provided instructions for using PR-Agent with Azure DevOps provider.
  • +36/-0   
    similar_code.md
    Similar Code Tool Introduction and Usage                                 

    docs/docs/tools/similar_code.md

    • Introduced the Similar Code tool and explained its usage.
    +43/-0   
    index.md
    Index Page for PR-Agent Tools Documentation                           

    docs/docs/tools/index.md

    • Created an index page for PR-Agent tools documentation.
    +20/-0   
    test.md
    Test Tool Documentation Update                                                     

    docs/docs/tools/test.md

  • Updated documentation for the Test tool with configuration options.
  • +7/-7     
    similar_issues.md
    Similar Issue Tool Documentation                                                 

    docs/docs/tools/similar_issues.md

    • Explained the Similar Issue tool and its configuration options.
    +5/-3     
    ci_feedback.md
    CI Feedback Tool Documentation                                                     

    docs/docs/tools/ci_feedback.md

  • Detailed explanation of the CI Feedback tool including configuration
    options.
  • +4/-4     
    introduction.md
    Introduction to PR-Agent Usage                                                     

    docs/docs/usage-guide/introduction.md

  • Introduction to using PR-Agent locally, online, and through
    automation.
  • +18/-0   
    documentation.md
    Add Documentation Tool Documentation Update                           

    docs/docs/tools/documentation.md

  • Updated documentation for the Add Documentation tool with
    configuration options.
  • +7/-7     
    index.md
    Index Page for Usage Guide Documentation                                 

    docs/docs/usage-guide/index.md

    • Created an index page for the usage guide documentation.
    +20/-0   
    ask.md
    Ask Tool Documentation                                                                     

    docs/docs/tools/ask.md

    • Detailed explanation of the Ask tool and its usage.
    +5/-6     
    gitlab.md
    GitLab Webhook Server Installation Guide for PR-Agent       

    docs/docs/installation/gitlab.md

    • Instructions for running PR-Agent with a GitLab webhook server.
    +16/-0   
    README.md
    Installation and Deployment Guide for Documentation Portal

    docs/README.md

  • Instructions for installing and deploying the documentation portal.
  • +15/-0   
    Configuration changes
    1 files
    mkdocs.yml
    MkDocs Configuration for Documentation Portal                       

    docs/mkdocs.yml

  • Configured mkdocs for the documentation portal.
  • Defined site structure and theme settings.
  • +120/-0 

    PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @codiumai-pr-agent-pro codiumai-pr-agent-pro bot added documentation Improvements or additions to documentation enhancement New feature or request Review effort [1-5]: 2 labels Mar 9, 2024
    Copy link
    Contributor

    PR-Agent was enabled for this repository. To use it, please link your git user with your CodiumAI identity here.

    PR Review

    ⏱️ Estimated effort to review [1-5]

    2, because the PR involves a significant amount of documentation updates and new documentation files, which are generally easier to review than code changes. However, the volume of changes and the need to ensure accuracy and clarity in the documentation still requires a careful review.

    🏅 Score

    85

    🧪 Relevant tests

    No

    🔍 Possible issues

    Missing Documentation for New Tools: The PR introduces several new tools (e.g., Similar Code, Custom Suggestions, CI Feedback) but does not include detailed documentation for each tool. It's important to provide users with clear instructions and examples on how to use these new features.

    Inconsistent Formatting: Some of the documentation files have inconsistent formatting, especially in the headings and subheadings. Consistent formatting improves readability and user experience.

    Broken Links: There are potential broken links or placeholders like [here](../usage-guide/automations_and_usage.md#github-app-automatic-tools-when-a-new-pr-is-opened) that need to be verified to ensure they correctly link to the intended pages.

    🔒 Security concerns

    No


    ✨ 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 Mar 9, 2024

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Enhancement
    Use semantic HTML elements for navigation and lists.

    It's recommended to use semantic HTML elements to improve accessibility and SEO. Instead
    of using

    for the footer links and social icons, consider using the element for
    navigation links and
      for the list of social icons. This change enhances the semantic
      meaning of the content and helps screen readers and search engines better understand the
      structure of your page.

      docs/overrides/partials/footer.html [71-95]

      -<div class="footer-links">
      +<nav class="footer-links">
       ...
      -</div>
      -<div class="social-icons">
      +</nav>
      +<ul class="social-icons">
       ...
      -</div>
      +</ul>
       
    Add a meta tag for theme-color to enhance mobile browsing.

    To ensure the website is responsive and accessible on all devices, consider adding a meta
    tag for theme-color. This meta tag specifies the theme color for Chrome, Firefox OS, and
    Opera's UI. It enhances the mobile browsing experience by matching the browser's toolbar
    color to the website's color scheme.

    docs/overrides/partials/footer.html [5]

     <meta name="viewport" content="width=device-width, initial-scale=1.0">
    +<meta name="theme-color" content="#171518">
     
    Specify event types for GitHub Action triggers to improve efficiency.

    Consider specifying the types of pull_request and issue_comment events that your GitHub
    Action should trigger on. This helps in avoiding unnecessary runs and makes the action
    more efficient. For example, you might only want to run the action on opened, reopened,
    and synchronize pull request events, and on created issue comment events.

    docs/docs/installation/github.md [8-11]

     on:
       pull_request:
    +    types: [opened, reopened, synchronize]
       issue_comment:
    +    types: [created]
     
    Explain or link to an explanation of polling in the "Run as a polling server" section.

    For the section "Run as a polling server", it's recommended to provide a brief explanation
    or link to what polling is and why it might be necessary or beneficial. This helps users
    understand the context and decide if this setup is suitable for their needs.

    docs/docs/installation/github.md [71-72]

     ## Run as a polling server
    -Request reviews by tagging your GitHub user on a PR
    +Request reviews by tagging your GitHub user on a PR. Polling allows the server to periodically check for updates or requests, making it useful for environments where real-time webhooks cannot be used.
     
    Highlight the advantages of running PR-Agent as a GitHub App.

    When introducing the GitHub App setup, it would be beneficial to briefly mention the
    advantages or use cases of running PR-Agent as a GitHub App compared to other methods.
    This provides users with a clear understanding of why and when to choose this setup.

    docs/docs/installation/github.md [84-85]

     ## Run as a GitHub App
    -Allowing you to automate the review process on your private or public repositories.
    +Running PR-Agent as a GitHub App allows for deeper integration with GitHub, enabling automated review processes on both private and public repositories. This method is ideal for users seeking a more seamless and automated workflow.
     
    Provide an introduction to AWS CodeCommit in its setup section.

    For the "AWS CodeCommit Setup" section, it would be helpful to include a brief
    introduction or overview of AWS CodeCommit and its relevance to PR-Agent. This can aid
    users unfamiliar with AWS CodeCommit in understanding its role and how it integrates with
    PR-Agent.

    docs/docs/installation/github.md [190-192]

     ## AWS CodeCommit Setup
    -Not all features have been added to CodeCommit yet.
    +AWS CodeCommit is a fully-managed source control service that hosts secure Git-based repositories. It integrates with PR-Agent to automate code reviews directly from CodeCommit pull requests. Not all features have been added to CodeCommit yet.
     
    Add alt attributes to images for improved accessibility and SEO.

    To improve accessibility and SEO, consider adding alt attributes to all images. This
    practice helps users who rely on screen readers to understand the content of images and
    also benefits SEO by providing context to search engines.

    docs/docs/index.md [54]

    -<img src="https://www.codium.ai/images/pr_agent/describe_new_short_main.png" width="512">
    +<img src="https://www.codium.ai/images/pr_agent/describe_new_short_main.png" alt="Describe tool example output" width="512">
     
    Align table headers and rows properly to enhance readability.

    To enhance the readability of the features table, consider aligning the table headers and
    rows properly. Proper alignment improves the table's readability in markdown form, making
    it easier for contributors to edit or add new entries.

    docs/docs/index.md [15-17]

    -|       |                                                                                                                     | GitHub | Gitlab | Bitbucket | Azure DevOps |
    -|-------|---------------------------------------------------------------------------------------------------------------------|:------:|:------:|:---------:|:------------:|
    -| TOOLS | Review                                                                                                              |   ✔️    |   ✔️    |   ✔️       |      ✔️      |
    +| Feature | Description                                                                                                        | GitHub | Gitlab | Bitbucket | Azure DevOps |
    +|---------|--------------------------------------------------------------------------------------------------------------------|:------:|:------:|:---------:|:------------:|
    +| TOOLS   | Review                                                                                                              |   ✔️    |   ✔️    |   ✔️       |      ✔️      |
     
    Add a version compatibility note for features to set the right user expectations.

    To ensure the documentation remains relevant and accurate, consider adding a note or
    disclaimer about the availability of features in different versions of the tool. This
    addition can help set the right expectations for users and prevent confusion about feature
    availability.

    docs/docs/index.md [46]

    -💎 marks a feature available only in [PR-Agent Pro](https://www.codium.ai/pricing/){:target="_blank"}
    +💎 marks a feature available only in [PR-Agent Pro](https://www.codium.ai/pricing/){:target="_blank"}. Please check the version compatibility for each feature as they may vary.
     
    Correct the syntax for string values in TOML configuration examples.

    For the section about ignoring files from analysis, it's recommended to clarify the syntax
    for ignoring files in all PRs. The current example uses single quotes around the glob
    pattern, which might not be correctly interpreted in TOML files. TOML requires strings to
    be in double quotes.

    docs/docs/usage-guide/additional_configurations.md [15-17]

    [ignore]
    -glob = ['.py']
    +glob = ["
    .py"]

    
    
    Accessibility
    Add aria-label attributes for links opening in new tabs.

    For better accessibility, it's important to add aria-label attributes to links that open
    in new tabs. This informs screen reader users that the link will open in a new tab or
    window. For example, add aria-label="CodiumAI (opens in a new tab)" to the anchor tag.

    docs/overrides/partials/footer.html [70]

    -<a href="https://www.codium.ai/" target="_blank" rel="noopener">CodiumAI</a>
    +<a href="https://www.codium.ai/" target="_blank" rel="noopener" aria-label="CodiumAI (opens in a new tab)">CodiumAI</a>
     
    Improve SVG icon accessibility with role and aria-label.

    To ensure the SVG icons are accessible, add role="img" and aria-label attributes to each
    SVG element. This provides a textual alternative for screen readers, making the icons more
    accessible. For example, for the GitHub icon, add role="img" and aria-label="GitHub".

    docs/overrides/partials/footer.html [78]

    -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512">...</svg>
    +<svg role="img" aria-label="GitHub" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512">...</svg>
     
    Maintainability
    Use CSS variables for colors and font sizes.

    To improve the maintainability of your CSS, consider using CSS variables for colors and
    font sizes. This makes it easier to update and maintain your styles. For example, define
    variables for your color scheme and font sizes at the root level and use them throughout
    your CSS.

    docs/overrides/partials/footer.html [8-47]

    +:root {
    +  --primary-font: Arial, sans-serif;
    +  --base-font-size: 16px;
    +  --hover-color: #AEA1F1;
    +  --background-color: #171518;
    +  --text-color: white;
    +}
     body {
       margin: 0;
       padding: 0;
    -  font-family: Arial, sans-serif;
    -  font-size: 16px;
    +  font-family: var(--primary-font);
    +  font-size: var(--base-font-size);
     }
     ...
     .footer-links a:hover {
    -  color: #AEA1F1;
    +  color: var(--hover-color);
     }
     
    Use consistent heading levels in Markdown for better structure and readability.

    To enhance clarity and maintain consistency with Markdown standards, consider using a
    single style for headings. The document mixes ## and ### for section headings without a
    clear hierarchical structure. For instance, "AWS CodeCommit Setup" uses ##, while
    subsections like "AWS CodeCommit IAM Role Example" use ####. A consistent use of heading
    levels helps in structuring the document more logically and improves readability.

    docs/docs/installation/github.md [190-208]

     ## AWS CodeCommit Setup
    -#### AWS CodeCommit IAM Role Example
    +### AWS CodeCommit IAM Role Example
     
    Remove empty lines between list items for a cleaner markdown document.

    For a cleaner and more consistent markdown file, consider removing the empty lines between
    list items. This change will make the document more compact and easier to read in its raw
    form.

    docs/docs/index.md [5-9]

     - See the [Installation Guide](./installation/index.md) for instructions on installing and running the tool on different git platforms.
    -
     - See the [Usage Guide](./usage-guide/index.md) for instructions on running the PR-Agent commands via different interfaces, including _CLI_, _online usage_, or by _automatically triggering_ them when a new PR is opened.
    -
     - See the [Tools Guide](./tools/index.md) for a detailed description of the different tools (tools are run via the commands).
     
    Best practice
    Use relative links for internal documentation to ensure they work in different environments.

    Consider using relative links for internal documentation to ensure they work correctly in
    different environments (e.g., local, staging, production). This change enhances the
    maintainability of the documentation and ensures links remain valid even if the base URL
    changes.

    docs/docs/index.md [5-9]

    -- See the [Installation Guide](./installation/index.md) for instructions on installing and running the tool on different git platforms.
    -- See the [Usage Guide](./usage-guide/index.md) for instructions on running the PR-Agent commands via different interfaces, including _CLI_, _online usage_, or by _automatically triggering_ them when a new PR is opened.
    -- See the [Tools Guide](./tools/index.md) for a detailed description of the different tools (tools are run via the commands).
    +- See the [Installation Guide](installation/index.md) for instructions on installing and running the tool on different git platforms.
    +- See the [Usage Guide](usage-guide/index.md) for instructions on running the PR-Agent commands via different interfaces, including _CLI_, _online usage_, or by _automatically triggering_ them when a new PR is opened.
    +- See the [Tools Guide](tools/index.md) for a detailed description of the different tools (tools are run via the commands).
     
    Add reminders to replace placeholder values with actual data in configuration examples.

    For the Azure configuration example, it's important to remind users to replace placeholder
    values with actual data. Specifically, the key, api_base, and deployment_id fields are
    critical for successful integration and should not be left as empty strings or
    placeholders.

    docs/docs/usage-guide/additional_configurations.md [47-53]

    [openai]
    -key = "" # your azure api key
    +key = "your_azure_api_key_here"
    api_type = "azure"
    api_version = '2023-05-15' # Check Azure documentation for the current API version
    -api_base = "" # The base URL for your Azure OpenAI resource. e.g. "https://.openai.azure.com"
    -deployment_id = "" # The deployment name you chose when you deployed the engine
    +api_base = "https://your_resource_name.openai.azure.com"
    +deployment_id = "your_deployment_name_here"
    +# Remember to replace placeholder values with your actual data.

    
    
    Add a note about potential costs associated with using Huggingface Inference Endpoints.

    In the section about inference endpoints, it would be beneficial to include a note about
    the potential costs associated with using external models, especially when making calls to
    Huggingface Inference Endpoints. This can help users make informed decisions about their
    usage.

    docs/docs/usage-guide/additional_configurations.md [91]

     To use a new model with Huggingface Inference Endpoints, for example, set:
    +# Note: Using external models like Huggingface Inference Endpoints may incur additional costs. Please check the pricing details on the Huggingface website.
     
    Add a warning about ensuring prompt modifications are compatible with post-process functions.

    The section on editing the prompts could benefit from a warning about ensuring
    compatibility with post-process functions. It's crucial that any modifications to prompts
    do not break the expected output format required by these functions.

    docs/docs/usage-guide/additional_configurations.md [208]

     For example, if you want to edit the prompts of the [describe](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/pr_description_prompts.toml) tool, you can add the following to your `.pr_agent.toml` file:
    +# Warning: Ensure that any modifications to prompts are compatible with the expected output format required by post-process functions.
     
    Clarification
    Clarify the token limit description for GPT-4 to include both prompt and completion.

    In the section about working with large PRs, it's mentioned that GPT-4 has a token limit
    of 8000 tokens. However, for clarity and accuracy, it would be beneficial to specify that
    this limit pertains to the input length, including both the prompt and the completion.

    docs/docs/usage-guide/additional_configurations.md [28-29]

    -The default mode of CodiumAI is to have a single call per tool, using GPT-4, which has a token limit of 8000 tokens.
    +The default mode of CodiumAI is to have a single call per tool, using GPT-4. GPT-4 has an input length limit of 8000 tokens, which includes both the prompt and the generated completion.
     

    ✨ 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 mrT23 merged commit a7e6690 into main Mar 10, 2024
    2 checks passed
    @mrT23 mrT23 deleted the add-docs-portal branch March 10, 2024 09:45
    @mrT23
    Copy link
    Collaborator

    mrT23 commented Mar 10, 2024

    PR Review

    ⏱️ Estimated effort to review [1-5]

    2, because the PR involves a significant addition of documentation and configuration files across various aspects of the project. The complexity is moderate, focusing on enhancing the user experience and providing clearer instructions for installation, usage, and tool functionalities. The effort is mainly in verifying the accuracy and completeness of the documentation, ensuring all links are correct, and the instructions are clear and actionable.

    🧪 Relevant tests

    No

    🔍 Possible issues

    No

    🔒 Security concerns

    No

    🔀 Can this PR be split?

    [{'title': 'Documentation Enhancement', 'relevant_files': ['docs/docs/index.md', 'docs/docs/usage-guide/automations_and_usage.md', 'docs/docs/usage-guide/additional_configurations.md', 'docs/docs/tools/describe.md', 'docs/docs/tools/improve.md', 'docs/docs/core-abilities/index.md', 'docs/docs/usage-guide/configuration_options.md', 'docs/docs/css/custom.css', 'docs/docs/installation/bitbucket.md', 'docs/docs/tools/custom_labels.md', 'docs/docs/tools/custom_suggestions.md', 'docs/docs/installation/azure.md', 'docs/docs/tools/similar_code.md', 'docs/docs/tools/index.md', 'docs/docs/tools/test.md', 'docs/docs/tools/similar_issues.md', 'docs/docs/usage-guide/introduction.md', 'docs/docs/tools/documentation.md', 'docs/docs/usage-guide/index.md', 'docs/docs/CNAME']}, {'title': 'Installation Guides Update', 'relevant_files': ['docs/docs/installation/locally.md', 'docs/docs/installation/gitlab.md', 'docs/docs/installation/index.md']}]

    Code feedback:

    ✨ 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

    mrT23 commented Mar 10, 2024

    Preparing review...

    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.

    None yet

    3 participants