Skip to content

HYPERFLEET-1369 - refactor: Flatten handlerConfig - #316

Open
ma-hill wants to merge 1 commit into
openshift-hyperfleet:mainfrom
ma-hill:HYPERFLEET-1369
Open

HYPERFLEET-1369 - refactor: Flatten handlerConfig#316
ma-hill wants to merge 1 commit into
openshift-hyperfleet:mainfrom
ma-hill:HYPERFLEET-1369

Conversation

@ma-hill

@ma-hill ma-hill commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the handlerConfig struct and handle* runner functions from the handler layer, flattening all HTTP handlers to call handleError and writeJSONResponse directly. The previous approach wrapped handler logic in closures that were immediately unwrapped and executed by generic runner functions, adding indirection without value. This refactor follows the standard Go HTTP handler pattern, improves readability with top-to-bottom execution flow, and eliminates per-request closure allocations.

HYPERFLEET-1369

Changes

Handler framework simplification:

  • Removed handlerConfig struct that wrapped handler logic in closures
  • Removed 7 handle* runner functions (handle, handleSoftDelete, handleGet, handleList, handleForceDelete, handleCreateWithNoContent, and one additional runner)
  • Moved all utility functions from framework.go to helpers.go (254 lines deleted from framework.go, 119 lines added to helpers.go)
  • Retained decodeAndValidate helper for shared decode+validate pattern with optional "strict" mode for PATCH requests
  • Retained handleError, writeJSONResponse, and applyFieldFilter utility functions

Handler refactoring:

  • Refactored all handlers in resource_handler.go (318 lines), root_resource_handler.go (436 lines), and resource_status_handler.go (80 lines) to flat implementations
  • Handlers now call handleError(r, w, err) and writeJSONResponse(w, r, statusCode, data) directly instead of wrapping in config structs
  • Eliminated closure wrapping — handlers execute sequentially from top to bottom with early returns
  • Preserved all existing HTTP status codes (201 Created, 200 OK, 202 Accepted, 204 No Content), error handling (RFC 9457 Problem Details), and validation logic
  • Moved validate type definition to validation.go where its implementations live

Testing:

  • Added comprehensive test coverage for helpers.go functions (400 new lines in helpers_test.go)
  • Moved TestResourceHandler_Create_NameValidation from separate file into resource_handler_test.go for better organization
  • Deleted name_validation_handler_test.go (94 lines) - tests merged into main test file
  • All 1314 unit tests pass

Documentation:

  • Updated pkg/handlers/CLAUDE.md with comprehensive handler patterns, validation patterns, error handling guidance, and field filtering examples (120 lines)
  • Updated root CLAUDE.md to reflect new handler structure

Test Plan

  • make lint passes
  • make test-all passes
  • Confirm decodeAndValidate
  • Unit tests added

@openshift-ci
openshift-ci Bot requested review from jsell-rh and ldornele July 27, 2026 19:45
@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mbrudnoy for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Handlers replace handlerConfig wrappers with explicit request flows. Shared helpers provide decoding, validation, type-mismatch normalization, field filtering, JSON responses, and RFC 9457 error responses. Resource, status, root-resource, and adapter-status handlers now inline routing, ownership checks, service calls, presentation, and HTTP responses. Documentation and validation tests were updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Handler
  participant Helpers
  participant Service
  Client->>Handler: send request
  Handler->>Helpers: decode and validate
  Helpers-->>Handler: validated request or error
  Handler->>Service: execute operation
  Service-->>Handler: result or error
  Handler-->>Client: write HTTP response
Loading

Suggested reviewers: jsell-rh, kuudori, ldornele

🚥 Pre-merge checks | ✅ 9 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
No Pii Or Sensitive Data In Logs ⚠️ Warning FAIL: handleError logs err.Reason, and validation errors can interpolate request fields like cond.Type/cond.Status, risking CWE-532. Remove reason from logs or replace it with fixed codes/categories; keep request-derived values out of log messages.
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: flattening the handlerConfig-based handler framework.
Description check ✅ Passed The description accurately describes the handler refactor and related helper/test updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Sec-02: Secrets In Log Output ✅ Passed No non-test log call uses token/password/credential/secret fields or interpolation; DB logs use redacted connection strings. CWE-532 not observed.
No Hardcoded Secrets ✅ Passed No added apiKey/secret/token/password literals, base64 blobs, or embedded creds were found in the PR diff. CWE-798/CWE-259 not triggered.
No Weak Cryptography ✅ Passed No banned crypto primitives, ECB, or secret comparisons appear in the touched handler files; imports are JSON/HTTP only (no CWE-327/328/208).
No Injection Vectors ✅ Passed No CWE-89/78/79/502 sinks in changed non-test code; the only fmt.Sprintf filter uses registry.Kind after registry.Get, not raw request data.
No Privileged Containers ✅ Passed No Kubernetes/OpenShift manifests, Helm templates, or Dockerfiles changed; no CWE-250 privileged settings found in the diff.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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

