Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

feat: Add NotApplicable benchmark result type - #228

Merged
lightwalker-eth merged 38 commits into
mainfrom
y3drk/feat/add-not-applicable-benchmark-result-type
Jun 18, 2026
Merged

feat: Add NotApplicable benchmark result type#228
lightwalker-eth merged 38 commits into
mainfrom
y3drk/feat/add-not-applicable-benchmark-result-type

Conversation

@Y3drk

@Y3drk Y3drk commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Lite PR → Add NotApplicable benchmark result type

Summary

  • Added new BenchmarkResult type → NotApplicable:
    • The EnsAwardsScore calculating functions handle them the same way as the Pending benchmarks (explicitly exclude them when counting the score, unless only this type of benchmark is available)
    • The code was adapted to allow a special display of them in the UI → added a new interface EnsAwardsScoreResult that should help in distinguishing between different outcomes of score calculation)
  • Found the apps whose benchmarks fall into that new category and changed their results to NotApplicable (basically all apps that do not use ENS at all)

Why


Testing

  • Ran typecheck, lint, and test commands locally to ensure that the migration didn't break anything, and later confirmed that in our CI workflow
  • Verified that the UI didn't break after introducing changes using a local and Vercel previews.

Notes for Reviewer (Optional)

  • For now, I set this PR up to be merged into PR feat: Add new apps -- exchanges #227 because it reflects the latest state of the app. We should be able to merge both of these PRs separately into main without any problems, but the current setup should make the review easier.

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.

@Y3drk Y3drk self-assigned this Jun 15, 2026
Copilot AI review requested due to automatic review settings June 15, 2026 15:16
@Y3drk Y3drk added the ensawards ENSAwards related label Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 561207c5-2086-4a44-9af8-95fa6e731805

📥 Commits

Reviewing files that changed from the base of the PR and between b9e008b and be62cf9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • CONTRIBUTING.md
  • ensawards.org/data/acceptance-tests/types.ts
  • ensawards.org/data/acceptance-tests/utils.test.ts
  • ensawards.org/data/acceptance-tests/utils.ts
  • ensawards.org/data/apps/binance-exchange/benchmarks/index.tsx
  • ensawards.org/data/apps/utils.ts
  • ensawards.org/data/benchmarks/utils.test.ts
  • ensawards.org/data/benchmarks/utils.ts
  • ensawards.org/data/ens-best-practices/utils.test.ts
  • ensawards.org/data/ens-best-practices/utils.ts
  • ensawards.org/package.json

📝 Walkthrough

Walkthrough

Adds BenchmarkResults.NotApplicable ("not-applicable") as a new benchmark result value and introduces EnsAwardsScoreResult with labeled undefined states (Pending, NotApplicable, InactiveCategory) to replace scalar score contracts. All scoring functions now return this structured result type with optional labels. Eight app benchmark entries are reclassified from Fail to NotApplicable. All score display components migrate from optional scalar score props to required scoreResult props with conditional label rendering.

Changes

NotApplicable Benchmark Result and Score-Result Migration

