Conversation
Since OpenVoxProject#536 removed the default `server=puppet`, `create_service` raised (or warned) whenever `server` was not set in the config, even when the caller had already resolved a server through `server_list`, DNS SRV records, or an explicit `puppet://host/...` URL. An agent configured with only `server_list`, or with `use_srv_records` and `srv_domain`, could not connect at all. Move the check into `check_server_setting` and skip it when the resolver passes an explicit server. The settings-based resolver, which is the only one that falls back on `server`, keeps the existing errors and deprecation warning. Fixes OpenVoxProject#658 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Steven Pritchard <steven.pritchard@gmail.com>
|
@silug Unless I missed something, the idea is to relax the guard when |
@corporate-gadfly https://github.com/OpenVoxProject/openvox/pull/659/changes#diff-53d60872a028f347232d3ed8cd4873c0f9b06f5932ed4f4cd9ed463614be6dbfL36 was looking specifically for |
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, aligns with the stated regression fix, and is covered by targeted unit tests for both the resolved and fallback behaviors.
Pull request overview
This PR adjusts the HTTP service creation path so the server setting is only required when the resolver truly needs to fall back to Puppet[:server], fixing regressions introduced when the implicit default server=puppet was removed (#536). This restores connectivity for agents that resolve a server via server_list, DNS SRV records, or an explicit puppet://host/... URL (Fixes #658).
Changes:
- Move the “server setting required / warn / raise” logic into
Puppet::HTTP::Service.check_server_setting. - Only enforce the
serversetting requirement increate_servicewhen no explicitserverargument is provided. - Add/adjust unit tests to cover resolution via
server_list, SRV records, explicit URLs, and the remaining failure case when falling back to theserversetting.
File summaries
| File | Description |
|---|---|
| lib/puppet/http/service.rb | Centralizes and scopes the server-setting enforcement to only cases where no explicit server is provided. |
| spec/unit/http/session_spec.rb | Adds coverage for resolving without server configured when using server_list, SRV, or explicit puppet URLs; asserts fallback still raises. |
| spec/unit/http/service_spec.rb | Verifies create_service does not warn/raise about missing server when an explicit server is passed. |
| spec/unit/http/resolver_spec.rb | Adds/adjusts resolver specs to ensure server-less resolution works when resolver supplies an explicit server. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Note This comment was generated by Claude Code at @silug's request, to expand on the explanation above. @corporate-gadfly The guard itself is not relaxed; the same checks, messages, and deprecation warning are still there, now in Why that is the right trigger Every service constructor picks its host with
Before this change the guard ran unconditionally at the top of Why nothing slips through The concern behind #536 is an agent silently talking to an implicit
In other words, every path that ends up reading Coverage The new |
Short description
Since #536 removed the default
server=puppet,create_serviceraised (or warned) wheneverserverwas not set in the config, even when the caller had already resolved a server throughserver_list, DNS SRV records, or an explicitpuppet://host/...URL. An agent configured with onlyserver_list, or withuse_srv_recordsandsrv_domain, could not connect at all.Move the check into
check_server_settingand skip it when the resolver passes an explicit server. The settings-based resolver, which is the only one that falls back onserver, keeps the existing errors and deprecation warning.Fixes #658
Generated by Claude Code
Checklist
I have:
Signed-off-byannotation to each of my commitsGenerated-byorAssisted-byannotations to each of my commits created with the help of an AI agent