Skip to content

Conversation

@2chanhaeng
Copy link
Contributor

Summary

This PR ensures that all interface properties across the codebase are marked as readonly to enforce immutability.

Related Issue

Changes

  • Applied readonly modifier to properties in interfaces.

Benefits

  • Immutability: Prevents accidental mutations of object properties, leading to safer and more predictable code.
  • Type Safety: strict type checking prevents reassignment of properties that should not change after creation.

Checklist

  • Did you add a changelog entry to the CHANGES.md?
  • Did you write some relevant docs about this change (if it's a new feature)?
  • Did you write a regression test to reproduce the bug (if it's a bug fix)?
  • Did you write some tests for this change (if it's a new feature)?
  • Did you run mise test on your machine?

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @2chanhaeng, 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 significantly improves the robustness and predictability of the codebase by enforcing immutability on interface properties. By marking these properties as readonly, the system gains enhanced type safety and reduces the likelihood of unintended side effects, making the code easier to reason about and maintain. This change is a foundational step towards a more resilient and error-resistant architecture.

Highlights

  • Immutability Enforcement: All interface properties across the codebase are now marked with the readonly modifier to enforce immutability, preventing accidental modifications after object creation.
  • Improved Type Safety: The introduction of readonly properties enhances type safety by ensuring that properties intended to be constant cannot be reassigned, leading to more predictable code behavior.
  • Codebase-Wide Application: This change has been systematically applied to numerous interfaces and function parameters across various modules, including message queues, federation contexts, KV stores, and NodeInfo types.
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 does a great job of enforcing immutability by adding readonly to interface properties throughout the codebase. This is a significant improvement for type safety and makes the code more predictable. The changes are consistent and well-executed. I also appreciate the refactorings to a more functional style of object creation, which aligns perfectly with the goal of immutability. I have one minor suggestion for a small efficiency improvement.

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

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

Files with missing lines Patch % Lines
packages/fedify/src/nodeinfo/types.ts 40.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
packages/amqp/src/mq.ts 90.97% <100.00%> (ø)
packages/fedify/src/federation/collection.ts 100.00% <ø> (ø)
packages/fedify/src/federation/handler.ts 83.42% <100.00%> (ø)
packages/fedify/src/federation/kv.ts 89.87% <ø> (ø)
packages/fedify/src/federation/middleware.ts 95.23% <ø> (ø)
packages/fedify/src/federation/mq.ts 92.80% <100.00%> (ø)
packages/fedify/src/federation/send.ts 97.95% <ø> (ø)
packages/fedify/src/federation/webfinger.ts 81.52% <100.00%> (-0.10%) ⬇️
packages/fedify/src/nodeinfo/client.ts 96.64% <100.00%> (+0.12%) ⬆️
packages/fedify/src/otel/exporter.ts 85.82% <100.00%> (-0.33%) ⬇️
... and 8 more
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@dahlia dahlia merged commit 15dea3c into fedify-dev:next Jan 14, 2026
16 checks passed
@2chanhaeng 2chanhaeng deleted the readonly branch January 14, 2026 08:08
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.

2 participants