Layer / File(s) Summary
Core contracts: types, labels, and documentation
ensawards.org/data/benchmarks/types.ts, ensawards.org/data/acceptance-tests/types.ts, ensawards.org/data/shared/ens-awards-score.ts, CONTRIBUTING.md
Adds NotApplicable: "not-applicable" to BenchmarkResults, introduces NotApplicableAcceptanceTestBenchmark and ApplicableAcceptanceTestBenchmark union, and defines EnsAwardsScoreResult, EnsAwardsUndefinedScoreLabels, EnsAwardsUndefinedScoreLabel, and formatEnsAwardsUndefinedScoreLabel in the shared score module.
Benchmark aggregation and generalization logic
ensawards.org/data/benchmarks/utils.ts, ensawards.org/data/benchmarks/utils.test.ts, ensawards.org/data/acceptance-tests/utils.ts, ensawards.org/data/acceptance-tests/utils.test.ts
Narrows calcEnsAwardsPoints to AcceptanceTestBenchmarkApplicable, refactors calcBestPracticeCategoryScore to return EnsAwardsScoreResult with Pending/NotApplicable/InactiveCategory labeled states, extends generalizeAcceptanceTestBenchmarks to return NotApplicable when all defined benchmarks are not applicable, adds NotApplicable to result ordering and formatting, and strengthens all related test coverage.
Best-practice and app scoring result-shape migration
ensawards.org/data/ens-best-practices/utils.ts, ensawards.org/data/ens-best-practices/utils.test.ts, ensawards.org/data/apps/utils.ts, ensawards.org/data/apps/utils.test.ts
Migrates calcBestPracticeScore and calcAppScore to return EnsAwardsScoreResult with labeled undefined states, adds calcNotApplicableAppBenchmarks helper and NotApplicable-aware tie-breaking in sortApps, expands test fixtures to cover new result shapes and tie-break scenarios.
App benchmark reclassification from Fail to NotApplicable
ensawards.org/data/apps/binance-exchange/benchmarks/index.tsx, ensawards.org/data/apps/binance-wallet/benchmarks/index.tsx, ensawards.org/data/apps/cryptocom-exchange/benchmarks/index.tsx, ensawards.org/data/apps/kraken-exchange/benchmarks/index.tsx, ensawards.org/data/apps/okx-exchange/benchmarks/index.tsx, ensawards.org/data/apps/readyx-wallet/benchmarks/index.tsx, ensawards.org/data/apps/robinhood-exchange/benchmarks/index.tsx, ensawards.org/data/apps/robinhood-wallet/benchmarks/index.tsx, ensawards.org/data/apps/worldapp-wallet/benchmarks/index.tsx
Reclassifies ENSv2 correctly-resolve-ensv2-test-name-address benchmarks from BenchmarkResults.Fail to NotApplicable across eight apps and updates accompanying notes text to reflect not-applicable scenarios instead of failures.
Score display primitives and badge components
ensawards.org/src/components/atoms/ens-awards-score/bar.tsx, ensawards.org/src/components/atoms/ens-awards-score/circular-small.tsx, ensawards.org/src/components/atoms/ens-awards-score/circular.astro, ensawards.org/src/components/atoms/CircularScore.astro, ensawards.org/src/components/atoms/badges/BenchmarkResultBadge.tsx, ensawards.org/src/components/atoms/badges/BenchmarkResultHeroBadge.astro, ensawards.org/src/components/atoms/icons/AllBenchmarksNotApplicableIcon.tsx, ensawards.org/src/components/atoms/cards/bestPracticeCard/BestPracticeAppSupport.astro
Migrates all score display primitives from optional scalar score to required scoreResult props with label-based undefined rendering, removes EnsAwardsBarScorePending component, adds NotApplicable visual treatment and icons to benchmark badges, introduces AllBenchmarksNotApplicableIcon, and introduces BestPracticeAppSupport for encapsulated score/label rendering.
Card, organism, and page wiring to scoreResult
ensawards.org/src/components/atoms/cards/AppSummaryCard.tsx, ensawards.org/src/components/atoms/cards/LeaderboardCard.astro, ensawards.org/src/components/atoms/cards/bestPracticeCard/index.astro, ensawards.org/src/components/organisms/AppBestPracticeDetails.astro, ensawards.org/src/components/organisms/ProtocolBestPracticeDetails.astro, ensawards.org/src/pages/app/[appSlug]/index.astro, ensawards.org/src/pages/ens-best-practices/index.astro, ensawards.org/src/pages/index.astro, ensawards.org/src/pages/leaderboards/[protocolType].astro, ensawards.org/src/pages/protocol/[protocolSlug].astro
Updates all card, organism, and page consumers to pass scoreResult objects to score components, wraps protocol and leaderboard scores in EnsAwardsScoreResultDefined shape, updates imports, and removes unused imports.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • namehash/ensawards#204: Introduced the acceptance-test benchmark model and generalizeAcceptanceTestBenchmarks; this PR directly extends that utility and AcceptanceTest typings to incorporate the new BenchmarkResults.NotApplicable state.
  • namehash/ensawards#127: Modifies protocol leaderboard rendering in ProtocolBestPracticeDetails.astro; this PR updates the same component to wrap leaderboard scores in the new EnsAwardsScoreResult shape.
  • namehash/ensawards#164: Updates benchmark badge UI components (BenchmarkResultBadge/BenchmarkResultHeroBadge); this PR extends those same components to handle the new NotApplicable state visually.

