[PR #2943] [CLOSED] feat: add ping CLI command and integration tests #2953

Closed
opened 2025-12-29 04:19:48 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2943
Author: @roganlynch
Created: 12/6/2025
Status: Closed

Base: mainHead: pr4c-cli-and-tests


📝 Commits (6)

  • 3b8bad4 feat(mapper): add SendDirectUpdate method for direct MapResponse delivery
  • 27e7d10 feat(ping): add core PingRequest/Response implementation
  • e4f6362 Add ping scheduler for node liveness checks
  • 85bab21 Add PingNode RPC protobuf definitions
  • 9d7d05f Implement PingNode gRPC handler
  • e301ce2 Add ping CLI command and integration tests

📊 Changes

19 files changed (+2712 additions, -83 deletions)

View changed files

cmd/headscale/cli/ping.go (+116 -0)
📝 config-example.yaml (+29 -0)
📝 gen/go/headscale/v1/headscale.pb.go (+71 -66)
📝 gen/go/headscale/v1/headscale.pb.gw.go (+81 -0)
📝 gen/go/headscale/v1/headscale_grpc.pb.go (+38 -0)
📝 gen/go/headscale/v1/node.pb.go (+179 -12)
📝 gen/openapiv2/headscale/v1/headscale.swagger.json (+86 -0)
📝 hscontrol/app.go (+15 -0)
📝 hscontrol/grpcv1.go (+83 -5)
📝 hscontrol/mapper/batcher.go (+1 -0)
📝 hscontrol/mapper/batcher_lockfree.go (+32 -0)
📝 hscontrol/noise.go (+75 -0)
hscontrol/ping.go (+280 -0)
hscontrol/ping_scheduler.go (+281 -0)
hscontrol/ping_scheduler_test.go (+111 -0)
📝 hscontrol/types/config.go (+21 -0)
integration/ping_test.go (+1190 -0)
📝 proto/headscale/v1/headscale.proto (+7 -0)
📝 proto/headscale/v1/node.proto (+16 -0)

📄 Description

Adds ping CLI command and integration tests.

Changes

  • CLI command: headscale nodes ping command for triggering node pings
  • Command-line interface: User-friendly ping interface with node selection
  • Integration tests: Comprehensive test suite for ping functionality
  • Test coverage: Tests for disco, TSMP, and c2n ping types
  • End-to-end validation: Validates the complete ping workflow

Implementation Details

The CLI command provides a convenient interface for administrators to ping nodes through the headscale API. Integration tests verify the complete ping functionality including request creation, delivery, response handling, and timeout behavior.

Context

Part of the work discussed in #2902 to add ping functionality to headscale. This completes the ping feature implementation with user-facing tools and comprehensive testing.

Dependencies

  • Requires PR #2942 (gRPC handler implementation)

Note: This code was generated with assistance from Claude Sonnet 4.5 via cline.bot


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/2943 **Author:** [@roganlynch](https://github.com/roganlynch) **Created:** 12/6/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr4c-cli-and-tests` --- ### 📝 Commits (6) - [`3b8bad4`](https://github.com/juanfont/headscale/commit/3b8bad4252652995d5b95467d39befc79a1a26db) feat(mapper): add SendDirectUpdate method for direct MapResponse delivery - [`27e7d10`](https://github.com/juanfont/headscale/commit/27e7d10285d373c26fc389f20deab4c1458924bb) feat(ping): add core PingRequest/Response implementation - [`e4f6362`](https://github.com/juanfont/headscale/commit/e4f6362853ca2334cc5cec49f32e7d18e3139977) Add ping scheduler for node liveness checks - [`85bab21`](https://github.com/juanfont/headscale/commit/85bab21ba23bee9e4c954cd18f4c2d8c9d51e37e) Add PingNode RPC protobuf definitions - [`9d7d05f`](https://github.com/juanfont/headscale/commit/9d7d05f252ad7266367a0111042ffec8d0e6a76b) Implement PingNode gRPC handler - [`e301ce2`](https://github.com/juanfont/headscale/commit/e301ce2ec0c8fd41cc4508adaadd564e78bbbf73) Add ping CLI command and integration tests ### 📊 Changes **19 files changed** (+2712 additions, -83 deletions) <details> <summary>View changed files</summary> ➕ `cmd/headscale/cli/ping.go` (+116 -0) 📝 `config-example.yaml` (+29 -0) 📝 `gen/go/headscale/v1/headscale.pb.go` (+71 -66) 📝 `gen/go/headscale/v1/headscale.pb.gw.go` (+81 -0) 📝 `gen/go/headscale/v1/headscale_grpc.pb.go` (+38 -0) 📝 `gen/go/headscale/v1/node.pb.go` (+179 -12) 📝 `gen/openapiv2/headscale/v1/headscale.swagger.json` (+86 -0) 📝 `hscontrol/app.go` (+15 -0) 📝 `hscontrol/grpcv1.go` (+83 -5) 📝 `hscontrol/mapper/batcher.go` (+1 -0) 📝 `hscontrol/mapper/batcher_lockfree.go` (+32 -0) 📝 `hscontrol/noise.go` (+75 -0) ➕ `hscontrol/ping.go` (+280 -0) ➕ `hscontrol/ping_scheduler.go` (+281 -0) ➕ `hscontrol/ping_scheduler_test.go` (+111 -0) 📝 `hscontrol/types/config.go` (+21 -0) ➕ `integration/ping_test.go` (+1190 -0) 📝 `proto/headscale/v1/headscale.proto` (+7 -0) 📝 `proto/headscale/v1/node.proto` (+16 -0) </details> ### 📄 Description Adds ping CLI command and integration tests. ## Changes - **CLI command**: `headscale nodes ping` command for triggering node pings - **Command-line interface**: User-friendly ping interface with node selection - **Integration tests**: Comprehensive test suite for ping functionality - **Test coverage**: Tests for disco, TSMP, and c2n ping types - **End-to-end validation**: Validates the complete ping workflow ## Implementation Details The CLI command provides a convenient interface for administrators to ping nodes through the headscale API. Integration tests verify the complete ping functionality including request creation, delivery, response handling, and timeout behavior. ## Context Part of the work discussed in #2902 to add ping functionality to headscale. This completes the ping feature implementation with user-facing tools and comprehensive testing. ## Dependencies - Requires PR #2942 (gRPC handler implementation) --- *Note: This code was generated with assistance from Claude Sonnet 4.5 via cline.bot* --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 04:19:48 +01:00
adam closed this issue 2025-12-29 04:19:48 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2953