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

[gerrit] Added support project's config file: .pr_agent.toml #287

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

telepenin
Copy link
Contributor

  • removed markdown/html formatting from the review due to gerrit does not support it

+ removed markdown/html formatting from the review due to gerrit does not support it
@telepenin
Copy link
Contributor Author

/review

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

PR Analysis

  • 🎯 Main theme: Adding support for a project's config file and removing markdown/html formatting from the review.
  • 📝 PR summary: This PR introduces support for a project-specific configuration file, .pr_agent.toml, and modifies the adopt_to_gerrit_message function to remove markdown/html formatting from the review, as Gerrit does not support it.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The changes in this PR are generally good, but it would be better to handle the file reading error more specifically. Also, consider adding tests to validate the new functionality.

  • 🤖 Code feedback:

    • relevant file: pr_agent/git_providers/gerrit_provider.py
      suggestion: Instead of returning an empty string when an OSError occurs, it would be more informative to log the error message or raise a custom exception. This will help in debugging if the file read operation fails. [important]
      relevant line: return b""

    • relevant file: pr_agent/git_providers/gerrit_provider.py
      suggestion: Consider using a more pythonic way to read the file. You can use Pathlib's read_text() or read_bytes() method which simplifies the process and automatically handles closing the file. [medium]
      relevant line: with open(self.repo_path / ".pr_agent.toml", 'rb') as f:

    • relevant file: pr_agent/git_providers/gerrit_provider.py
      suggestion: It's a good practice to use a constant for the filename ".pr_agent.toml" since it's used in multiple places. This will make it easier to manage and modify in the future. [medium]
      relevant line: with open(self.repo_path / ".pr_agent.toml", 'rb') as f:

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

@mrT23 mrT23 merged commit e90c9e5 into Codium-ai:main Sep 7, 2023
2 checks passed
yochail pushed a commit to yochail/pr-agent that referenced this pull request Feb 11, 2024
[gerrit] Added support project's config file: `.pr_agent.toml`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants