Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

chore(core): add actor names to metadata endpoint#1387

Closed
NathanFlurry wants to merge 1 commit into10-13-fix_next-js_fix_auto-configure_in_prodfrom
10-13-chore_core_add_actor_names_to_metadata_endpoint
Closed

chore(core): add actor names to metadata endpoint#1387
NathanFlurry wants to merge 1 commit into10-13-fix_next-js_fix_auto-configure_in_prodfrom
10-13-chore_core_add_actor_names_to_metadata_endpoint

Conversation

@NathanFlurry
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Oct 14, 2025

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

Project Deployment Preview Comments Updated (UTC)
rivetkit-serverless Ready Ready Preview Comment Oct 14, 2025 9:32pm

@claude
Copy link

claude bot commented Oct 14, 2025

Claude finished @NathanFlurry's task —— View job


Pull Request Review

Reviewed this PR to add actor names to metadata endpoint. Here's my comprehensive analysis:

Todo List:

  • Read repository guidelines (CLAUDE.md)
  • Analyze changed files and understand the implementation
  • Review code quality and best practices
  • Check for potential bugs or issues
  • Assess performance considerations
  • Look for security concerns
  • Evaluate test coverage needs
  • Provide comprehensive feedback

Code Quality & Best Practices ✅

Positive aspects:

  • Clean, well-structured implementation following RivetKit conventions
  • Proper TypeScript typing throughout
  • Consistent naming conventions (camelCase for functions, PascalCase for types)
  • Good separation of concerns with buildActorNames utility function
  • Follows repository guidelines for imports and code structure

Areas for consideration:

  • The buildActorNames function in packages/rivetkit/src/registry/config.ts:34-40 returns a simple structure with empty metadata. Consider if this placeholder structure provides sufficient value or if additional actor metadata should be included.

Implementation Analysis

What this PR does:

  1. Adds a new buildActorNames function that extracts actor names from registry config
  2. Integrates this function into the /metadata endpoint response
  3. Updates the MetadataResponse interface to include actorNames field
  4. Imports the new function in relevant router files

Files changed:

  • packages/rivetkit/src/registry/config.ts: New buildActorNames function
  • packages/rivetkit/src/common/router.ts: Updated interface and metadata handler
  • packages/rivetkit/src/manager/router.ts: Added import for buildActorNames
  • packages/rivetkit/src/drivers/engine/actor-driver.ts: Added import for buildActorNames
  • examples/counter-serverless/src/server.ts: Minor formatting change

Potential Issues 🔍

Minor concerns:

  1. Unused import potential: The import of buildActorNames in packages/rivetkit/src/drivers/engine/actor-driver.ts:36 may be unused since it's only used in the metadata endpoint handlers. Need to verify if this driver uses it elsewhere.

  2. Empty metadata structure: The current implementation returns { metadata: {} } for each actor. While this provides a foundation for future expansion, consider documenting the intended use case for this metadata field.

Performance Considerations ⚡

Positive aspects:

  • buildActorNames is computationally lightweight (O(n) where n = number of actors)
  • Uses Object.fromEntries and Object.keys efficiently
  • No expensive operations or external API calls

Recommendations:

  • Consider caching the result if the registry config is static during runtime
  • Current implementation is fine for typical actor counts, but monitor if registries grow very large

Security Concerns 🔒

Analysis:

  • No security issues identified
  • The function only exposes actor names (which are typically not sensitive)
  • No user input processing or data validation concerns
  • Follows principle of least privilege by only exposing necessary information

Test Coverage 📋

Current state:

  • No tests added for the new buildActorNames function
  • No tests for the updated metadata endpoint response

Recommendations:

  • Add unit tests for buildActorNames function in packages/rivetkit/src/registry/config.test.ts
  • Add integration tests to verify the metadata endpoint includes actor names
  • Test edge cases like empty registry config

Example test cases needed:

describe('buildActorNames', () => {
  it('should return actor names with empty metadata', () => {
    const config = { use: { actor1: {}, actor2: {} } };
    const result = buildActorNames(config);
    expect(result).toEqual({
      actor1: { metadata: {} },
      actor2: { metadata: {} }
    });
  });

  it('should handle empty registry', () => {
    const config = { use: {} };
    const result = buildActorNames(config);
    expect(result).toEqual({});
  });
});

Minor Code Style Notes 📝

  1. Line 36 in actor-driver.ts: Verify if the buildActorNames import is actually used in this file
  2. Documentation: Consider adding JSDoc comments to the buildActorNames function explaining its purpose and return structure

Overall Assessment ✨

This is a solid, well-implemented feature that adds useful metadata to the endpoint. The code follows RivetKit conventions and doesn't introduce any significant issues. The main areas for improvement are around test coverage and potentially verifying import usage.

Recommendation: Approve with minor suggestions - The implementation is clean and functional, with only minor improvements suggested around testing and documentation.


Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 14, 2025

More templates

@rivetkit/actor

pnpm add https://pkg.pr.new/rivet-dev/rivetkit/@rivetkit/actor@1387

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivetkit/@rivetkit/cloudflare-workers@1387

@rivetkit/core

pnpm add https://pkg.pr.new/rivet-dev/rivetkit/@rivetkit/core@1387

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-dev/rivetkit/@rivetkit/db@1387

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivetkit/@rivetkit/framework-base@1387

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivetkit/@rivetkit/next-js@1387

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivetkit/@rivetkit/react@1387

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivetkit@1387

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivetkit/@rivetkit/sql-loader@1387

commit: 6729567

@graphite-app
Copy link

graphite-app bot commented Oct 14, 2025

Merge activity

  • Oct 14, 10:39 PM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Oct 14, 10:39 PM UTC: CI is running for this pull request on a draft pull request (#1388) due to your merge queue CI optimization settings.
  • Oct 14, 10:40 PM UTC: Merged by the Graphite merge queue via draft PR: #1388.

@graphite-app graphite-app bot closed this Oct 14, 2025
@graphite-app graphite-app bot deleted the 10-13-chore_core_add_actor_names_to_metadata_endpoint branch October 14, 2025 22:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant