Skip to content

fix(gerrit): explicitly set git provider in server startup#2317

Open
gvago wants to merge 1 commit intomainfrom
fix/gerrit-server-set-provider
Open

fix(gerrit): explicitly set git provider in server startup#2317
gvago wants to merge 1 commit intomainfrom
fix/gerrit-server-set-provider

Conversation

@gvago
Copy link
Copy Markdown

@gvago gvago commented Apr 14, 2026

Summary

  • The Gerrit server's start() function was missing get_settings().set("CONFIG.GIT_PROVIDER", "gerrit"), causing it to rely on implicit URL format detection instead of explicit configuration
  • Other servers (e.g., bitbucket_app.py, gitlab_webhook.py) already set their provider explicitly at startup -- this aligns the Gerrit server with the same pattern
  • Adds a single line to gerrit_server.py:start() to set the provider before the app starts

Test plan

  • Verify the Gerrit server starts correctly with the explicit provider setting
  • Confirm get_settings().config.git_provider returns "gerrit" after start() is called
  • Validate that existing Gerrit request handling (review, describe, ask, improve) still works as expected

🤖 Generated with Claude Code

The Gerrit server's start() function did not set CONFIG.GIT_PROVIDER
to "gerrit", relying instead on implicit URL format detection to
determine the provider. This could cause the wrong provider to be
selected.

Other servers (bitbucket_app, gitlab_webhook) explicitly set their
git provider during startup. This commit adds the same explicit
configuration to the Gerrit server for consistency and correctness.
@qodo-free-for-open-source-projects
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Set explicit git provider for Gerrit server startup

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Explicitly set git provider to "gerrit" in server startup
• Aligns Gerrit server with pattern used by other servers
• Prevents reliance on implicit URL format detection
Diagram
flowchart LR
  A["Gerrit Server start()"] -->|"set CONFIG.GIT_PROVIDER"| B["Provider = gerrit"]
  B -->|"explicit configuration"| C["Consistent with other servers"]
Loading

Grey Divider

File Changes

1. pr_agent/servers/gerrit_server.py 🐞 Bug fix +1/-0

Add explicit git provider configuration

• Added explicit git provider configuration in start() function
• Sets CONFIG.GIT_PROVIDER to "gerrit" before app initialization
• Ensures consistent provider detection across all server implementations

pr_agent/servers/gerrit_server.py


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown
Contributor

qodo-free-for-open-source-projects bot commented Apr 14, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@gvago gvago self-assigned this Apr 14, 2026
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.

1 participant