Skip to content

chore(ens-referrals): Update readme#1849

Merged
Y3drk merged 15 commits intomainfrom
y3drk/chore/update-referral-program-edition-defaults
Apr 9, 2026
Merged

chore(ens-referrals): Update readme#1849
Y3drk merged 15 commits intomainfrom
y3drk/chore/update-referral-program-edition-defaults

Conversation

@Y3drk
Copy link
Copy Markdown
Contributor

@Y3drk Y3drk commented Mar 31, 2026

Lite PR → Update readme (previously → Update referral program edition defaults)


Summary


Why


Testing

  • Ran the test, typecheck & lint commands locally to make sure that the changes didn't break anything
  • Confirmed the above with our CI workflow in this PR
  • Reviewed the new docs section on my own and via LLM

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

@Y3drk Y3drk self-assigned this Mar 31, 2026
Copilot AI review requested due to automatic review settings March 31, 2026 13:42
@Y3drk Y3drk added the ensanalytics ENSAnalytics related label Mar 31, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: b8f105f

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

This PR includes changesets to release 24 packages
Name Type
@namehash/ens-referrals Major
ensapi Major
ensindexer Major
ensadmin Major
ensrainbow Major
fallback-ensapi Major
enssdk Major
enscli Major
enskit Major
ensskills Major
@ensnode/datasources Major
@ensnode/ensrainbow-sdk Major
@ensnode/ensdb-sdk Major
@ensnode/ensnode-react Major
@ensnode/ensnode-sdk Major
@ensnode/ponder-sdk Major
@ensnode/ponder-subgraph Major
@ensnode/shared-configs Major
@docs/ensnode Major
@docs/ensrainbow Major
@docs/mintlify Major
@namehash/namehash-ui Major
@ensnode/enskit-react-example Patch
@ensnode/integration-test-env 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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

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

Updated Referral Program default editions to match production: replaced prior entries with three editions (2025-12, 2026-04, 2026-05), adjusted rules URLs and rev-share limits, added Changesets, updated README example, and added Vitest coverage validating defaults against production JSON.

Changes

Cohort / File(s) Summary
Changesets Entry
\.changeset/tough-sites-greet.md, \.changeset/loose-news-sin.md
Added Changeset files declaring minor bumps for @namehash/ens-referrals noting alignment with production edition settings and that tests were added.
Edition Defaults Configuration
packages/ens-referrals/src/v1/edition-defaults.ts
Replaced prior edition array with three editions: 2025-12, 2026-04 (was 2026-03, rev-share limit reduced), and new 2026-05; updated rules URLs, rev-share values, date windows, local variable names, and return order.
Documentation Example
packages/ens-referrals/README.md
Updated README example to reference edition slugs ["2025-12", "2026-04"].
Tests
packages/ens-referrals/src/v1/edition-defaults.test.ts
Added Vitest suite that optionally fetches production-editions.json and asserts local defaults match production slugs and key fields, validates structural invariants, and checks unsupported-namespace error handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

ensnode-internal

Poem

🐰 I hopped through configs, neat and spry,

April rose where March waved goodbye,
May arrived with rules in tow,
URLs set and rev-shares low,
A tiny thump — editions aligned, hi-ho!

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ⚠️ Warning The PR title 'chore(ens-referrals): Update readme' mentions only the README update, but the actual scope is much broader: it updates edition defaults, adds comprehensive tests, modifies configuration, and updates the changelog. Update the title to reflect the primary objective: 'chore(ens-referrals): Update referral program edition defaults' would better capture the main scope of the changes.
Description check ⚠️ Warning The PR description omits substantial implementation details. It claims only README changes, but the PR actually updates edition defaults code, adds comprehensive tests, and includes two changeset entries. Update the description to accurately reflect all changes: edition defaults updates, new test suite, README example update, and both changeset entries. Align with the actual Lite PR template structure.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch y3drk/chore/update-referral-program-edition-defaults

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
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 31, 2026

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

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
admin.ensnode.io Skipped Skipped Apr 8, 2026 8:53am
ensnode.io Skipped Skipped Apr 8, 2026 8:53am
ensrainbow.io Skipped Skipped Apr 8, 2026 8:53am

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the @namehash/ens-referrals v1 default referral program edition configuration set so local/default behavior matches the current production editions configuration used by ENS Awards.

Changes:

  • Renamed and adjusted the default edition configs (updated slugs, display names, rule URLs, and parameters).
  • Removed the prior “2026-03” default and added “2026-04” and “2026-05” rev-share-limit editions with updated pool/qualification values.
  • Added a Changesets entry to publish the update.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/ens-referrals/src/v1/edition-defaults.ts Updates the built-in default edition set (editions, dates, rule URLs, and award parameters).
.changeset/tough-sites-greet.md Declares the release bump for the defaults update.

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@packages/ens-referrals/src/v1/edition-defaults.ts`:
- Around line 75-79: Add a unit-level parity test that calls
buildReferralProgramEditionConfigSet with the production namespace editions
(e.g., december2025Edition, april2026Edition, may2026Edition) and compares the
resulting config set against a checked-in JSON fixture: assert slug,
startTimestamp, endTimestamp, award values, and rules URL(s) match exactly;
store the expected output as a fixture (committed) and fail the test on any
drift so changes to edition-defaults.ts can be verified locally and in CI
without deploying ENSApi.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: dd812cf4-a8a2-411a-8dbd-032d75ff2ffa

📥 Commits

Reviewing files that changed from the base of the PR and between ab1750c and f02d544.

📒 Files selected for processing (2)
  • .changeset/tough-sites-greet.md
  • packages/ens-referrals/src/v1/edition-defaults.ts

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

Documentation examples reference removed edition slug "2026-03" which no longer exists in the default edition configuration

Fix on Vercel

@vercel vercel bot temporarily deployed to Preview – ensnode.io March 31, 2026 14:55 Inactive
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io March 31, 2026 14:55 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io March 31, 2026 14:55 Inactive
Copilot AI review requested due to automatic review settings March 31, 2026 14:56
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io March 31, 2026 14:56 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io March 31, 2026 14:57 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io March 31, 2026 14:57 Inactive
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ens-referrals/src/v1/edition-defaults.test.ts`:
- Around line 14-34: The test suite calls fetchProductionEditions which performs
a live HTTP fetch from PRODUCTION_EDITIONS_URL and hard-fails on network errors;
replace that live dependency with a pinned fixture: add a JSON fixture (e.g.,
test/fixtures/production-editions.json) and modify the suite to load that
fixture instead of calling fetchProductionEditions; keep fetchProductionEditions
for any separate integration check but move the live parity comparison into a
separate scheduled/integration test (or mark it with a tag like `@integration`)
and remove the top-level throw so unit tests use only the local fixture when
invoking getDefaultReferralProgramEditionConfigSet.
- Around line 29-31: The describe callback is async and awaits
fetchProductionEditions, which breaks Vitest collection; make the describe
callback synchronous, declare a top-level mutable variable (e.g., let
productionEditions) inside the describe, add a beforeAll hook that awaits
fetchProductionEditions and assigns its result to that variable, and update
existing tests to use the variable; specifically remove async/await from the
describe block that references fetchProductionEditions and move the async call
into beforeAll so fetchProductionEditions runs during setup instead of during
test collection.
- Line 20: Replace the unsafe cast to ReferralProgramEditionConfig[] by parsing
the JSON through the Zod-backed deserializer: import
deserializeReferralProgramEditionConfigSetArray from "./api/deserialize" (or
named import) and return deserializeReferralProgramEditionConfigSetArray(await
response.json()) from fetchProductionEditions (the location currently doing "as
ReferralProgramEditionConfig[]") so runtime validation and clear errors are
produced instead of an unchecked type cast.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4d712c31-923d-4ef6-9a7e-46cc2b31844d

📥 Commits

Reviewing files that changed from the base of the PR and between f02d544 and 621556e.

📒 Files selected for processing (2)
  • packages/ens-referrals/README.md
  • packages/ens-referrals/src/v1/edition-defaults.test.ts

@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io March 31, 2026 15:33 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io April 1, 2026 05:59 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io April 1, 2026 05:59 Inactive
describe("getDefaultReferralProgramEditionConfigSet", () => {
const configSet = getDefaultReferralProgramEditionConfigSet(ENSNamespaceIds.Mainnet);

describe("Should match production editions", () => {
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.

Wouldn't this fail every time we introduce some changes to default editions or even the edition model? My concern is that for these tests to pass we need to modify the production setup. Or is it intended to be handled backwards? We first modify the production, and only then modify the defaults? What is the strategy here?

Copilot AI review requested due to automatic review settings April 8, 2026 08:39
@Y3drk Y3drk changed the title chore(ens-referrals): Update referral program edition defaults chore(ens-referrals): Update readme Apr 8, 2026
@Y3drk
Copy link
Copy Markdown
Contributor Author

Y3drk commented Apr 8, 2026

Old description (for reference)

Summary

  • Updated the Referral Program edition defaults to match the production configuration (see packages\ens-referrals\src\v1\edition-defaults.ts)
  • Added unit tests that verify the general correctness of the edition defaults as well as them being up-to-date with the production config (see packages\ens-referrals\src\v1\edition-defaults.test.ts)
  • Adapted a packages\ens-referrals\README.md example to match new defaults

Why


Testing

  • Ran the test, typecheck & lint commands locally to make sure that the changes didn't break anything
  • Confirmed the above with our CI workflow in this PR
  • The code changes were validated against the production data in https://ensawards.org/production-editions.json
  • Self-review of code changes after pushing to remote
  • Added unit tests should further validate the new changes

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


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

@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io April 8, 2026 08:45 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io April 8, 2026 08:45 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io April 8, 2026 08:45 Inactive
Copilot AI review requested due to automatic review settings April 8, 2026 08:53
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io April 8, 2026 08:53 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io April 8, 2026 08:53 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io April 8, 2026 08:53 Inactive
@Y3drk
Copy link
Copy Markdown
Contributor Author

Y3drk commented Apr 8, 2026

@greptileai

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


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

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 8, 2026

Tip:

Greploops — Automatically fix all review issues by running /greploops in Claude Code. It iterates: fix, push, re-review, repeat until 5/5 confidence.

Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal.

Copy link
Copy Markdown
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@Y3drk Looks good 👍 Please take the lead to merge when ready

@Y3drk Y3drk merged commit 5c2dc68 into main Apr 9, 2026
28 of 30 checks passed
@Y3drk Y3drk deleted the y3drk/chore/update-referral-program-edition-defaults branch April 9, 2026 06:17
@github-actions github-actions bot mentioned this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ensanalytics ENSAnalytics related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Referral Program Edition Defaults

4 participants