Skip to content

feat: define protos for kranes gateway management#4364

Merged
chronark merged 1 commit intomainfrom
11-19-feat_define_protos_for_kranes_gateway_management
Nov 20, 2025
Merged

feat: define protos for kranes gateway management#4364
chronark merged 1 commit intomainfrom
11-19-feat_define_protos_for_kranes_gateway_management

Conversation

@chronark
Copy link
Copy Markdown
Collaborator

@chronark chronark commented Nov 19, 2025

What does this PR do?

Adds a new protobuf definition for the Krane Gateway Service. This includes:

  • Service definition with CreateGateway, GetGateway, and DeleteGateway RPCs
  • Message definitions for gateway requests and responses
  • Gateway status enum to track deployment states (pending, running, terminating)
  • Instance representation with ID, address, and status

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • Verify the protobuf compiles correctly
  • Check that the generated Go code matches the expected interface
  • Ensure the service definition aligns with the planned Gateway implementation

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Ran make fmt on /go directory
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Nov 19, 2025

⚠️ No Changeset found

Latest commit: 8d0122f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 19, 2025

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

Project Deployment Preview Comments Updated (UTC)
dashboard Ready Ready Preview Comment Nov 19, 2025 10:19pm
engineering Ready Ready Preview Comment Nov 19, 2025 10:19pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 19, 2025

📝 Walkthrough

Walkthrough

Introduces a new protobuf definition file for Krane v1 Gateway API, defining the GatewayService with three RPC operations (CreateGateway, GetGateway, DeleteGateway) and supporting message types for gateway lifecycle management including status tracking and instance information.

Changes

Cohort / File(s) Summary
Proto Service Definition
go/proto/krane/v1/gateway.proto
Adds GatewayService with three RPCs: CreateGateway, GetGateway, DeleteGateway. Defines GatewayRequest with namespace, workspace_id, gateway_id, image, replicas, cpu_millicores, memory_size_mib fields. Introduces request/response message pairs for each RPC operation, GatewayStatus enum (UNSPECIFIED, PENDING, RUNNING, TERMINATING), and GatewayInstance type with id, address, status fields.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant GatewayService
    
    rect rgb(200, 220, 240)
    Note over Client,GatewayService: Create Gateway Lifecycle
    Client->>GatewayService: CreateGateway(CreateGatewayRequest)
    GatewayService-->>Client: CreateGatewayResponse (status: PENDING)
    end
    
    rect rgb(200, 220, 240)
    Note over Client,GatewayService: Retrieve Gateway State
    Client->>GatewayService: GetGateway(GetGatewayRequest)
    GatewayService-->>Client: GetGatewayResponse (instances: [GatewayInstance])
    end
    
    rect rgb(200, 220, 240)
    Note over Client,GatewayService: Delete Gateway
    Client->>GatewayService: DeleteGateway(DeleteGatewayRequest)
    GatewayService-->>Client: DeleteGatewayResponse (empty)
    end
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Proto definitions are declarative and relatively straightforward
  • New service introduces standard CRUD-like operations with clear semantics
  • Single file addition with no cross-file dependencies to verify
  • Message field types and enum values should be validated for correctness and naming conventions

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: introducing protobuf definitions for Krane's gateway management service.
Description check ✅ Passed The description covers required template sections including what the PR does, type of change, testing approach, and a completed checklist with all required items marked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 11-19-feat_define_protos_for_kranes_gateway_management

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.

Copy link
Copy Markdown
Collaborator Author

chronark commented Nov 19, 2025

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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73521da and 8d0122f.

📒 Files selected for processing (1)
  • go/proto/krane/v1/gateway.proto (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Flo4604
Repo: unkeyed/unkey PR: 4190
File: go/internal/services/keys/verifier.go:51-53
Timestamp: 2025-10-30T15:10:52.743Z
Learning: PR #4190 for unkeyed/unkey is focused solely on database schema and query changes for identity-based credits. It adds IdentityCredits and KeyCredits fields to structs and queries, but does not implement the priority enforcement logic in the usagelimiter. The logic implementation is intentionally deferred to a later PR in the stack.
🪛 Buf (1.60.0)
go/proto/krane/v1/gateway.proto

3-3: Files with package "krane.v1" must be within a directory "krane/v1" relative to root but were in directory "go/proto/krane/v1".

(PACKAGE_DIRECTORY_MATCH)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Go API Local / Test
  • GitHub Check: Build / Build
🔇 Additional comments (2)
go/proto/krane/v1/gateway.proto (2)

61-72: LGTM on enum and message definitions.

The GatewayStatus enum is well-structured with meaningful comments for each state, and the GatewayInstance message is properly typed. Good use of proto3 best practices (UNSPECIFIED default value).


1-5: The Buf lint error claim in this review is incorrect.

The file location and package declaration are correct. All proto files in go/proto/ follow the same structure: go/proto/{package_part1}/{package_part2}/{file}.proto with package {package_part1}.{package_part2}. The Buf module root is configured as proto/ in go/buf.yaml, making krane/v1/gateway.proto relative to the module root, which perfectly matches the package krane.v1. This pattern is consistently used across all proto files (cache/v1, ctrl/v1, vault/v1, etc.) without errors.

However, there is a valid concern: UpdateGatewayRequest and UpdateGatewayResponse messages are defined (lines 38–39) but no corresponding UpdateGateway RPC exists in the GatewayService. Either add the RPC to the service or remove the unused messages.

Likely an incorrect or invalid review comment.

@chronark chronark mentioned this pull request Nov 20, 2025
19 tasks
@chronark chronark merged commit f74ce8c into main Nov 20, 2025
51 checks passed
@chronark chronark deleted the 11-19-feat_define_protos_for_kranes_gateway_management branch November 20, 2025 13:37
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