Skip to content

docs: document how to auto-trigger /add_docs via pr_commands - #1795

Merged
mrT23 merged 5 commits into
The-PR-Agent:mainfrom
jmsb02:docs/add_docs-auto-trigger-docs-only
May 19, 2025
Merged

mrT23 merged 5 commits into
The-PR-Agent:mainfrom
jmsb02:docs/add_docs-auto-trigger-docs-only

Conversation

@jmsb02

@jmsb02 jmsb02 commented May 19, 2025 •

Copy link
Copy Markdown
Contributor

User description

Related Issue

#1768 - Support auto‐run of add_docs on PR open

Summary

This PR updates the official documentation for the /add_docs tool by introducing a new section: Automatic triggering.
The section explains how to configure the tool to run automatically on PR open, by adding it to the pr_commands list in .pr_agent.yaml or configuration.toml.

Background

In #1768, it was clarified that /add_docs is not enabled by default for automatic execution.
However, users can opt into this behavior by including the command in their configuration, as is done with /describe, /review, and /improve.

Currently, this setup detail was not documented anywhere, which could lead to confusion for teams attempting to activate the tool.

What’s included

  • A new subsection under docs/docs/tools/documentation.md named "Automatic triggering"
  • Usage example showing how to include /add_docs in pr_commands
  • An explicit note that this setup is opt-in, and not active by default

Motivation

This contribution aims to:

  • Help users discover that /add_docs can be triggered automatically through configuration
  • Align its documentation with other tools like /describe and /review, which already include such instructions
  • Reduce the onboarding effort for teams wanting to adopt docstring generation in their workflows

This PR includes documentation only, and does not introduce any code changes or behavioral modifications.
It addresses the maintainer’s suggestion here.

I’d greatly appreciate your review and feedback.
Please let me know if any adjustments are needed.

Thank you for your continued guidance!


PR Type

Documentation


Description

  • Add section on automatic triggering of /add_docs

  • Provide configuration example for auto-running on PR open

  • Clarify opt-in nature of this feature


Changes walkthrough 📝

Relevant files
Documentation
documentation.md
Add documentation for auto-triggering /add_docs via configuration

docs/docs/tools/documentation.md

  • Added "Automatic triggering" section for /add_docs
  • Included example configuration for enabling auto-run
  • Added note clarifying opt-in default behavior
  • +17/-0   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-free-for-open-source-projects

    Copy link
    Copy Markdown
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis ❌

    1768 - Not compliant

    Non-compliant requirements:

    • Add configuration option for auto-running add_docs on PR open
    • Implement event handler in github_app.py to trigger add_docs when PR is opened/reopened/marked ready

    Requires further human verification:

    • Ensure default behavior remains unchanged when auto_run_on_pr_open is unset or false
    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Implementation Mismatch

    The PR only adds documentation for using pr_commands to auto-trigger add_docs, but the ticket requested implementing the auto_run_on_pr_open configuration option and event handler. This PR doesn't implement the actual feature, only documents an existing alternative approach.

    To automatically run the `add_docs` tool when a pull request is opened, configure your `.pr_agent.yaml` or `configuration.toml` as follows:
    
    ```toml
    [github_app]
    pr_commands = [
        "/describe",
        "/review",
        "/improve",
        "/add_docs"
    ]

    !!! note
    This behavior is opt-in; by default /add_docs only runs on manual invocation.

    
    </details>
    
    </td></tr>
    </table>
    

    @qodo-free-for-open-source-projects

    qodo-free-for-open-source-projects Bot commented May 19, 2025 •

    Copy link
    Copy Markdown
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    Comment thread docs/docs/tools/documentation.md Outdated

    ## Automatic triggering

    To automatically run the `add_docs` tool when a pull request is opened, configure your `.pr_agent.yaml` or `configuration.toml` as follows:

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Can you please utilize the same convention as seen in other tools, such as improve or review ?
    Also, as seen in those two examples, it would be a good idea to mention add_docs has its own configuration options.

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Further clarification: As in the above two tools, no need to explicitly state the names of the configuration files. Instead, better to use the same wording: "... define in a configuration file:" (and link to the page: https://qodo-merge-docs.qodo.ai/usage-guide/configuration_options/ )

    Copy link
    Copy Markdown
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Thank you for the clarification!
    I’ve updated the phrasing to align with the conventions used in review and improve, and replaced the file names with a general reference to the configuration file.
    Please let me know if there’s anything else I should adjust!

    Comment thread docs/docs/tools/documentation.md Outdated
    ```

    !!! note
    This behavior is **opt-in**; by default `/add_docs` only runs on manual invocation.

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Can you please explain what you meant by opt-in ? Do you mean to state that the default is add_docs by default does not trigger automatically?

    Copy link
    Copy Markdown
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Yes 🙂

    Thank you very much for the clear feedback! 🙇

    I’ve updated the Automatic triggering section based on the conventions used in review and improve:

    Added a Manual triggering subsection for consistency

    Clarified that /add_docs must be explicitly listed in pr_commands to run automatically

    Included a note that this applies only when the Qodo Merge GitHub App is installed and active

    Please let me know if anything else should be adjusted!

    Comment thread docs/docs/tools/documentation.md Outdated
    ```

    The `pr_commands` list defines commands that run automatically when a PR is opened.
    This applies only if the Qodo Merge GitHub App is installed and active for the repository.

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I recommend to clarify that since this is under github_app section, it will only apply for when running in GitHub environment.

    Copy link
    Copy Markdown
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Thanks again for the helpful feedback!

    I've updated the note to clarify that this setting only applies when using the GitHub App, as it's defined under the [github_app] section.

    Let me know if you'd like anything else adjusted ☺️

    @mrT23
    mrT23 merged commit 6d9bb93 into The-PR-Agent:main May 19, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants