Skip to content

fix(minor): [sc-32833] Add possibility to construct Consul instance with address string.#33

Merged
ser-0xff merged 2 commits into
mainfrom
feature/sc-32833/investigate-consul-capabilities-to-setup-3
Jun 16, 2026
Merged

fix(minor): [sc-32833] Add possibility to construct Consul instance with address string.#33
ser-0xff merged 2 commits into
mainfrom
feature/sc-32833/investigate-consul-capabilities-to-setup-3

Conversation

@ser-0xff

Copy link
Copy Markdown
Contributor

Description

Include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Minimal checklist:

  • I have performed a self-review of my own code
  • I have added DocC code-level documentation for any public interfaces exported by the package
  • I have added unit and/or integration tests that prove my fix is effective or that my feature works

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new initializers and address parsing logic to the Consul client, allowing initialization via a single address string (e.g., "host:port") alongside new error cases for invalid inputs. It also adds corresponding unit tests for the parsing logic. The review feedback highlights critical issues with IPv6 address parsing, specifically handling raw IPv6 addresses without a port and stripping brackets from bracketed IPv6 hosts to prevent connection failures in SwiftNIO. It also suggests adding unit tests to cover these IPv6 scenarios.

Comment thread Sources/ConsulServiceDiscovery/Consul.swift
Comment thread Tests/ConsulServiceDiscoveryTests/ConsulTests.swift
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.66667% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.44%. Comparing base (97aae5f) to head (2d949e4).

Files with missing lines Patch % Lines
...ests/ConsulServiceDiscoveryTests/ConsulTests.swift 77.14% 8 Missing ⚠️
Sources/ConsulServiceDiscovery/Consul.swift 88.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
+ Coverage   79.40%   79.44%   +0.04%     
==========================================
  Files           5        5              
  Lines         830      885      +55     
==========================================
+ Hits          659      703      +44     
- Misses        171      182      +11     
Files with missing lines Coverage Δ
Sources/ConsulServiceDiscovery/Consul.swift 72.15% <88.00%> (+0.63%) ⬆️
...ests/ConsulServiceDiscoveryTests/ConsulTests.swift 93.75% <77.14%> (-4.68%) ⬇️
Files with missing lines Coverage Δ
Sources/ConsulServiceDiscovery/Consul.swift 72.15% <88.00%> (+0.63%) ⬆️
...ests/ConsulServiceDiscoveryTests/ConsulTests.swift 93.75% <77.14%> (-4.68%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97aae5f...2d949e4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ser-0xff ser-0xff merged commit 19b5647 into main Jun 16, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants