Skip to content

Conversation

@graphite-app
Copy link
Contributor

@graphite-app graphite-app bot commented Jan 8, 2026

This draft PR was created by the Graphite merge queue.
Trunk will be fast forwarded to the HEAD of this PR when CI passes, and the original PRs will be closed.

The following PRs are included in this draft PR:

@railway-app
Copy link

railway-app bot commented Jan 8, 2026

This PR was not deployed automatically as @graphite-app[bot] does not have access to the Railway project.

In order to get automatic PR deploys, please add @graphite-app[bot] to your workspace on Railway.

@railway-app
Copy link

railway-app bot commented Jan 8, 2026

This PR was not deployed automatically as @graphite-app[bot] does not have access to the Railway project.

In order to get automatic PR deploys, please add @graphite-app[bot] to your workspace on Railway.

@graphite-app graphite-app bot closed this Jan 8, 2026
@railway-app railway-app bot temporarily deployed to rivet-frontend / production January 8, 2026 21:34 Inactive
@graphite-app graphite-app bot deleted the gtmq_spec_3b92cd_1767908064999-f1875aa4-3ba2-4c0e-a00a-3255b0a52751 branch January 8, 2026 21:34
@claude
Copy link

claude bot commented Jan 8, 2026

Pull Request Review: Graphite MQ Draft PR (3786, 3787, 3789)

This draft PR merges three PRs that include CI improvements, a bug fix, and configuration refactoring. Here's my detailed review:

Summary of Changes

PR #3786: CI Updates for pkg.pr.new

  • Updates GitHub workflow to include shared/typescript/* packages
  • Excludes @rivetkit/example-registry from builds
  • Upgrades Next.js from 15.4.10 to 16.1.1 in examples

PR #3787: Handler Binding Fix

  • Fixes a critical bug by binding the handler to the Registry instance in serve()

PR #3789: Configuration Logic Refactoring

  • Renames advertiseEndpoint to clientEndpoint for clarity
  • Simplifies the configuration logic by consolidating serverless and runner config paths
  • Fixes default logic for serveManager behavior

Code Quality & Best Practices

✅ Positive Aspects

  1. Handler Binding Fix (PR fix(rivetkit): bind handler to Registry in serve #3787): The change from this.handler to this.handler.bind(this) is correct and prevents potential bugs when the method loses its context.

    // rivetkit-typescript/packages/rivetkit/src/registry/index.ts:95
    return { fetch: this.handler.bind(this) };
  2. Configuration Simplification: The refactoring in PR fix(rivetkit): fix default logic for serveManager & advertiseEndpoint #3789 removes code duplication by unifying the serverless and runner configuration logic paths.

  3. Better Naming: clientEndpoint is clearer than advertiseEndpoint - it better describes the endpoint that clients should use.

  4. Consistent Error Messages: The error messages were updated consistently across the codebase when renaming the configuration property.

⚠️ Concerns & Issues

1. Breaking Change Without Migration Path

The rename from advertiseEndpoint to clientEndpoint is a breaking change for existing users. There's no deprecation warning or migration guide.

Recommendation: Consider adding a deprecation path:

// In ServerlessConfigSchema
.transform((config, ctx) => {
  if ('advertiseEndpoint' in config) {
    ctx.addIssue({
      code: 'custom',
      message: 'advertiseEndpoint is deprecated, use clientEndpoint instead',
      path: ['advertiseEndpoint'],
    });
  }
  return config;
})

2. OpenAPI Schema Changes Not Validated

The rivetkit-openapi/openapi.json file has 445 additions with new error types. These changes appear to be auto-generated but weren't explicitly mentioned in the PR descriptions.

Recommendation:

  • Verify these schema changes are intentional
  • Ensure they're properly generated from code
  • Check that API clients won't break with these additions

3. Potential Runtime Issue in Display Logic

In rivetkit-typescript/packages/rivetkit/src/registry/index.ts:247, the display logic now uses:

config.endpoint ?? config.serverless.clientEndpoint

This could display undefined if both are missing, though the validation should prevent this.

Recommendation: Add a fallback or assertion:

config.endpoint ?? config.serverless.clientEndpoint ?? "not configured"

4. Next.js Version Jump

Upgrading from Next.js 15.4.10 to 16.1.1 is a major version bump with potential breaking changes.

Concerns:

  • Next.js 16 has a minimum Node.js version requirement of >=20.9.0 (up from ^18.18.0 || ^19.8.0 || >= 20.0.0)
  • This could break for users on Node.js 18 or 19
  • Should be tested thoroughly with the example applications

Recommendation:

  • Document this change and the new Node.js requirement
  • Test examples thoroughly
  • Consider if this should be a separate PR with proper testing

5. Missing Test Coverage

None of the three PRs include test updates for the changes made:

  • No tests for the binding fix behavior
  • No tests for the new configuration logic
  • No tests for the renamed clientEndpoint property

Recommendation: Add tests for:

// Test handler binding preserves context
describe('Registry.serve', () => {
  it('should bind handler to registry instance', async () => {
    // Verify 'this' context is preserved
  });
});

// Test config validation
describe('RegistryConfigSchema', () => {
  it('should validate clientEndpoint in production', () => {
    // Test the validation logic
  });
});

Performance Considerations

No significant performance concerns. The changes are mostly structural and shouldn't impact runtime performance.

Security Concerns

⚠️ OpenAPI Schema Additions

The new error types in the OpenAPI schema include detailed error information:

"http_error": {
  "status_code": { "type": "number" },
  "body": { "type": "string" }
}

Concern: Ensure that error bodies don't leak sensitive information in production environments.

Recommendation: Review error handling to ensure sensitive data isn't exposed in error messages.

Style & Conventions

The code follows the project's conventions based on CLAUDE.md:

  • ✅ Uses hard tabs (consistent with rustfmt.toml mention)
  • ✅ Follows existing patterns
  • ✅ Proper imports at file top

However:

  • ⚠️ The commented-out code in next-js/src/mod.ts and cloudflare-workers/src/mod.ts should be removed if no longer needed

Test Coverage

Major Gap: No test coverage for any of the changes in these three PRs.

Recommendation: Before merging, add tests for:

  1. Handler binding behavior
  2. Configuration validation logic
  3. clientEndpoint vs advertiseEndpoint migration
  4. The simplified configuration transform logic

Recommendations Summary

Critical (Must Address)

  1. Add test coverage for all three PRs
  2. Test Next.js 16 upgrade thoroughly with example apps
  3. Document breaking change for advertiseEndpointclientEndpoint
  4. Validate OpenAPI schema changes are correct and complete

Important (Should Address)

  1. Add deprecation path for advertiseEndpoint
  2. Add fallback for undefined endpoint display
  3. Document Node.js version requirement change
  4. Remove commented code if unused

Nice to Have

  1. Add migration guide for users upgrading
  2. Consider splitting the Next.js upgrade into a separate PR

Conclusion

The changes are generally well-structured and improve code clarity. However, the lack of test coverage, undocumented breaking changes, and a major dependency upgrade bundled together are concerning. I recommend addressing the critical items before merging to trunk.

Overall Assessment: ⚠️ Needs work before merging

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