🐇 A new result hops into town,
Not a pass, not a fail — not applicable, crown!
NotApplicable joins the score-result queue,
Labeled undefined states give a clearer view! 🏷️
The leaderboard shines, the badges glow bright,
This bunny declares the rollout just right! ✨

🚥 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: introducing a new NotApplicable benchmark result type, which is the primary objective of the changeset.
Description check ✅ Passed The description is directly related to the changeset, covering the new NotApplicable type introduction, its handling in score calculations, applications to affected apps, and validation testing.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch y3drk/feat/add-not-applicable-benchmark-result-type

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 and usage tips.

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
ensawards.org Ready Ready Preview, Comment Jun 18, 2026 9:34am

Copilot AI 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.

Pull request overview

This PR introduces a new benchmark outcome, BenchmarkResults.NotApplicable, and threads it through scoring + UI so entities with only non-applicable benchmarks are excluded from scoring (similar to pending), while still being displayed with a distinct “Not Applicable” state.

Changes:

  • Added NotApplicable to benchmark/acceptance-test types and generalized-result formatting/sorting.
  • Updated app/best-practice/category scoring to exclude NotApplicable benchmarks and return an EnsAwardsScoreResult (score + optional label for undefined scores).
  • Updated UI score components and benchmark badges/icons to display undefined-score labels and a dedicated Not Applicable indicator.

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
ensawards.org/src/pages/index.astro Adjusts leaderboard card prop shape for protocol scores.
ensawards.org/src/pages/app/[appSlug]/index.astro Uses EnsAwardsScoreResult for app + category score display.
ensawards.org/src/components/organisms/AppBestPracticeDetails.astro Updates score bar props and undefined-score styling hook.
ensawards.org/src/components/atoms/icons/AllBenchmarksNotApplicableIcon.tsx Adds a UI icon for the “all benchmarks not applicable” state.
ensawards.org/src/components/atoms/ens-awards-score/circular.astro Switches circular score wrapper to scoreResult input.
ensawards.org/src/components/atoms/ens-awards-score/circular-small.tsx Updates small circular score to support undefined-score labels + NA icon.
ensawards.org/src/components/atoms/ens-awards-score/bar.tsx Converts bar score UI to consume EnsAwardsScoreResult and display labels.
ensawards.org/src/components/atoms/ens-awards-score/bar-pending.tsx Removes separate “pending bar” component (now handled via labels).
ensawards.org/src/components/atoms/CircularScore.astro Updates core circular score component to accept scoreResult and display labels.
ensawards.org/src/components/atoms/cards/LeaderboardCard.astro Changes leaderboard card score prop to EnsAwardsScoreResult.
ensawards.org/src/components/atoms/cards/BestPracticeCard.astro Updates best-practice card to use ScoreBar with scoreResult.
ensawards.org/src/components/atoms/cards/AppSummaryCard.tsx Wires app/category score displays to scoreResult props.
ensawards.org/src/components/atoms/badges/BenchmarkResultHeroBadge.astro Adds hero badge rendering for NotApplicable.
ensawards.org/src/components/atoms/badges/BenchmarkResultBadge.tsx Adds badge styles + icon mapping for NotApplicable.
ensawards.org/src/assets/benchmarkNotApplicableSymbol.svg Adds NA symbol used by hero badge.
ensawards.org/data/shared/ens-awards-score.ts Introduces EnsAwardsScoreResult and undefined-score label constants.
ensawards.org/data/ens-best-practices/utils.ts Makes best-practice scoring exclude NotApplicable and return EnsAwardsScoreResult.
ensawards.org/data/ens-best-practices/utils.test.ts Updates tests for new best-practice score result shape.
ensawards.org/data/benchmarks/utils.ts Excludes NotApplicable in category scoring; formats/sorts NA benchmark results.
ensawards.org/data/benchmarks/utils.test.ts Extends unit tests for NA scoring and sorting behavior.
ensawards.org/data/benchmarks/types.ts Adds BenchmarkResults.NotApplicable.
ensawards.org/data/apps/worldapp-wallet/benchmarks/index.tsx Migrates benchmark(s) to NotApplicable.
ensawards.org/data/apps/utils.ts Updates app score calc to return EnsAwardsScoreResult and exclude NA.
ensawards.org/data/apps/utils.test.ts Updates app utils tests for NA-aware scoring/sorting.
ensawards.org/data/apps/robinhood-wallet/benchmarks/index.tsx Migrates benchmark(s) to NotApplicable.
ensawards.org/data/apps/robinhood-exchange/benchmarks/index.tsx Migrates benchmark(s) to NotApplicable.
ensawards.org/data/apps/readyx-wallet/benchmarks/index.tsx Migrates benchmark(s) to NotApplicable.
ensawards.org/data/apps/okx-exchange/benchmarks/index.tsx Migrates benchmark(s) to NotApplicable.
ensawards.org/data/apps/kraken-exchange/benchmarks/index.tsx Migrates benchmark(s) to NotApplicable.
ensawards.org/data/apps/cryptocom-exchange/benchmarks/index.tsx Migrates benchmark(s) to NotApplicable.
ensawards.org/data/apps/binance-wallet/benchmarks/index.tsx Migrates benchmark(s) to NotApplicable.
ensawards.org/data/apps/binance-exchange/benchmarks/index.tsx Migrates benchmark(s) to NotApplicable.
ensawards.org/data/acceptance-tests/utils.ts Updates benchmark generalization rules to recognize NotApplicable.
ensawards.org/data/acceptance-tests/utils.test.ts Adds/updates tests for NA generalization cases.
ensawards.org/data/acceptance-tests/types.ts Adds NotApplicableAcceptanceTestBenchmark and ApplicableAcceptanceTestBenchmark.
CONTRIBUTING.md Documents new NotApplicable result and benchmark type additions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ensawards.org/src/components/atoms/cards/LeaderboardCard.astro
Comment thread ensawards.org/src/components/atoms/ens-awards-score/circular.astro
Comment thread ensawards.org/data/acceptance-tests/utils.ts
Comment thread ensawards.org/data/acceptance-tests/utils.ts
Comment thread ensawards.org/src/components/atoms/ens-awards-score/circular-small.tsx Outdated
Comment thread ensawards.org/src/components/atoms/CircularScore.astro Outdated
Comment thread ensawards.org/data/benchmarks/utils.ts
Comment thread ensawards.org/src/components/atoms/cards/BestPracticeCard.astro Outdated
Comment thread CONTRIBUTING.md

@vercel vercel Bot left a comment

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.

Additional Suggestions:

  1. Type mismatch: LeaderboardCard expects EnsAwardsScoreResult (object) but receives EnsAwardsScore (number) in two files, causing build failure with "Either score or label must be defined in scoreResult. Both are undefined."
  1. Multiple components pass plain numbers (EnsAwardsScore) where objects (EnsAwardsScoreResult) are expected, causing runtime invariant errors during build.

Fix on Vercel

Copilot AI 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.

⚠️ Not ready to approve

A newly added Tailwind class (bg-black/8) for NotApplicable badge styling is likely not generated by default Tailwind opacity scales and should be adjusted to a supported/arbitrary opacity value.

Copilot's findings

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 41/43 changed files
  • Comments generated: 2

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment thread ensawards.org/src/components/atoms/badges/BenchmarkResultBadge.tsx
Comment thread ensawards.org/data/acceptance-tests/types.ts Outdated
Comment thread ensawards.org/data/apps/utils.test.ts Fixed

Copilot AI 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.

⚠️ Not ready to approve

calcBestPracticeScore currently assigns a non-type-guard .filter(...) result to ApplicableAcceptanceTestBenchmark[], which is type-unsafe and can break TypeScript typechecking.

Copilot's findings
  • Files reviewed: 40/41 changed files
  • Comments generated: 4

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment thread ensawards.org/data/ens-best-practices/utils.ts Outdated
Comment thread ensawards.org/data/benchmarks/utils.ts Outdated
Comment thread ensawards.org/data/apps/binance-exchange/benchmarks/index.tsx Outdated
Comment thread ensawards.org/data/ens-best-practices/utils.test.ts Outdated

