← Back to Pull requests

refactor(ndm): rename comp/networkdevices to comp/ndmconnectivitycheck #58803

Closed
unknown closed this pull request without merging on Nov 04, 2026 13:12 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 16:06 UTC
Author

What does this PR do?

Renames comp/networkdevices to comp/ndmconnectivitycheck and runs it over the shared probing package.

The component is the interactive connectivity check that the Private Action Runner drives through the Agent IPC endpoint. It is not the Agent-side component for all of Network Device Monitoring, and its name said otherwise, which is why the discovery work could not sit next to it.

  • The probing moves onto pkg/networkdevice/probe (#58800), so the connectivity check and the discovery sweep share one implementation. One unreachable address no longer discards the results of the addresses probed alongside it, which it did before: an error from any target propagated out of the request's errgroup and failed the whole check.

  • The request and response shapes move into their own dto.go, translated to and from the probe package's types.
  • Concurrency is unchanged from main: a check is bounded by the worker count its own request asks for, and the number of checks in flight is bounded by the Private Action Runner's task concurrency. This PR adds no Agent-side budget and no new configuration.

    Motivation

    Fourth of five pull requests splitting up #56540, which was ~3,000 lines of production code in one review. #58800, #58801 and #58802 have merged; #58804 is the last.

    Review feedback addressed

  • Eager ping detection removed. The component used to detect the ping capability from an OnStart hook, so every Core Agent pinged loopback at startup, waiting up to a second, even on agents that never serve a connectivity check. Detection already ran lazily behind a sync.Once on the first check, so the hook was pure cost.

  • The request's useRawSocket override applies only on Linux again. Windows has no UDP pinger and macOS no raw one, and both reject the wrong socket type, so honouring the override everywhere made every target fail on those platforms. The removed buildPinger forced the type per OS and consulted the request only on Linux; resolveRawSocket(goos, detected, override) restores that and is testable for all three platforms without build tags.

  • The Agent-wide worker budget is gone, along with network_devices.connectivity_check.workers. Reserving a request's whole worker count for the duration of a scan, regardless of how many targets it had, meant a single-IP check could hold the entire budget and that concurrent checks serialised behind each other in FIFO order. Rather than make the accounting finer, the budget is dropped: PAR already bounds how many checks run at once. Removing it also drops the component's config.Component dependency.
  • Describe how you validated your changes

    //comp/ndmconnectivitycheck/impl:impl_test                               PASSED
    

    dto_test.go covers the translation both ways, including the per-target failure that previously failed the batch, and the socket-type resolution on Linux, Windows and macOS. bzl build //cmd/agent/subcommands/run:run succeeds, which matters here because dropping config.Component changes the component's fx dependencies.

    dda inv components.lint-components and dda inv schema.lint both pass. comp/README.md and .github/CODEOWNERS are regenerated rather than hand-edited, including through the rebase onto main, where they were the only conflicts.

    Possible drawbacks / trade-offs

    A component rename shows up as a large diff for a small change. Reviewing with ?w=1 and rename detection on keeps it to scan.go, dto.go and newcomponent.go.

    Dropping the budget means the Agent still has no ceiling of its own on probes per request: a request asking for 10,000 workers gets them. That is exactly today's behaviour on main, so this PR is not a regression, but the bound lives in PAR's task concurrency rather than in the Agent.

    🤖 Generated with Claude Code

    Diff: 487 lines (+365 / -122) across 6 files Reviewer: Pierre-L42 Review duration: 17105m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 487 lines diff across 6 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.370
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #58803"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52.4% (MEDIUM) · Higher = larger blast radius
    52.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.7% · Safe to merge
    20.7%