@hyperfleet-ci-bot

hyperfleet-ci-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

Risk Score: 2 — risk/medium

Signal Detail Points
PR size 2002 lines (>500) +2
Sensitive paths none +0
Test coverage Tests cover changed packages +0

Computed by hyperfleet-risk-scorer

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
pkg/handlers/framework.go (1)

22-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Magic string "strict" used as switch discriminator with silent default fallback.

Any typo'd mode value ("Strict", "STRICT", etc.) silently falls through to default (non-strict) decoding — no compile-time or runtime signal. Since strict mode is what rejects unknown/immutable fields on PATCH/PUT, a future typo at a call site quietly weakens input validation instead of failing loudly. Define a package constant instead of relying on the literal.

As per path instructions, "Magic numbers/strings SHOULD be named constants" (QUAL-02).

♻️ Proposed fix
+const StrictMode = "strict"
+
 func decodeAndValidate(r *http.Request, req any, validateFuncs []validate, decodeType ...string) *errors.ServiceError {
 	...
 	switch mode {
-	case "strict":
+	case StrictMode:

And update call sites (decodeAndValidate(r, &req, validateFuncs, "strict")) to use handlers.StrictMode.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/handlers/framework.go` around lines 22 - 50, Define an exported package
constant such as StrictMode for the strict decoding discriminator, and replace
the literal "strict" in decodeAndValidate and all call sites with that constant.
Preserve the existing strict behavior while ensuring callers use the shared
symbol instead of a magic string.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Around line 87-88: Update the framework.go entry in AGENTS.md to describe the
current decodeAndValidate-based handling flow instead of the removed handle,
handleGet, handleList, and handleDelete functions. Keep the documentation
aligned with the symbols that actually exist in framework.go.

In `@pkg/handlers/root_resource_handler.go`:
- Around line 202-214: Add an immediate return after handleError in
RootResourceHandler.Delete when GetByID returns svcErr, preventing access to
resource.Kind after a failed lookup. Preserve the existing delete flow for
successful lookups and the current error handling for Delete failures.
- Around line 61-71: Update the List handler flow around presenters.SliceFilter
so it returns immediately after successfully writing the filtered response when
listArgs.Fields is set. Keep the existing error handling and unfiltered write
for requests without fields, preventing both responses from being written.

---

Nitpick comments:
In `@pkg/handlers/framework.go`:
- Around line 22-50: Define an exported package constant such as StrictMode for
the strict decoding discriminator, and replace the literal "strict" in
decodeAndValidate and all call sites with that constant. Preserve the existing
strict behavior while ensuring callers use the shared symbol instead of a magic
string.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b8f18c51-fa59-4a74-a75b-ea8e733fc96d

📥 Commits

Reviewing files that changed from the base of the PR and between 1ae18cb and 055073d.

📒 Files selected for processing (7)
  • AGENTS.md
  • CLAUDE.md
  • pkg/handlers/CLAUDE.md
  • pkg/handlers/framework.go
  • pkg/handlers/resource_handler.go
  • pkg/handlers/resource_status_handler.go
  • pkg/handlers/root_resource_handler.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)
💤 Files with no reviewable changes (1)
  • CLAUDE.md

Comment thread AGENTS.md Outdated
Comment thread pkg/handlers/root_resource_handler.go Outdated
Comment thread pkg/handlers/root_resource_handler.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
pkg/handlers/root_resource_handler.go (2)

202-214: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Nil dereference: handleError without return on GetByID failure (CWE-476).

On a failed lookup resource is nil and line 208 reads resource.Kind, panicking the handler goroutine instead of returning the error response. Violates ERR-03 (error response must be followed by return).

🐛 Proposed fix
 	if svcErr != nil {
 		handleError(r, w, svcErr)
+		return
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/handlers/root_resource_handler.go` around lines 202 - 214, Update
RootResourceHandler.Delete so the GetByID error branch calls handleError and
immediately returns before accessing resource.Kind or invoking Delete; preserve
the existing Delete error handling and successful response flow.

Source: Path instructions


61-71: 🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win

Missing return after the filtered write: double-write plus unfiltered payload on the wire (CWE-200).

Line 68 writes the field-filtered list, then execution falls through to line 70 and writes the full result. Two concatenated JSON bodies, and ?fields= withholds nothing.

🐛 Proposed fix
 		writeJSONResponse(w, r, http.StatusOK, filtered)
+		return
 	}
 	writeJSONResponse(w, r, http.StatusOK, result)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/handlers/root_resource_handler.go` around lines 61 - 71, Update the
filtered-response branch in the resource handler to return immediately after
writing the successful filtered payload. Keep the existing error return and
unfiltered response path unchanged so only one JSON response is written.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@pkg/handlers/root_resource_handler.go`:
- Around line 202-214: Update RootResourceHandler.Delete so the GetByID error
branch calls handleError and immediately returns before accessing resource.Kind
or invoking Delete; preserve the existing Delete error handling and successful
response flow.
- Around line 61-71: Update the filtered-response branch in the resource handler
to return immediately after writing the successful filtered payload. Keep the
existing error return and unfiltered response path unchanged so only one JSON
response is written.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: aa1fb51f-33e6-417a-bb90-2bb86c8f18b9

📥 Commits

Reviewing files that changed from the base of the PR and between 055073d and 678995f.

📒 Files selected for processing (7)
  • AGENTS.md
  • CLAUDE.md
  • pkg/handlers/CLAUDE.md
  • pkg/handlers/framework.go
  • pkg/handlers/resource_handler.go
  • pkg/handlers/resource_status_handler.go
  • pkg/handlers/root_resource_handler.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)
