Skip to content

badges: match DID-object subjects and recipient responses - #34

Merged
Kzoeps merged 4 commits into
mainfrom
badges/fix-did-subject-matching
Oct 7, 2026
Merged

Kzoeps merged 4 commits into
mainfrom
badges/fix-did-subject-matching

Conversation

@Kzoeps

@Kzoeps Kzoeps commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Match schema-correct app.certified.defs#did subject objects in listBadgeAwards, preserving legacy bare-string and strong-reference subject behavior.
  • Derive recipient DIDs from those objects in list/getBadgeAward so matching accepted/rejected responses do not incorrectly appear unanswered.
  • Preserve subject OR grouping, cross-filter AND behavior, recipient author, exact award URI/CID, eligible response status, and latest-response selection.
  • Regenerate both handlers, extend unit/HTTP fixtures and assertions, and add a patch Changeset. Existing schemas and docs already describe the intended contract.

Validation

  • Final independent review: no confirmed findings; review-driven test gaps addressed.
  • Focused badge unit suite: 18 passed.
  • Generated bundles, Lua lint (55 files), syntax for two changed bundles, changed JS syntax, and diff checks passed.

Validation limitations

  • HTTP/PostgreSQL tests, including new behavioral fixtures, were not run: Docker daemon unavailable.
  • Broader unit checks have 16 missing-dependency setup failures; fixture import validation, ESLint, and Changesets CLI validation were unavailable without workspace dependencies.
  • No dependency installs or production requests performed.

Summary by CodeRabbit

  • Bug Fixes

    • Badge award retrieval and filtering now recognize recipients represented as DID objects, while continuing to support legacy DID strings and record-based subjects.
    • Response status lookups now match eligible responses to the correct recipient and award, including rejected and unanswered statuses.
  • Tests

    • Expanded coverage for recipient formats, award versions, response authors, statuses, and pagination.

@changeset-bot

changeset-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 16a6979

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hypercerts-org/hypercerts-api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api-endpoints Ready Ready Preview Oct 7, 2026 10:51am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eb35ab3c-8620-4856-9acd-7f6f8aea63dc
📥 Commits

Reviewing files that changed from the base of the PR and between be3b36d and 16a6979.

📒 Files selected for processing (8)
  • .changeset/bright-badges-match-did-subjects.md
  • api/lua/endpoints/getBadgeAward.lua
  • api/lua/endpoints/listBadgeAwards.lua
  • api/lua/src/getBadgeAward.lua
  • api/lua/src/listBadgeAwards.lua
  • api/tests/http/badge-queries.http.test.js
  • api/tests/http/fixtures/badge-queries.fixture.js
  • api/tests/unit/tooling/badge-queries.test.js

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bb7a4d85-35b0-488e-9a49-1cfdab9342b9
📥 Commits

Reviewing files that changed from the base of the PR and between fd96994 and dda4eb1.

📒 Files selected for processing (8)
  • .changeset/bright-badges-match-did-subjects.md
  • api/lua/endpoints/getBadgeAward.lua
  • api/lua/endpoints/listBadgeAwards.lua
  • api/lua/src/getBadgeAward.lua
  • api/lua/src/listBadgeAwards.lua
  • api/tests/http/badge-queries.http.test.js
  • api/tests/http/fixtures/badge-queries.fixture.js
  • api/tests/unit/tooling/badge-queries.test.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Badge award queries now extract recipients from typed DID subject objects and match those subjects in award filters. Existing string and URI handling remains. Unit and HTTP tests cover award and response matching.

Changes

Badge recipient matching

Layer / File(s) Summary
Recognize typed DID subjects
api/lua/endpoints/getBadgeAward.lua, api/lua/endpoints/listBadgeAwards.lua, api/lua/src/getBadgeAward.lua, api/lua/src/listBadgeAwards.lua
Get and list award queries extract DIDs from typed subject objects. List filters match both typed DID objects and string subjects; URI-based fallback handling remains.
Validate award and response matching
api/tests/http/fixtures/badge-queries.fixture.js, api/tests/http/badge-queries.http.test.js, api/tests/unit/tooling/badge-queries.test.js, .changeset/bright-badges-match-did-subjects.md
Fixtures and tests cover typed DID subjects, recipient responses, award and response links, response statuses, and pagination. A patch changeset describes the recipient-matching change.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to be3b3

The supplied evidence identifies no issue blocking this badge-matching change. Run the HTTP/PostgreSQL tests when the environment is available.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 7 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: matching DID-object subjects and recipient responses in badge queries.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 7 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@Kzoeps
Kzoeps merged commit 1d86964 into main Oct 7, 2026
7 of 8 checks passed
@Kzoeps
Kzoeps deleted the badges/fix-did-subject-matching branch October 7, 2026 10:54
@github-actions github-actions Bot mentioned this pull request Oct 7, 2026

This branch was successfully deployed

1 active deployment
Preview — 16a6979f Deployed Oct 7, 2026 by vercel[bot]
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