Skip to content

FEAT: Add groupDescription, sync Unserved with 3 new codes - #13

Merged
kishorereddy merged 1 commit into
mainfrom
fix/260803-group-and-codes
Aug 4, 2026
Merged

FEAT: Add groupDescription, sync Unserved with 3 new codes#13
kishorereddy merged 1 commit into
mainfrom
fix/260803-group-and-codes

Conversation

@kishorereddy

Copy link
Copy Markdown
Contributor

Overview

  1. New groupDescription field: a runtime-readable explanation for each status category.
  2. KDoc cleanup: class docs now point at groupDescription instead of restating it.
  3. 3 new codes: DEGRADED, LEGAL_BLOCK, ABORTED added to Unserved, closing a gRPC gap.

Ticket(s)

N/A

Link(s)

N/A

Example(s)

Restricted.DENIED.groupDescription
// "An access-control failure — the caller is not permitted to perform this action."

// ABORTED now maps directly to gRPC's own ABORTED code
CodesToGrpc().toCode(Unserved.ABORTED) // 10, was an honest null gap before

Dependencies

None.

Design

  1. groupDescription: added to Passed and Failed, same pattern group already uses —
    makes each category's meaning a real runtime value instead of only living in a KDoc comment.
  2. KDoc trimmed: most subtypes now just point at groupDescription. Kept the genuinely useful
    extra detail on Excluded (the SKIPPED/DISCARDED naming note) and Unserved (the example
    list), rather than deleting everything uniformly.
  3. DEGRADED: a dependency is degraded, some calls may be refused.
  4. LEGAL_BLOCK: access restricted for legal/regulatory reasons. Maps to HTTP 451.
  5. ABORTED: operation aborted before completing, retrying may succeed. Maps directly to
    gRPC's own ABORTED (10) — gRPC now has full 0-16 coverage, no more gaps.
  6. Registry is now 57 codes total.

Notes

  1. Left Excluded.CANCELLED's message wording and LEGAL_BLOCK's category placement alone —
    both still open questions, not settled enough to bundle into this change.

Pending

None.

Tests

  1. Added tests for groupDescription (non-blank, distinct per category, consistent per subtype).
  2. Added tests for the 3 new codes and their protocol mappings, including the deliberate
    category-default fallthrough for DEGRADED/LEGAL_BLOCK on gRPC.
  3. Replaced the old "ABORTED maps to null" test with one confirming the real mapping.
  4. Full ktlintCheck + detekt + jvmTest + jsNodeTest run clean.

@kishorereddy
kishorereddy merged commit 92b1f09 into main Aug 4, 2026
1 check passed
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