🚧 Files skipped from review as they are similar to previous changes (6)
  • CLAUDE.md
  • pkg/handlers/resource_status_handler.go
  • pkg/handlers/CLAUDE.md
  • AGENTS.md
  • pkg/handlers/resource_handler.go
  • pkg/handlers/framework.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/handlers/root_resource_handler.go`:
- Around line 253-258: Update the response construction in
FindByResourcePaginated’s caller so the total count remains int64 end-to-end and
cannot be silently truncated by int32(total). Prefer changing the OpenAPI
response contract and related Page/Size/Total fields to int64; otherwise
validate total against an explicit supported maximum and handle overflow before
assigning it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e952cfc9-e6b3-4180-9702-05a48ba607a6

📥 Commits

Reviewing files that changed from the base of the PR and between 678995f and 6765c1b.

📒 Files selected for processing (7)
  • AGENTS.md
  • CLAUDE.md
  • pkg/handlers/CLAUDE.md
  • pkg/handlers/framework.go
  • pkg/handlers/resource_handler.go
  • pkg/handlers/resource_status_handler.go
  • pkg/handlers/root_resource_handler.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)
🚧 Files skipped from review as they are similar to previous changes (6)
  • pkg/handlers/resource_status_handler.go
  • CLAUDE.md
  • AGENTS.md
  • pkg/handlers/CLAUDE.md
  • pkg/handlers/resource_handler.go
  • pkg/handlers/framework.go

Comment thread pkg/handlers/root_resource_handler.go
Comment thread pkg/handlers/root_resource_handler.go
Comment thread pkg/handlers/CLAUDE.md Outdated
Comment thread pkg/handlers/framework.go Outdated
Comment thread pkg/handlers/framework.go Outdated
@pnguyen44

Copy link
Copy Markdown
Contributor

applyFieldFilter is now called directly from each Get handler. A few edge-case tests (no fields, valid fields, invalid fields) would help catch regressions independently of the handler tests.

Comment thread pkg/handlers/framework.go Outdated
Comment thread pkg/handlers/framework.go Outdated
Comment thread pkg/handlers/framework.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/handlers/CLAUDE.md`:
- Around line 3-13: Update the “Request Processing” pipeline documentation to
require JWT-authenticated POST, PATCH, PUT, and DELETE handlers to resolve
caller identity and return 401 Unauthorized when resolution fails, while keeping
GET and LIST handlers permitted without identity. Place this requirement
alongside the existing decode/validation and service-call guidance.
- Around line 17-18: Update the ResourceHandler route example to use the
parent_id placeholder consistently with the mux.Vars(r)["parent_id"] lookup,
replacing the inconsistent cluster_id placeholder while preserving the
documented nested route structure.
- Around line 66-73: Update the “Error constructor functions” section in
CLAUDE.md to document the required errors. Add entries for errors.Conflict and
errors.ValidationWithDetails alongside the existing errors.NotFound,
errors.Validation, errors.GeneralError, errors.MalformedRequest, and
errors.BadRequest entries, preserving their signatures and HTTP error semantics
from pkg/errors.

