Skip to content

feat: make Mittwald database host IP resolution configurable#30

Merged
konradmichalik merged 1 commit into
mainfrom
feature/configurable-mittwald-host-ip-resolution
Jun 22, 2026
Merged

feat: make Mittwald database host IP resolution configurable#30
konradmichalik merged 1 commit into
mainfrom
feature/configurable-mittwald-host-ip-resolution

Conversation

@konradmichalik

@konradmichalik konradmichalik commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the mittwald_resolve_host_to_ip flag to control whether the Mittwald database hostname is resolved to its IP and pinned in .env
  • Default to false so the DNS hostname is kept — pinning the IP breaks when Mittwald rotates database IPs or enforces TLS against the hostname
  • TCP reachability checks still run; only the IP pinning is now opt-in

Background

The hostname-to-IP resolution was a workaround for DNS flapping of freshly created Mittwald databases, but it ran unconditionally in two places and now causes problems on Mittwald infrastructure.

Changes

  • deployer/feature/config/set.php - Add mittwald_resolve_host_to_ip flag (default false)
  • src/Database/Manager/MittwaldApi.php - Guard resolveHostnameToIp() (setup path)
  • deployer/feature/task/feature_sync.php - Guard resolveDatabaseHostToIp() (sync path)
  • docs/DATABASE.md - Document the flag and updated DNS flapping behaviour

Summary by CodeRabbit

  • New Features

    • Added a new optional configuration option for Mittwald API database management. When enabled, it controls whether database hostnames are resolved and pinned to IP addresses. This feature is disabled by default.
  • Documentation

    • Expanded the database documentation with comprehensive information about DNS behavior, potential issues with IP rotation, and clear guidance on when and how to enable the new configuration.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 21789c6d-5a6c-42ab-9d1f-36e52127dd06

📥 Commits

Reviewing files that changed from the base of the PR and between 27c1942 and 5a07f15.

📒 Files selected for processing (4)
  • deployer/feature/config/set.php
  • deployer/feature/task/feature_sync.php
  • docs/DATABASE.md
  • src/Database/Manager/MittwaldApi.php

📝 Walkthrough

Walkthrough

A new boolean configuration flag mittwald_resolve_host_to_ip (default: false) is introduced. Early-return guards in resolveDatabaseHostToIp() (Deployer task) and MittwaldApi::resolveHostnameToIp() (PHP class) skip hostname-to-IP resolution when the flag is disabled. Documentation is updated to reflect the opt-in behavior and its caveats.

Changes

Mittwald hostname resolution opt-in flag

Layer / File(s) Summary
Config default, resolution guards, and docs
deployer/feature/config/set.php, deployer/feature/task/feature_sync.php, src/Database/Manager/MittwaldApi.php, docs/DATABASE.md
Registers mittwald_resolve_host_to_ip defaulting to false in the Deployer config; adds early-return guards in both resolveDatabaseHostToIp() and resolveHostnameToIp() that log a debug message and skip resolution when the flag is disabled; documents the new optional setting, the DNS flapping rationale, and the opt-in snippet in DATABASE.md.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • move-elevator/deployer-tools#17: Originally implemented the Mittwald database hostname-to-IP resolution logic that this PR wraps behind the new mittwald_resolve_host_to_ip opt-in flag.

Poem

🐇 A hostname once resolved without a care,
Now hides behind a flag, disabled fair.
IP rotation and TLS do frown,
So by default we keep the old name around.
One little true to opt back in — beware!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: making Mittwald database host IP resolution configurable. It accurately reflects the primary objective of introducing the mittwald_resolve_host_to_ip flag across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/configurable-mittwald-host-ip-resolution

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.2.2)

PHPStan was skipped because the config uses disallowed bootstrapFiles, bootstrapFile, or includes directives.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@konradmichalik konradmichalik merged commit 2c0761c into main Jun 22, 2026
2 checks passed
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