Repository navigation
Combine all modified and deleted files that been compressed to the prompt - #3
Conversation
PR Analysis
PR Feedback
How to use
|
|
@CodiumAI-Agent summerize me the PR, in 4 bullet points |
|
Question: summerize me the PR, in 4 bullet points Answer:
|
|
@CodiumAI-Agent summerize the PR, in 3 bullet points. add small code snippet to explain each one |
|
Question: summerize the PR, in 3 bullet points. add small code snippet to explain each one Answer:
|
…d_files_one_list Combine all modified and deleted files that been compressed to the prompt
…et_pipeline Fix bitbucket pipeline
PR Code Suggestions ✨Latest suggestions up to ff720d3
Previous suggestionsSuggestions up to commit ff720d3
Suggestions up to commit ff720d3
Suggestions up to commit ff720d3
|
|
PR Description updated to latest commit (ff720d3)
|
- Add new /webhook-parallel endpoint for concurrent PR processing - Extract process_webhook() function for shared logic - Add configuration options: enable_parallel_reviews, max_concurrent_reviews - Implement asyncio.create_task() for true concurrent execution - Add semaphore-based concurrency limiting (default: 5 concurrent reviews) - Keep original /webhook endpoint unchanged for backward compatibility - Add comprehensive architecture documentation with sequence diagrams Benefits: - PR #2 latency: 80s -> 41s (49% improvement) - PR #3 latency: 120s -> 42s (65% improvement) - 3x throughput improvement Feature can be enabled by: 1. Setting bitbucket_app.enable_parallel_reviews=true 2. Changing webhook URL to /webhook-parallel
…view - Extract loader into pr_agent/algo/best_practices.py and reuse it from /improve and /review so OSS behavior is symmetric (closes Qodo The-PR-Agent#1). - Guard int(max_lines_allowed) with TypeError/ValueError fallback to 800 plus a targeted warning (Qodo The-PR-Agent#2). - Bitbucket get_pr_agent_repo_custom_file: only accept HTTP 200, log non-404 failures, add 10s timeout, and use the repo default branch via get_repo_default_branch (Qodo The-PR-Agent#3, The-PR-Agent#5, The-PR-Agent#6). - LocalGitProvider get_pr_agent_repo_custom_file: resolve and verify the candidate path stays inside the repo root before reading (Qodo The-PR-Agent#7). - Soften prompt wording in code-suggestions templates and add a parallel block in pr_reviewer_prompts.toml so the model treats the section as guidance, ignoring obvious non-guideline content. - Drop unused _FakeContext test helper, retarget patches to the new module, add coverage for the invalid max_lines fallback (Qodo The-PR-Agent#4). - Update docs/improve.md and docs/review.md to reflect that both tools now consume best_practices.md in OSS. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
UnicodeDecodeError is not a subclass of OSError, so a single non-UTF-8 SKILL.md or sibling resource would propagate out of get_skills_context() and break /review, /improve, /describe whenever skills were enabled. Both reads now catch (OSError, UnicodeDecodeError); the offending file is logged and skipped. Tests cover both SKILL.md and resource paths. Addresses Qodo finding #3 on PR The-PR-Agent#2385.
- Use compiled Asana patterns (_ASANA_TASK_URL_PATTERN, _ASANA_TASK_SHORT_PATTERN) in find_asana_tickets() instead of inline regex (CodeQL unused-variable, comments The-PR-Agent#5/The-PR-Agent#6). - Add re.IGNORECASE flag to _ASANA_TASK_SHORT_PATTERN for proper case-insensitive matching. - Replace substring match ('app.asana.com' in ticket) with prefix check (ticket.startswith()) to fix CodeQL URL sanitization warning (comment The-PR-Agent#4). - Reserve at least one slot for Asana tickets during truncation when there are 3+ GitHub/branch tickets (comment The-PR-Agent#8). - Dedent only actual leading whitespace instead of blindly slicing dline[remove_count:] to avoid deleting real code on lines with less indentation (comments The-PR-Agent#3/The-PR-Agent#9). - Remove unused 'import pytest' from test file (comments The-PR-Agent#10/The-PR-Agent#20). - Add test_shorthand_mixed_case_asana and test_shorthand_respects_word_boundary test cases.
- Use compiled Asana patterns (_ASANA_TASK_URL_PATTERN, _ASANA_TASK_SHORT_PATTERN) in find_asana_tickets() instead of inline regex (CodeQL unused-variable, comments The-PR-Agent#5/The-PR-Agent#6). - Add re.IGNORECASE flag to _ASANA_TASK_SHORT_PATTERN for proper case-insensitive matching. - Replace substring match ('app.asana.com' in ticket) with prefix check (ticket.startswith()) to fix CodeQL URL sanitization warning (comment The-PR-Agent#4). - Reserve at least one slot for Asana tickets during truncation when there are 3+ GitHub/branch tickets (comment The-PR-Agent#8). - Dedent only actual leading whitespace instead of blindly slicing dline[remove_count:] to avoid deleting real code on lines with less indentation (comments The-PR-Agent#3/The-PR-Agent#9). - Remove unused 'import pytest' from test file (comments The-PR-Agent#10/The-PR-Agent#20). - Add test_shorthand_mixed_case_asana and test_shorthand_respects_word_boundary test cases.
- Add GitProvider.publish_managed_labels with a default implementation that preserves existing read-modify-write semantics for non-GitLab providers (no behavior change for GitHub, Bitbucket, Gitea, etc.). - Override in GitLabProvider to refresh the MR exactly once and compute both the user-label filter and the add/remove diff against that single snapshot. This closes the cross-method race where a caller's get_pr_labels(update=True) and publish_labels' internal refresh produced two snapshots, allowing a label added between them to be removed via current - desired. - /describe (_safe_publish_labels) and /review (set_review_labels) now call publish_managed_labels with a managed-label predicate instead of doing their own pre-read + manual merge + publish_labels. - Refactor publish_labels to share _publish_labels_against(mr, desired) with publish_managed_labels so the two write paths cannot drift. - _safe_publish_labels now catches a narrow set of expected provider/network errors (ConnectionError, TimeoutError, OSError, ValueError, KeyError, AttributeError) instead of bare Exception, so programmer errors surface to /describe's outer handler. - Strengthen publish_labels tests to capture add_labels / remove_labels at save-time via a save() side_effect and assert the exact comma-separated wire payload. - Add six tests for publish_managed_labels covering single-refresh, user-label preservation, no-op when nothing changes, removal of all managed labels when desired is empty, abort on refresh failure, and diff-attr cleanup on save() failure. Addresses Qodo review items #1 (broad except in _safe_publish_labels), The-PR-Agent#2 (cross-method label race), and The-PR-Agent#3 (weak test payload assertions) on PR The-PR-Agent#2483. Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
…h failures via typed exception Addresses Qodo review items The-PR-Agent#2, The-PR-Agent#3, The-PR-Agent#4 on PR The-PR-Agent#2483. The-PR-Agent#2 Hardcoded managed_default label set - Add is_describe_managed_label() and _describe_managed_label_names() in pr_agent.algo.utils as the single source of truth for the /describe-managed namespace. - Rewrite get_user_labels() to defer to the same helper so the inclusion and exclusion rules can never drift. The-PR-Agent#3 Default label not managed (Bug fix with tests) - When enable_custom_labels=True and no custom_labels are configured, set_custom_labels injects defaults that include 'Bug fix with tests'. is_describe_managed_label now classifies that label as managed so /describe can remove it once it is no longer recommended. - This also fixes a pre-existing bug in get_user_labels where 'Bug fix with tests' was misclassified as a user label. The-PR-Agent#4 Refresh failure misreported - Add LabelRefreshError in pr_agent.git_providers.git_provider so callers can distinguish a refresh failure from a genuine no-op. - GitProvider.publish_managed_labels (default impl) and GitLabProvider.publish_managed_labels now raise LabelRefreshError on pre-write refresh failure instead of returning None. - PRDescription._safe_publish_labels and PRReviewer.set_review_labels catch LabelRefreshError specifically and log a warning that names the failure, instead of mis-logging it as 'labels unchanged' / 'already set'. #1, The-PR-Agent#5, The-PR-Agent#6, The-PR-Agent#7 from Qodo's review are already addressed in earlier commits on this branch (36ec454, a7a8cad); Qodo's review listing is pinned to PR-level diff hunks so they appear in the report against older revisions. Tests: - New TestDescribeManagedLabelNamespace locks the predicate behavior: default-set always managed, Bug fix with tests managed under the custom-labels default-injection path, and is_describe_managed_label / get_user_labels stay disjoint. - TestSafePublishLabels gains test_predicate_includes_bug_fix_with_tests_when_custom_labels_default and test_logs_distinctly_on_refresh_failure. - test_pr_reviewer_core gains test_set_review_labels_logs_distinctly_on_refresh_failure. - test_publish_managed_labels_aborts_when_refresh_fails replaced with test_publish_managed_labels_raises_when_refresh_fails. - Full unit suite: 1066 passed, 1 skipped, 3 xfailed (was 1060). Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
- Add _next_page_url() helper and paginate _find_existing_check_run to follow GitHub Link header across pages (Qodo finding The-PR-Agent#8) - Pass name="config-errors" to handle_configurations_errors so it doesn't clobber other check-run output (Qodo finding #3) - Fix FakeMarkdownProvider to accept the new name kwarg
* fix: scope ticket cache per-PR and fix Dynaconf list merge leaks in tests - Cache key is now 'related_tickets_<md5(pr_url)>' instead of global 'related_tickets', preventing stale tickets leaking between unrelated PRs - Added cache_tickets=true config flag under [pr_reviewer] to allow disabling - Fixed Dynaconf merge_enabled=True list append bug in both production code (env_bridge.py uses case-insensitive pop before set) and test helpers (restore_settings now calls _remove_key before every set) - Added azure-identity dependency for Azure DevOps provider availability - 1043 tests pass, 0 failures * Revert "fix: scope ticket cache per-PR and fix Dynaconf list merge leaks in tests" This reverts commit 7f0d154. * feat: support GitHub Checks API as output mechanism (#1400) Add `github.publish_as_check_run` config option (default `false`) that routes persistent tool output (review, describe, improve) to GitHub Check Runs instead of PR comments. Check runs appear in the dedicated Checks tab, reducing comment noise on the main PR conversation. - `GithubProvider.publish_persistent_comment` delegates to `_publish_check_run` when the flag is enabled - Check runs are created on first invocation and updated on subsequent calls (tracked per tool name via `_check_run_ids` dict) - Falls back to comments gracefully on API errors * fix: address bot review comments for Checks API (#1400) - Move _check_run_ids from class-level to instance-level dict - Use self.last_commit_id.sha instead of commit object - Remove unused headers variable (F841) - Add fallback to PR comment when check run API fails * fix: address remaining bot review comments for Checks API (#1400) - Use separate update_body without head_sha for PATCH requests - Truncate text payload to 65535 chars (GitHub API limit) * fix: remove exception details from log to avoid leaking API request info * fix: address review feedback - fix requestJsonAndCheck unpacking, persistent check-run lookup, add tests * docs: document publish_as_check_run and synchronize event in action setup * chore: remove accidentally added skpro submodule * chore: add skpro to gitignore * fix: address Qodo findings - guard last_commit_id with getattr, add check_run support to improve path * fix: address Qodo findings on check-run output clobbered and pagination - Add _next_page_url() helper and paginate _find_existing_check_run to follow GitHub Link header across pages (Qodo finding #8) - Pass name="config-errors" to handle_configurations_errors so it doesn't clobber other check-run output (Qodo finding #3) - Fix FakeMarkdownProvider to accept the new name kwarg --------- Co-authored-by: Utsab <utsab@pr-agent.dev>
…view Rework the state-leak fix from a full 'restore all settings to a startup snapshot' into a surgical per-key revert, and address Qodo's review of The-PR-Agent#2346. Why the rework: a blanket snapshot-restore at the top of apply_repo_settings() also wipes legitimate per-request/base config that current main sets before the call (config.extra_config_url, config.is_auto_command, mosaico flags, ...), regressing 11 existing tests. Instead, note_repo_setting_override() records the pre-override value of each key a repo/extra .pr_agent.toml writes, and reset_repo_settings_overrides() reverts exactly those keys on the next load. This addresses the review findings: - The-PR-Agent#1 (is_auto_command wiped): flags set outside the repo-settings merge are never recorded, so they are never reverted by the second apply_repo_settings(). - The-PR-Agent#2 (reset missed context settings): record/revert both go through get_settings(), so a per-request context['settings'] clone is handled too. - The-PR-Agent#3 (non-atomic global reset): record/revert are guarded by an RLock and touch only the overridden keys; full cross-request isolation still relies on a per-request clone. Also uses Dynaconf unset(force=True) (a plain unset() is a no-op) so a repo-injected key that did not exist at baseline is actually removed on revert. Tests: extend tests/unittest/test_apply_repo_settings.py with cases for flag preservation, non-repo config survival, and revert targeting the effective settings object. Full unit suite: 1717 passed. Co-authored-by: Tomasz Haratynowicz <75249676+tharatynowicz@users.noreply.github.com>
…e fix - Regenerate the config reference so the documented no_temperature_models default includes the GLM-5 entries added in the previous commit (the docs build guard would otherwise catch this drift, per Qodo finding #1). - Extend the Kimi K3 completion test to also cover the GLM-5 bare, regional, and Converse spellings, since the model list added a second model with no matching coverage (Qodo finding #2). - Reword the test docstring to imperative phrasing (Qodo finding The-PR-Agent#4). Qodo finding #3 (import order) is a false positive: `ruff check` against this repo's actual pyproject.toml config passes the original tomllib-then-pathlib order unchanged (straight imports sort before from-imports within a section by default); left as-is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e fix - Regenerate the config reference so the documented no_temperature_models default includes the GLM-5 entries added in the previous commit (the docs build guard would otherwise catch this drift, per Qodo finding #1). - Extend the Kimi K3 completion test to also cover the GLM-5 bare, regional, and Converse spellings, since the model list added a second model with no matching coverage (Qodo finding #2). - Reword the test docstring to imperative phrasing (Qodo finding The-PR-Agent#4). Qodo finding #3 (import order) is a false positive: `ruff check` against this repo's actual pyproject.toml config passes the original tomllib-then-pathlib order unchanged (straight imports sort before from-imports within a section by default); left as-is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e fix - Regenerate the config reference so the documented no_temperature_models default includes the GLM-5 entries added in the previous commit (the docs build guard would otherwise catch this drift, per Qodo finding #1). - Extend the Kimi K3 completion test to also cover the GLM-5 bare, regional, and Converse spellings, since the model list added a second model with no matching coverage (Qodo finding #2). - Reword the test docstring to imperative phrasing (Qodo finding The-PR-Agent#4). Qodo finding #3 (import order) is a false positive: `ruff check` against this repo's actual pyproject.toml config passes the original tomllib-then-pathlib order unchanged (straight imports sort before from-imports within a section by default); left as-is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
User description
Description
Add two sections to the the prompt:
The final PR will have this format :
instead of:
All tests pass
PR Type
Enhancement
Description
get_pr_diffandpr_generate_compressed_difffunctions to handle new file categorizationNoneinstead of a stringsort_files_by_main_languagesfunctionChanges walkthrough 📝
git_patch_processing.py
Update deleted file handling in patch processingpr_agent/algo/git_patch_processing.py
Noneinstead of "Filewas deleted" string
pr_processing.py
Enhance PR diff processing with file categorizationpr_agent/algo/pr_processing.py
separate lists
get_pr_diffandpr_generate_compressed_difffunctions tohandle new file lists
sections
test_handle_patch_deletions.py
Update test for deleted file handlingtests/unit/test_handle_patch_deletions.py
Noneinstead of "File was deleted" stringfor deleted files
test_language_handler.py
Add comprehensive tests for language handlingtests/unit/test_language_handler.py
sort_files_by_main_languagesfunctioncases