pr-agent icon indicating copy to clipboard operation
pr-agent copied to clipboard

Support for directory level config files

Open Snagnar opened this issue 10 months ago • 2 comments

Feature request

For more complex projects, a directory level config file would solve cases where you need specific instructions for different parts of the code. The closer the config file is to the file that is being reviewed/handled, the higher its priority is for the actual review.

Challenges could be to 1) determine which config files are relevant for which file to be reviewed and 2) do per file config handling and review (as one PR could touch files in multiple different subdirectories with different config files).

Motivation

For very large projects (e.g. monorepos) you need some module specific configs to handle different standards.

Snagnar avatar Apr 15 '25 07:04 Snagnar

:bulb: Auto-generated documentation-based answer:

Currently, PR-Agent/Qodo Merge doesn't directly support directory-level configuration files with hierarchical priority based on proximity to the reviewed file.

The current configuration system supports three levels of configuration:

  1. Wiki configuration - Stored in the repository's wiki
  2. Local configuration - A .pr_agent.toml file in the repository root
  3. Global configuration - A configuration file in a dedicated pr-agent-settings repository at the organization level

In terms of precedence, wiki configurations override local configurations, and local configurations override global configurations.

For your use case with monorepos and module-specific configurations, you could:

  1. Use the existing configuration options to ignore certain files or folders using the ignore.glob or ignore.regex settings
  2. Provide module-specific guidance through the extra_instructions parameter for specific tools
  3. Create module-specific best practices in a best_practices.md file

I recommend submitting this as a feature request to the PR-Agent GitHub repository, as hierarchical configuration files would indeed be valuable for large monorepo projects.

Relevant Sources:

  • https://qodo-merge-docs.qodo.ai//usage-guide/configuration_options
  • https://qodo-merge-docs.qodo.ai//usage-guide/additional_configurations#ignoring-files-from-analysis

Supporting configuration files in multiple possible locations is a significant challenge, as each location (given that you know where to look) is a separate API call, and it can add significant usage to the API rate limit.

In any case, these kinds of features are prioritized to Qodo Merge (the paid product) We plan to introduce more granularity for configuration files in Qodo Merge in the near future.

mrT23 avatar Apr 16 '25 10:04 mrT23