fix: route /improve to inline suggestions for GitLab Changes tab#2498
fix: route /improve to inline suggestions for GitLab Changes tab#2498utsab345 wants to merge 8 commits into
Conversation
…ests - 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
…aks in tests" This reverts commit 7f0d154.
Providers like GitLab support publish_code_suggestions (inline diff comments) but lack publish_inline_comments (generic review comments that GitHub uses). The old condition only checked gfm_markdown, so GitLab always rendered a table in the Overview tab instead of actionable inline suggestions in the Changes tab. Adding publish_inline_comments to the routing condition makes GitLab (and any future provider with a similar split) fall through to the inline path, while GitHub (which has both) keeps the table.
PR Summary by QodoFix /improve routing to use inline suggestions for GitLab Changes tab
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
Context used 1. Large MR skips suggestions
|
…estions relevant_lines_end is inclusive (matching GitHub, Bitbucket, Azure DevOps providers), so the range for GitLab's suggestion format must be end - start + 1. The previous formula (end - start) undercounted by 1, producing range=0 for single-line suggestions and broken alignment.
|
Fixed the suggestion range off-by-one in GitLabProvider.publish_code_suggestions. @naorpeled good to review! |
|
Code review by qodo was updated up to the latest commit 51bac38 |
|
Hey @utsab345, |
…onfig.git_provider from CLI - Move update_settings_from_args before apply_repo_settings in _handle_request so CLI config overrides (--config.*) are effective during provider creation - Remove git_provider from the forbidden CLI args list since selecting a provider via CLI is a safe operation that does not expose secrets
|
Code review by qodo was updated up to the latest commit 9dd4d3d |
…s list - Re-apply CLI --key=value overrides after apply_repo_settings() so that CLI args still take precedence over repo .pr_agent.toml values - Split the base64-encoded forbidden-args string into a documented list to stay within the 120-char line limit
|
Tested against https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/948 using the new token -- GitLab routing works end-to-end:
Also addressed the two Qodo findings on the latest commit (105d817):
|
|
Code review by qodo was updated up to the latest commit 105d817 |
git_provider was intentionally removed from the forbidden CLI args list so that --config.git_provider=gitlab can be used to select the Git provider. Update the security test to match.
|
Code review by qodo was updated up to the latest commit 33fcfa3 |
…um_lines - Remove duplicate c2tpcF9rZXlz (skip_keys) entry from _encoded_parts list - Rename variable 'range' to 'num_lines' to avoid shadowing Python built-in
|
Code review by qodo was updated up to the latest commit 33c020e |
Fixes #2410
Problem:
/improveoutput always renders as a table in the GitLab MR Overview tab, even though GitLab supports inline diff suggestions. Users have to manually setcommitable_code_suggestions = trueto get inline comments.Root cause: The routing condition at
pr_code_suggestions.py:132checks onlyis_supported("gfm_markdown")to decide between the table and inline paths. GitLab supports GFM markdown, so it always takes the table path.Fix: Added
is_supported("publish_inline_comments")to the condition. GitLab returnsFalsefor this capability (it usespublish_code_suggestionsfor inline comments instead), so it falls through to the inline path. Providers that have both capabilities (like GitHub) keep the table behavior unchanged.cc @naorpeled