Skip to content

Use SystemPath for DirectoryWatcher - #20

Closed
chrisgeo wants to merge 0 commit into
mainfrom
feat/chaos-1450-directory-watcher
Closed

Use SystemPath for DirectoryWatcher#20
chrisgeo wants to merge 0 commit into
mainfrom
feat/chaos-1450-directory-watcher

Conversation

@chrisgeo

@chrisgeo chrisgeo commented May 8, 2026

Copy link
Copy Markdown

Summary

Converts DirectoryWatcher from URL to SystemPackage.FilePath, mirroring the pattern landed in apple#1480 (HostDNSResolver) and apple#1518 (PacketFilter).

Changes

  • directoryURL: URLdirectoryPath: FilePath (public API)
  • init(directoryURL:, log:)init(directoryPath:, log:)
  • startWatching(handler:) closure signature: ([URL])([FilePath])
  • LocalhostDNSHandler.swift caller updated; the URL(filePath: configPath.string) wrapping shim is no longer needed

Behavioral note

URL.lastPathComponent returns String; FilePath.lastComponent returns FilePath.Component? (optional). The filename filter in LocalhostDNSHandler handles the optional explicitly via $0.lastComponent?.string.starts(with: ...) == true. This preserves the prior "skip malformed entries" behavior.

Context

Test plan

  • swift test --filter DirectoryWatcherTest — all tests pass
  • swift test --filter ContainerOSTests — full module passes (no neighbor regressions)
  • swift-format strict lint clean
  • Full project builds

@linear

linear Bot commented May 8, 2026

Copy link
Copy Markdown

CHAOS-1450

@chrisgeo
chrisgeo force-pushed the feat/chaos-1450-directory-watcher branch from 849d310 to 4c1477d Compare May 8, 2026 22:15
@chrisgeo
chrisgeo force-pushed the feat/chaos-1450-directory-watcher branch from 9e19473 to 4c1477d Compare May 9, 2026 23:16
@chrisgeo chrisgeo closed this May 13, 2026
@chrisgeo
chrisgeo force-pushed the feat/chaos-1450-directory-watcher branch from 642f782 to b466959 Compare May 13, 2026 00:38
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