From e474ec89c44f0ca112e973be1fc9445923813bba Mon Sep 17 00:00:00 2001 From: Voyvodka Date: Mon, 11 May 2026 11:34:15 +0300 Subject: [PATCH 1/2] chore(comments): remove pure-noise section banners (~30 lines) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CLAUDE.md comment rule: 'If deleting the comment wouldn't confuse a future reader, it shouldn't have been there.' Audit pass over the cross-app dashboard controllers and the SDK Models.cs surface a collection of section-header banners that say nothing the class names + IDE folding don't already cover. Removed: - DashboardMessagesController: 1 banner (Messages) - DashboardAnalyticsController: 1 banner (Helper) - DashboardEndpointController: 3 banners (Endpoints, Payload Transformation, Event Types) - WebhookEngine.Sdk/Models.cs: 5 banner pairs (Response envelope, Event Types, Endpoints, Messages, Common query parameters) Preserved: - Test-file section markers (// ── Read paths ──, // ── Plumbing ──, etc.) — these correlate with [Fact] groupings inside the test classes and aid scanning when a single class hosts 30+ tests. - Portal controller / portal middleware section markers — same reasoning as the test files. Behaviour unchanged. Pure cosmetics; build + tests green. --- .../DashboardAnalyticsController.cs | 4 ---- .../DashboardEndpointController.cs | 12 ----------- .../DashboardMessagesController.cs | 4 ---- src/WebhookEngine.Sdk/Models.cs | 20 ------------------- 4 files changed, 40 deletions(-) diff --git a/src/WebhookEngine.API/Controllers/DashboardAnalyticsController.cs b/src/WebhookEngine.API/Controllers/DashboardAnalyticsController.cs index 3047f91..1e49b6a 100644 --- a/src/WebhookEngine.API/Controllers/DashboardAnalyticsController.cs +++ b/src/WebhookEngine.API/Controllers/DashboardAnalyticsController.cs @@ -90,10 +90,6 @@ ORDER BY 1 return Ok(ApiEnvelope.Success(HttpContext, new { buckets })); } - // ────────────────────────────────────────────────── - // Helper - // ────────────────────────────────────────────────── - private static (DateTime StartTime, int IntervalMinutes) ParseTimelineParams(string period, string interval) { var startTime = period switch diff --git a/src/WebhookEngine.API/Controllers/DashboardEndpointController.cs b/src/WebhookEngine.API/Controllers/DashboardEndpointController.cs index df0fe52..58d6c74 100644 --- a/src/WebhookEngine.API/Controllers/DashboardEndpointController.cs +++ b/src/WebhookEngine.API/Controllers/DashboardEndpointController.cs @@ -54,10 +54,6 @@ public DashboardEndpointController( _auditLogger = auditLogger; } - // ────────────────────────────────────────────────── - // Endpoints (cross-app, for dashboard admin) - // ────────────────────────────────────────────────── - [HttpGet("endpoints")] public async Task ListEndpoints( [FromQuery] Guid? appId, @@ -364,10 +360,6 @@ public async Task TestEndpoint( return Ok(ApiEnvelope.Success(HttpContext, result)); } - // ────────────────────────────────────────────────── - // Payload Transformation - // ────────────────────────────────────────────────── - [HttpPost("transform/validate")] public IActionResult ValidateTransform([FromBody] ValidateTransformRequest request) { @@ -381,10 +373,6 @@ public IActionResult ValidateTransform([FromBody] ValidateTransformRequest reque })); } - // ────────────────────────────────────────────────── - // Event Types - // ────────────────────────────────────────────────── - [HttpGet("event-types")] public async Task ListEventTypes( [FromQuery] Guid appId, diff --git a/src/WebhookEngine.API/Controllers/DashboardMessagesController.cs b/src/WebhookEngine.API/Controllers/DashboardMessagesController.cs index 502c41d..d0529be 100644 --- a/src/WebhookEngine.API/Controllers/DashboardMessagesController.cs +++ b/src/WebhookEngine.API/Controllers/DashboardMessagesController.cs @@ -42,10 +42,6 @@ public DashboardMessagesController( _messageQueue = messageQueue; } - // ────────────────────────────────────────────────── - // Messages (cross-app, for dashboard admin) - // ────────────────────────────────────────────────── - [HttpGet("messages")] public async Task ListMessages( [FromQuery] Guid? appId, diff --git a/src/WebhookEngine.Sdk/Models.cs b/src/WebhookEngine.Sdk/Models.cs index ede5e33..bfb51e0 100644 --- a/src/WebhookEngine.Sdk/Models.cs +++ b/src/WebhookEngine.Sdk/Models.cs @@ -3,10 +3,6 @@ namespace WebhookEngine.Sdk; -// ============================================================ -// Response envelope -// ============================================================ - public class ApiResponse { public T? Data { get; set; } @@ -43,10 +39,6 @@ public class ApiErrorDetail public string? Message { get; set; } } -// ============================================================ -// Event Types -// ============================================================ - public class CreateEventTypeRequest { public string Name { get; set; } = string.Empty; @@ -71,10 +63,6 @@ public class EventTypeResponse public DateTime CreatedAt { get; set; } } -// ============================================================ -// Endpoints -// ============================================================ - public class CreateEndpointRequest { public string Url { get; set; } = string.Empty; @@ -121,10 +109,6 @@ public class EndpointStatsResponse public double P95LatencyMs { get; set; } } -// ============================================================ -// Messages -// ============================================================ - public class SendMessageRequest { public string EventType { get; set; } = string.Empty; @@ -228,10 +212,6 @@ public class MessageAttemptResponse public DateTime CreatedAt { get; set; } } -// ============================================================ -// Common query parameters -// ============================================================ - public class ListOptions { public int Page { get; set; } = 1; From 8366c02848c720e2f83d62ad1b3e359a8d1f56c1 Mon Sep 17 00:00:00 2001 From: Voyvodka Date: Mon, 11 May 2026 11:34:32 +0300 Subject: [PATCH 2/2] docs(changelog): note comment-noise cleanup under Unreleased > Removed --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b70e53..532e8c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht ## [Unreleased] +### Removed +- **Section-header / banner comment noise (~30 lines).** Cleared the empty-divider `// ──────────────────────────────────────────────────` separators in `DashboardMessagesController`, `DashboardAnalyticsController`, `DashboardEndpointController` (5 banners), and the `// ============================================================` banner pairs in `WebhookEngine.Sdk/Models.cs` (5 banners — Response envelope, Event Types, Endpoints, Messages, Common query parameters). All carried no `WHY` content; class names and IDE folding already cover navigation. Section-titled banners in test files (`// ── Read paths ──`, `// ── Plumbing ──`, etc.) are preserved as deliberate test-grouping markers. + ### Changed - **`PATCH /api/v1/portal/endpoints/{id}` replaces `PUT`.** Portal endpoint update was tagged `[HttpPut]` but its body semantics were partial-replace (every field optional, only non-null fields applied) — that is the contract for `PATCH`, not `PUT`. Switching the method aligns the wire surface with the actual behaviour and avoids confusing REST consumers that expect `PUT` to be full-replace. The route, request shape, and response shape are unchanged. Minor breaking change for any direct HTTP caller hitting this route; the embeddable `` component already uses the new method. - **`POST /api/v1/dashboard/applications/{appId}/portal/disable` no longer wipes `AllowedPortalOriginsJson`.** Disable revokes the auth surface (`PortalSigningKey` + `PortalRotatedAt`) but preserves the operator-curated CORS allowlist so a re-enable doesn't lose origin configuration. To explicitly clear the allowlist, send `PUT /portal/origins` with `{"origins": []}`. The audit log entry's `before/after` snapshot still records the change accurately.