@lightwalker-eth lightwalker-eth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Y3drk Thanks for these updates! Reviewed and shared feedback 👍

Comment thread ensawards.org/data/acceptance-tests/types.ts Outdated
Comment thread ensawards.org/data/acceptance-tests/types.ts Outdated

/**
* Optional additional styles to apply to the pending score state.
* Optional additional styles to apply to the undefined score state.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Y3drk Hey can you message me in Slack to help confirm what will be changing about the possible "pending" score state? Want to make sure we continue to support this possibility. "Pending" is different than "Not Applicable". "Not Applicable" requires that we actually performed the benchmark and then decided it was NA. However "Pending" means something different: that we haven't performed the benchmark at all yet.

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.

Answered on slack

)}
>
<p className="text-muted-foreground text-sm leading-normal font-normal">ENSAwards score</p>
<p className="text-sm leading-normal font-medium text-black">Pending</p>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Worried that "Pending" is being removed?

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.

That component was unused either way. All the necessary logic is included in the atoms/ens-awards-score/bar.tsx

Comment thread ensawards.org/data/apps/utils.ts Outdated
label: EnsAwardsUndefinedScoreLabels.Pending,
};

const completedApplicableAcceptanceTestBenchmarks: ApplicableAcceptanceTestBenchmark[] =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A "Not Applicable" benchmark is a benchmark that has been completed. You have to complete a benchmark to decide it is "Not Applicable".

Only "Pending" benchmarks haven't been completed yet.

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.

Yes, that's reflected in the refactored data model.

This list variable holds the benchmarks that are both completed (so all pending ones are filtered out) and applicable at the same time (so the completed but not-applicable ones are filtered out as well).

Appreciate the advice about the terminology, but overall, the logic you described above is implemented exactly like that.

benchmark.result !== BenchmarkResults.NotApplicable,
);

if (completedApplicableAcceptanceTestBenchmarks.length === 0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CleanShot 2026-06-18 at 11 07 07

Hmm, not sure if I'm understanding this correctly?

In my mind we never want to display "Not Applicable" in the context shown in this screenshot.

"Not Applicable" only applies to specific benchmarks, but here is an aggregate score for an entire app.

If all benchmarks for an app are pending and/or "Not Applicable" then the aggregate score for the entire app should reflect "Pending", not "Not Applicable".

CleanShot 2026-06-18 at 11 20 33

This field for the overall score of an app should also never show "Not Applicable". In the case shown here it should show "Pending"

CleanShot 2026-06-18 at 11 22 34

This field for the score of an app within a category should be able to support "Not Applicable". What is shown in this screenshot makes sense. There's only 1 best practice in the category. That one best practice is "Not Applicable" therefore the whole category is "Not Applicable".

However, for an overall app it should never be "Not Applicable". That sounds like we made a mistake to add the app to ENSAwards at all. For an overall app if the only ratings we have are "Pending" or "Not Applicable", the overall app score should still be "Pending".

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.

Applied a refactor so that these requirements are applied

image image image

@lightwalker-eth lightwalker-eth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Y3drk Thanks for your updates. Looks good! 🫡

@lightwalker-eth
lightwalker-eth merged commit 380086f into main Jun 18, 2026
10 checks passed
@lightwalker-eth
lightwalker-eth deleted the y3drk/feat/add-not-applicable-benchmark-result-type branch June 18, 2026 10:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ensawards ENSAwards related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants