Skip to content

Code Review Bench PR #30975 - feat: allow pass hostname in docker env#6

Closed
ketkarameya wants to merge 2 commits intobase_pr_30975_20260125_6271from
corrupted_pr_30975_20260125_6271
Closed

Code Review Bench PR #30975 - feat: allow pass hostname in docker env#6
ketkarameya wants to merge 2 commits intobase_pr_30975_20260125_6271from
corrupted_pr_30975_20260125_6271

Conversation

@ketkarameya
Copy link

@ketkarameya ketkarameya commented Feb 10, 2026

Benchmark PR for Gitar evaluation

Original PR: agentic-review-benchmarks#6

feat: allow pass hostname in docker env



Summary by Gitar

  • New SMTP hostname configuration:
    • Added SMTP_LOCAL_HOSTNAME optional parameter to override hostname in SMTP HELO/EHLO commands for NAT/proxy deployments
  • Updated SMTP client:
    • Refactored SMTP connection instantiation to accept and pass local_hostname parameter consistently across all three TLS modes (plain, STARTTLS, SMTP_SSL)
  • Environment setup:
    • Added SMTP_LOCAL_HOSTNAME to .env.example files and docker-compose configuration with documentation
  • Test coverage:
    • Updated unit tests to accommodate new parameter using unittest.mock.ANY matcher

This will update automatically on new commits.

@gitar-bot-staging
Copy link

gitar-bot-staging bot commented Feb 10, 2026

Note

Gitar has paused automatic reviews. Comment "Gitar review" to trigger a review manually.

Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Clean implementation of SMTP_LOCAL_HOSTNAME configuration. The null-handling logic (or "" / or None) correctly preserves default behavior when the setting is unset. One minor unnecessary assert to clean up.

💡 Quality: Unnecessary assert smtp is not None after constructor call

📄 api/libs/smtp.py:32

The assert smtp is not None on line 32 is redundant. The SMTP/SMTP_SSL constructor on lines 28-30 either succeeds (returning a non-None object) or raises an exception (jumping to the except block). There is no code path where smtp could be None at line 32.

Additionally, assert statements are stripped when Python runs with -O (optimized mode), so they shouldn't be used for runtime checks. In this case it doesn't matter since the condition is always True, but removing it improves clarity.

Suggested fix

            if self.use_tls and self.opportunistic_tls:
Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@kayagokalp kayagokalp closed this Feb 25, 2026
@kayagokalp kayagokalp deleted the corrupted_pr_30975_20260125_6271 branch February 25, 2026 02:06
@kayagokalp kayagokalp restored the corrupted_pr_30975_20260125_6271 branch February 25, 2026 02:15
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.

4 participants