Skip to content

fix resolver parsing#2351

Open
dogancanbakir wants to merge 2 commits intodevfrom
2350_fix_resolver_parsing
Open

fix resolver parsing#2351
dogancanbakir wants to merge 2 commits intodevfrom
2350_fix_resolver_parsing

Conversation

@dogancanbakir
Copy link
Member

@dogancanbakir dogancanbakir commented Jan 3, 2026

closes #2350

Summary by CodeRabbit

  • Improvements
    • Resolver configuration parsing now trims whitespace and accepts comma-separated entries, making multi-value resolver lines easier to write and more forgiving.
    • When a resolver argument appears to be a file path but the file is missing, a warning is logged while still retaining the argument, helping surface potential configuration issues without discarding input.

@dogancanbakir dogancanbakir self-assigned this Jan 3, 2026
@auto-assign auto-assign bot requested a review from Mzack9999 January 3, 2026 15:46
@coderabbitai
Copy link

coderabbitai bot commented Jan 3, 2026

Walkthrough

Updates resolver handling in runner/options.go: lines read from resolver files are trimmed; comma-separated values on a line are split into individual trimmed resolvers; empty items are ignored. When a resolver argument references a non-existent file but looks like a path (contains / or \), a warning is logged and the argument is still added.

Changes

Cohort / File(s) Summary
Resolver parsing & argument handling
runner/options.go
Trim lines when reading resolver files, split comma-separated values into individual trimmed resolver entries, drop empty items, and log a warning (but still add) when a resolver argument appears to be a file path and does not exist.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 I hopped through lines both short and long,
I trimmed and split what once was wrong,
Commas scattered, now each one stays,
A warning whispers through my maze,
Resolvers found — I twitch with song! 🎶

🚥 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 title 'fix resolver parsing' directly matches the main objective of the PR, which is to fix resolver file parsing to be consistent regardless of path type.
Linked Issues check ✅ Passed The changes implement comma-separated resolver handling and file path validation with warnings, directly addressing issue #2350's requirement for consistent resolver parsing.
Out of Scope Changes check ✅ Passed All changes in runner/options.go are scoped to resolver processing and validation, directly supporting the linked issue objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 2350_fix_resolver_parsing

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cbc12b and 8222571.

📒 Files selected for processing (1)
  • runner/options.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Test Builds (macOS-latest)
  • GitHub Check: Test Builds (windows-latest)
  • GitHub Check: Test Builds (ubuntu-latest)
  • GitHub Check: Functional Test (ubuntu-latest)
  • GitHub Check: Functional Test (windows-latest)
  • GitHub Check: Functional Test (macOS-latest)
  • GitHub Check: Analyze (go)
  • GitHub Check: release-test
🔇 Additional comments (2)
runner/options.go (2)

737-748: Good enhancement to resolver file parsing flexibility.

The addition of whitespace trimming and comma-separated value splitting makes the resolver file parser more robust and user-friendly. It now handles multiple resolver formats gracefully.


740-740: No action required. The project's go.mod specifies Go 1.24.1, which fully supports strings.SplitSeq (introduced in Go 1.23). The code is compatible with the project's minimum Go version.

}
for line := range chFile {
resolvers = append(resolvers, line)
line = strings.TrimSpace(line)
Copy link
Member

Choose a reason for hiding this comment

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

The issue seems unrelated to the file parsing, but rather to the file not existing on the file system (I guess maybe a typo from the user), as in fact it gets appended to the slice directly (previous line 741). The resolver file format (one resolver per line) is common to all tools, if we want to support comma separated resolvers on the same line within file, maybe we should move this to utils. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

It makes sense. I'll open an issue in utils to track this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, just asked user to check the path and it seem this isn't a path issue #2350 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

looks like the issue persists even with this change. For some reason the path lead to a non-existing file check. Maybe we can try to enforce additional checks on the resolver arguments (ex. presence of \ or /) which are prohibited as qualified domain name, and warning out the user and using default resolvers in case or erroring out since a resolver file was requested (ex. curl has hard fail when -dns-server is used and fails, without automatic fallbacks, but maybe we should be more fault tolerant and ease automation). What do you think?

Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

suggested approch

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.

-r flag fails silently in certain circumstances

2 participants