Skip to content

Conversation

@dahlia
Copy link
Member

@dahlia dahlia commented Dec 25, 2025

This makes the KvStore.list() method required in Fedify 2.0.0.

The method was added as optional in 1.10.0 (#498, #500) to give existing implementations time to add support. Since all official KvStore implementations already support this method, it is now required.

See CHANGES.md and docs/manual/kv.md for details.

Closes #499.

This is a breaking change for Fedify 2.0.0. The list() method was added
as optional in 1.10.0 to give existing implementations time to add support.
All official KvStore implementations already support this method.

Changes:

- Update KvStore interface to make list() required
- Add list() to MockKvStore and test mocks
- Simplify FedifySpanExporter by removing cas()-only fallback path
- Remove non-null assertions from all list() calls in tests
- Update documentation to reflect the change

Closes fedify-dev#499

Co-Authored-By: Claude <noreply@anthropic.com>
@dahlia dahlia requested a review from Copilot December 25, 2025 07:57
@dahlia dahlia added this to the Fedify 2.0 milestone Dec 25, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dahlia, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request formalizes the KvStore.list() method as a required part of the KvStore interface in Fedify 2.0.0. This change, driven by the fact that all official KvStore implementations already support this functionality, aims to simplify the API, remove conditional logic, and ensure a consistent feature set across all key-value store integrations.

Highlights

  • KvStore.list() Method Now Required: The list() method in the KvStore interface has transitioned from optional to mandatory for Fedify 2.0.0.
  • API Consistency: This change ensures all KvStore implementations consistently support key listing, as all official implementations already do.
  • Documentation and Code Updates: Relevant documentation (CHANGES.md, docs/manual/kv.md) and code (interface definition, test files, FedifySpanExporter) have been updated to reflect this new requirement.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request makes the KvStore.list() method required, which is a significant step for Fedify 2.0.0. The changes are well-executed across the codebase, including updating the KvStore interface, removing fallback logic that relied on the optional nature of the method, and updating tests to remove non-null assertions. The documentation has also been updated to reflect this change. I've suggested a minor wording improvement in the documentation to make the requirement clearer for developers implementing the KvStore interface. Overall, this is a solid pull request.

Copy link

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

This PR makes the KvStore.list() method required in Fedify 2.0.0, completing the transition that began in version 1.10.0 when the method was introduced as optional. The change simplifies the codebase by removing conditional logic and allowing all code to rely on the list() method being present.

  • Removes optional marker from KvStore.list() method signature
  • Updates all test files to remove non-null assertion operators (!)
  • Adds list() implementation to mock KvStore instances used in tests
  • Simplifies FedifySpanExporter by removing fallback logic for stores without list()

Reviewed changes

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

Show a summary per file
File Description
packages/fedify/src/federation/kv.ts Updates interface to make list() required instead of optional
packages/fedify/src/utils/kv-cache.ts Adds list() implementation to MockKvStore
packages/fedify/src/utils/kv-cache.test.ts Adds list() to test KvStore implementation
packages/fedify/src/otel/exporter.ts Removes conditional logic for optional list(), simplifies implementation
packages/fedify/src/otel/exporter.test.ts Updates tests to remove cas-only test case, adds list() to custom KvStore
packages/sqlite/src/kv.test.ts Removes non-null assertion operators from list() calls
packages/redis/src/kv.test.ts Removes non-null assertion operators from list() calls
packages/postgres/src/kv.test.ts Removes non-null assertion operators from list() calls
packages/fedify/src/federation/kv.test.ts Removes non-null assertion operators from list() calls
packages/denokv/src/mod.test.ts Removes non-null assertion operators from list() calls
packages/cfworkers/test/kv.test.ts Removes non-null assertion operators from list() calls
docs/manual/kv.md Updates documentation to reflect list() as required method
CHANGES.md Adds changelog entry for breaking change

@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

❌ Patch coverage is 58.33333% with 10 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/fedify/src/utils/kv-cache.ts 0.00% 10 Missing ⚠️
Files with missing lines Coverage Δ
packages/fedify/src/federation/kv.ts 89.87% <ø> (ø)
packages/fedify/src/otel/exporter.ts 86.15% <100.00%> (+1.61%) ⬆️
packages/fedify/src/utils/kv-cache.ts 82.07% <0.00%> (-8.55%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dahlia and others added 3 commits December 25, 2025 17:03
Add required list() method stubs to MyCustomKvStore examples in the
KvStore documentation to satisfy the KvStore interface requirements.
Also increase Node.js memory limit for docs build to prevent OOM errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@sij411 sij411 left a comment

Choose a reason for hiding this comment

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

It looks good :)

@dahlia dahlia merged commit a30e1ef into fedify-dev:next Dec 25, 2025
17 of 19 checks passed
@dahlia dahlia linked an issue Dec 25, 2025 that may be closed by this pull request
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.

Make KvStore.list() required in 2.0.0

2 participants