In `@pkg/handlers/helpers_test.go`:
- Around line 334-370: Extend TestApplyFieldFilter with an invalid-fields
subtest using a rejected field such as “nonexistent”, then assert
applyFieldFilter returns the expected non-nil *errors.ServiceError and its
HTTPCode. Keep the existing no-fields and valid-fields coverage unchanged.
- Around line 150-162: Fix the “undefined decodeType” subtest by either
supplying a validator that sets validateCalled or removing the unused flag and
its assertion; retain assertions for successful decoding. Align the test’s
expected error behavior with decodeAndValidate’s handling of unknown decodeType,
updating it if the helper rejects unrecognized modes instead of accepting them.
- Around line 302-324: Extend the table-driven tests for describeJSONKind with a
reflect.Kind that is not explicitly handled, such as reflect.Invalid, and expect
the fallback text “the correct type”. Keep the existing mappings unchanged and
ensure the new case exercises the default branch.

In `@pkg/handlers/helpers.go`:
- Around line 57-60: Update the request-body handling helper around io.ReadAll
to wrap r.Body with http.MaxBytesReader using the established request size limit
before reading, ensuring oversized bodies are rejected with HTTP 413 while
preserving malformed-request handling for other read failures.
- Around line 62-84: Update the decode-mode handling around the strict/default
switch to use a compile-checked mode type or explicitly reject any unrecognized
decodeType value instead of silently falling back to permissive decoding;
preserve strict behavior for the strict mode and return an appropriate error for
invalid values. In both the strict decoder and permissive path, pass req
directly to Decode and Unmarshal rather than taking its address.

In `@pkg/handlers/resource_handler_test.go`:
- Around line 1139-1144: Update the test cases for validateName to exercise the
dbNameMaxLen fallback when both configured lengths are zero. Replace or
supplement the “no validation when zero lengths” case with a name longer than
dbNameMaxLen and expect http.StatusBadRequest, while retaining coverage for a
valid name if needed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: af0ef66b-be99-4480-8fb6-f2aa043ab0cf

📥 Commits

Reviewing files that changed from the base of the PR and between 6765c1b and 50c7136.

📒 Files selected for processing (13)
  • AGENTS.md
  • CLAUDE.md
  • pkg/handlers/CLAUDE.md
  • pkg/handlers/framework.go
  • pkg/handlers/framework_test.go
  • pkg/handlers/helpers.go
  • pkg/handlers/helpers_test.go
  • pkg/handlers/name_validation_handler_test.go
  • pkg/handlers/resource_handler.go
  • pkg/handlers/resource_handler_test.go
  • pkg/handlers/resource_status_handler.go
  • pkg/handlers/root_resource_handler.go
  • pkg/handlers/validation.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)
💤 Files with no reviewable changes (3)
  • pkg/handlers/framework_test.go
  • pkg/handlers/framework.go
  • pkg/handlers/name_validation_handler_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • CLAUDE.md
  • AGENTS.md
  • pkg/handlers/resource_status_handler.go
  • pkg/handlers/resource_handler.go

Comment thread pkg/handlers/CLAUDE.md
Comment thread pkg/handlers/CLAUDE.md Outdated
Comment thread pkg/handlers/CLAUDE.md Outdated
Comment thread pkg/handlers/helpers_test.go
Comment thread pkg/handlers/helpers_test.go
Comment thread pkg/handlers/helpers_test.go
Comment thread pkg/handlers/helpers.go Outdated
Comment thread pkg/handlers/helpers.go Outdated
Comment thread pkg/handlers/resource_handler_test.go Outdated
@ma-hill
ma-hill force-pushed the HYPERFLEET-1369 branch 2 times, most recently from 475e10a to 479bea8 Compare July 28, 2026 17:05
Comment thread pkg/handlers/CLAUDE.md
@ma-hill
ma-hill marked this pull request as draft July 29, 2026 17:50
@ma-hill
ma-hill marked this pull request as ready for review July 29, 2026 17:55
@openshift-ci
openshift-ci Bot requested a review from tirthct July 29, 2026 17:55
Comment thread AGENTS.md Outdated
@@ -127,12 +126,6 @@ Use `pkg/logger/` — `logger.Info(ctx, "msg")`, `logger.With(ctx, "key", val).E

### Handlers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

### Handlers heading is empty, falls straight through to ### Services. Either fill it in (see CLAUDE.md's ### Handler Pipeline) or remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment thread pkg/handlers/CLAUDE.md
Apply `?fields=` query parameter filtering:

```go
result, svcErr := applyFieldFilter(r, presenters.PresentResource(resource))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if err != nil checks an undefined variable, the assignment above is svcErr. Would fail to compile if copied verbatim.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants