Skip to content

feat: scrape and diff openapi.yaml#3632

Merged
Flo4604 merged 6 commits intomainfrom
07-18-feat_scrape_and_diff_openapi.yaml
Jul 22, 2025
Merged

feat: scrape and diff openapi.yaml#3632
Flo4604 merged 6 commits intomainfrom
07-18-feat_scrape_and_diff_openapi.yaml

Conversation

@chronark
Copy link
Collaborator

@chronark chronark commented Jul 18, 2025

What does this PR do?

This PR adds OpenAPI specification support to the deployment workflow, enabling automatic scraping and storage of OpenAPI specs from deployed containers. It also implements a new OpenAPI service with a diff feature that can compare two API versions to identify breaking changes and modifications.

Key changes:

  • Adds OpenAPI spec scraping during the deployment workflow
  • Implements a new OpenAPI service with a GetOpenApiDiff endpoint
  • Updates the database schema to store OpenAPI specifications
  • Enhances the demo API with an OpenAPI spec endpoint
  • Adds utilities to convert between OpenAPI diff formats and protobuf

Type of change

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

How should this be tested?

  • Deploy a version with an API that exposes an OpenAPI spec at /openapi.yaml The default demo api does this already
  • Verify the OpenAPI spec is scraped and stored in the database
  • Use the new OpenAPI diff service to compare two versions
curl -X POST \
    -H "Content-Type: application/json" \
    -d '{
      "old_version_id": "v_2FMSVv",
      "new_version_id": "v_3Vt65h"
    }' \
    http://localhost:7091/ctrl.v1.OpenApiService/GetOpenApiDiff | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   447  100   369  100    78   109k  23708 --:--:-- --:--:-- --:--:--  145k
{
  "summary": {
    "diff": true,
    "details": {
      "endpoints": {
        "modified": 1
      },
      "paths": {
        "modified": 1
      },
      "schemas": {}
    }
  },
  "hasBreakingChanges": true,
  "changes": [
    {
      "id": "response-property-type-changed",
      "text": "the 'message' response's property type/format changed from 'number'/'' to 'string'/'' for status '200'",
      "level": 3,
      "operation": "GET",
      "operationId": "getHello",
      "path": "/hello"
    }
  ]
}

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
  • 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

Summary by CodeRabbit

  • New Features

    • Added automated scraping and storage of OpenAPI specifications for deployed versions.
    • Introduced an API endpoint to retrieve and compare OpenAPI specs between two versions, highlighting changes and breaking updates.
    • Added a new endpoint in the demo API to serve its OpenAPI YAML specification.
  • Database

    • Extended the versions table with an openapi_spec column to store OpenAPI specs.
  • API

    • Introduced new gRPC and REST endpoints for OpenAPI diff comparison, including detailed change summaries.
  • Dependency Updates

    • Added and updated dependencies to support OpenAPI diffing and schema handling.

@changeset-bot
Copy link

changeset-bot bot commented Jul 18, 2025

⚠️ No Changeset found

Latest commit: b194d4a

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

vercel bot commented Jul 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 10:22am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
engineering ⬜️ Ignored (Inspect) Visit Preview Jul 22, 2025 10:22am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 18, 2025

Warning

Rate limit exceeded

@chronark has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 2eacb07 and b194d4a.

📒 Files selected for processing (1)
  • internal/db/src/schema/projects.ts (1 hunks)
📝 Walkthrough

"""

Walkthrough

This change introduces OpenAPI specification support throughout the system. It adds the ability to scrape, store, and retrieve OpenAPI specs for deployed versions, extends the database schema and queries to persist specs, and implements a new gRPC service and protobuf definitions for OpenAPI diffing. Supporting handlers, conversion utilities, and dependency updates are included.

Changes

File(s) / Path(s) Change Summary
go/apps/ctrl/run.go Registers a new OpenAPI service handler and refactors handler registration for conciseness.
go/apps/ctrl/services/openapi/convert.go
get_diff.go
service.go
utils.go
Introduces a new openapi service package: conversion utilities, diff endpoint implementation, service struct, and OpenAPI spec loader.
go/apps/ctrl/services/version/deploy_workflow.go Extends deployment workflow: health checks, scrapes OpenAPI spec from container, stores spec in DB.
go/demo_api/main.go Adds /openapi.yaml HTTP handler serving a static OpenAPI 3.0.3 spec for demo API.
go/go.mod Adds/updates dependencies for OpenAPI diffing and parsing.
go/pkg/db/models_generated.go Adds OpenapiSpec field to Version struct.
go/pkg/db/querier_generated.go
version_find_by_id.sql_generated.go
version_insert.sql_generated.go
Updates queries and structs to support the new openapi_spec column.
go/pkg/db/queries/version_find_by_id.sql
version_insert.sql
Extends SQL queries to include the openapi_spec column.
go/pkg/db/queries/version_update_openapi_spec.sql
version_update_openapi_spec.sql_generated.go
Adds new SQL query and Go method for updating openapi_spec by version ID.
go/pkg/db/schema.sql Adds openapi_spec column to versions table.
go/proto/ctrl/v1/openapi.proto Introduces new protobuf definitions and gRPC service for OpenAPI diffing.
internal/db/src/schema/versions.ts Adds openapiSpec column to the versions table schema in TypeScript.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CtrlAPI
    participant OpenApiService
    participant DB
    participant DeployedContainer

    User->>CtrlAPI: Deploy new version
    CtrlAPI->>DeployedContainer: Health check (/v1/liveness)
    CtrlAPI->>DeployedContainer: Fetch OpenAPI spec (/openapi.yaml)
    DeployedContainer-->>CtrlAPI: Returns OpenAPI YAML
    CtrlAPI->>DB: Store OpenAPI spec in versions table
    DB-->>CtrlAPI: Ack

    User->>OpenApiService: GetOpenApiDiff(old_version_id, new_version_id)
    OpenApiService->>DB: Load old version's OpenAPI spec
    OpenApiService->>DB: Load new version's OpenAPI spec
    OpenApiService->>OpenApiService: Parse specs, diff, check for breaking changes
    OpenApiService-->>User: Returns diff summary, breaking changes flag, changelog
Loading

Estimated code review effort

3 (~45 minutes)

Suggested reviewers

  • perkinsjr
  • mcstepp
  • MichaelUnkey
  • ogzhanolguncu
    """
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Collaborator Author

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 18, 2025

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
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: 6

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd4f010 and 8ffb566.

⛔ Files ignored due to path filters (3)
  • go/gen/proto/ctrl/v1/ctrlv1connect/openapi.connect.go is excluded by !**/gen/**
  • go/gen/proto/ctrl/v1/openapi.pb.go is excluded by !**/*.pb.go, !**/gen/**
  • go/go.sum is excluded by !**/*.sum
📒 Files selected for processing (19)
  • go/apps/ctrl/run.go (2 hunks)
  • go/apps/ctrl/services/openapi/convert.go (1 hunks)
  • go/apps/ctrl/services/openapi/get_diff.go (1 hunks)
  • go/apps/ctrl/services/openapi/service.go (1 hunks)
  • go/apps/ctrl/services/openapi/utils.go (1 hunks)
  • go/apps/ctrl/services/version/deploy_workflow.go (2 hunks)
  • go/demo_api/main.go (2 hunks)
  • go/go.mod (3 hunks)
  • go/pkg/db/models_generated.go (1 hunks)
  • go/pkg/db/querier_generated.go (4 hunks)
  • go/pkg/db/queries/version_find_by_id.sql (1 hunks)
  • go/pkg/db/queries/version_insert.sql (2 hunks)
  • go/pkg/db/queries/version_update_openapi_spec.sql (1 hunks)
  • go/pkg/db/schema.sql (1 hunks)
  • go/pkg/db/version_find_by_id.sql_generated.go (3 hunks)
  • go/pkg/db/version_insert.sql_generated.go (6 hunks)
  • go/pkg/db/version_update_openapi_spec.sql_generated.go (1 hunks)
  • go/proto/ctrl/v1/openapi.proto (1 hunks)
  • internal/db/src/schema/versions.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (17)
📓 Common learnings
Learnt from: Flo4604
PR: unkeyed/unkey#3421
File: go/apps/api/openapi/openapi.yaml:196-200
Timestamp: 2025-07-03T05:58:10.699Z
Learning: In the Unkey codebase, OpenAPI 3.1 is used, which allows sibling keys (such as `description`) alongside `$ref` in schema objects. Do not flag this as an error in future reviews.
Learnt from: Flo4604
PR: unkeyed/unkey#2955
File: go/apps/api/routes/v2_identities_create_identity/handler.go:162-202
Timestamp: 2025-03-19T09:25:59.751Z
Learning: In the Unkey codebase, input validation for API endpoints is primarily handled through OpenAPI schema validation, which occurs before requests reach the handler code. For example, in the identities.createIdentity endpoint, minimum values for ratelimit duration and limit are defined in the OpenAPI schema rather than duplicating these checks in the handler.
go/pkg/db/schema.sql (1)
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
go/pkg/db/queries/version_find_by_id.sql (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
go/pkg/db/models_generated.go (1)
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
internal/db/src/schema/versions.ts (2)
Learnt from: chronark
PR: unkeyed/unkey#3161
File: go/pkg/clickhouse/schema/databases/001_verifications/002_raw_key_verifications_v1.sql:31-33
Timestamp: 2025-04-22T14:40:51.459Z
Learning: The ClickHouse table schemas in the codebase mirror the production environment and cannot be modified directly in PRs without careful migration planning.
Learnt from: chronark
PR: unkeyed/unkey#2294
File: apps/api/src/pkg/keys/service.ts:268-271
Timestamp: 2024-10-20T07:05:55.471Z
Learning: In `apps/api/src/pkg/keys/service.ts`, `ratelimitAsync` is a table relation, not a column selection. When querying, ensure that table relations are included appropriately, not as columns.
go/pkg/db/version_find_by_id.sql_generated.go (3)
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's `*.go` code changes significantly, increase the patch-level version number.
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
go/apps/ctrl/services/openapi/service.go (1)
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/*/cmd/*/** : Service binary code should be located at `<service>/cmd/<service | command>`.
go/pkg/db/queries/version_insert.sql (2)
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
go/apps/ctrl/run.go (3)
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's `*.go` code changes significantly, increase the patch-level version number.
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/*/cmd/*/** : Service binary code should be located at `<service>/cmd/<service | command>`.
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
go/pkg/db/version_insert.sql_generated.go (2)
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
go/go.mod (3)
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's `*.go` code changes significantly, increase the patch-level version number.
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/prometheus/metrics/database.go:29-30
Timestamp: 2025-07-16T10:06:35.397Z
Learning: In Go packages, variables defined in one file within a package (like `latencyBuckets` and `constLabels` in go/pkg/prometheus/metrics/http.go) are accessible from other files in the same package without requiring imports. This is a common pattern for sharing configuration across multiple files within a package.
go/pkg/db/version_update_openapi_spec.sql_generated.go (3)
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's `*.go` code changes significantly, increase the patch-level version number.
go/pkg/db/queries/version_update_openapi_spec.sql (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
go/pkg/db/querier_generated.go (2)
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
go/apps/ctrl/services/openapi/get_diff.go (1)
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's `*.go` code changes significantly, increase the patch-level version number.
go/proto/ctrl/v1/openapi.proto (1)
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's `*.go` code changes significantly, increase the patch-level version number.
go/apps/ctrl/services/version/deploy_workflow.go (5)
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's `*.go` code changes significantly, increase the patch-level version number.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#3564
File: go/cmd/cli/commands/deploy/deploy.go:153-158
Timestamp: 2025-07-16T09:18:45.379Z
Learning: In the go/cmd/cli/commands/deploy/ CLI codebase, ogzhanolguncu prefers to allow deployment to continue even when Docker push fails (around lines 153-158 in deploy.go) because the team is working locally and needs this behavior for local development workflows where registry access might not be available.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
🧬 Code Graph Analysis (4)
go/apps/ctrl/services/openapi/service.go (2)
go/gen/proto/ctrl/v1/ctrlv1connect/openapi.connect.go (2)
  • UnimplementedOpenApiServiceHandler (109-109)
  • UnimplementedOpenApiServiceHandler (111-113)
internal/db/src/index.ts (1)
  • Database (13-13)
go/apps/ctrl/run.go (5)
go/gen/proto/ctrl/v1/ctrlv1connect/service.connect.go (1)
  • NewCtrlServiceHandler (90-105)
go/apps/ctrl/services/openapi/service.go (1)
  • New (15-21)
go/apps/ctrl/services/version/service.go (1)
  • New (17-24)
go/gen/proto/ctrl/v1/ctrlv1connect/version.connect.go (1)
  • NewVersionServiceHandler (113-136)
go/gen/proto/ctrl/v1/ctrlv1connect/openapi.connect.go (1)
  • NewOpenApiServiceHandler (91-106)
go/pkg/db/version_update_openapi_spec.sql_generated.go (1)
go/pkg/hydra/store/db.go (2)
  • Queries (19-21)
  • DBTX (8-13)
go/apps/ctrl/services/openapi/convert.go (1)
go/gen/proto/ctrl/v1/openapi.pb.go (12)
  • DiffSummary (160-166)
  • DiffSummary (179-179)
  • DiffSummary (194-196)
  • DiffCounts (272-279)
  • DiffCounts (292-292)
  • DiffCounts (307-309)
  • DiffDetails (212-219)
  • DiffDetails (232-232)
  • DiffDetails (247-249)
  • ChangelogEntry (76-86)
  • ChangelogEntry (99-99)
  • ChangelogEntry (114-116)
🪛 Buf (1.55.1)
go/proto/ctrl/v1/openapi.proto

3-3: Files with package "ctrl.v1" must be within a directory "ctrl/v1" relative to root but were in directory "go/proto/ctrl/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). (5)
  • GitHub Check: Test Go API Local / Test
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Build / Build
  • GitHub Check: Test Agent Local / test_agent_local
  • GitHub Check: Test Packages / Test
🔇 Additional comments (19)
go/pkg/db/schema.sql (1)

387-387: Schema change looks good.

The addition of the openapi_spec text column to the versions table is well-designed:

  • text type appropriately handles potentially large OpenAPI specifications
  • Nullable field allows for versions without OpenAPI specs
  • Follows established naming conventions and placement within the schema
go/pkg/db/models_generated.go (1)

874-874: Generated model correctly reflects the schema change.

The OpenapiSpec field addition is properly implemented:

  • sql.NullString type correctly handles the nullable text column
  • Database tag mapping is accurate
  • Field placement and naming follow established conventions
go/pkg/db/queries/version_find_by_id.sql (1)

12-12: Query correctly includes the new field.

The addition of openapi_spec to the SELECT statement is properly positioned and maintains consistency with the schema field order.

go/pkg/db/queries/version_update_openapi_spec.sql (1)

1-4: Well-implemented update query.

The UpdateVersionOpenApiSpec query follows best practices:

  • Uses parameterized arguments for security
  • Focused scope updating only the required field
  • Proper sqlc annotations and naming conventions
  • Appropriate WHERE clause filtering
internal/db/src/schema/versions.ts (2)

2-2: Import addition is correct.

The text import is properly added to support the new openapiSpec field definition.


35-37: TypeScript schema field properly defined.

The openapiSpec field implementation is excellent:

  • Uses appropriate text type for potentially large OpenAPI specifications
  • Correctly maps to the openapi_spec database column
  • Nullable field allows for versions without OpenAPI specs
  • Descriptive comment enhances code documentation
  • Follows established TypeScript naming conventions
go/pkg/db/queries/version_insert.sql (1)

12-12: LGTM! Clean addition of the OpenAPI spec column.

The addition of the openapi_spec column to the INSERT query is correctly implemented with proper positioning and consistent parameter binding.

Also applies to: 27-27

go/pkg/db/version_find_by_id.sql_generated.go (1)

23-23: LGTM! Generated code correctly includes the OpenAPI spec field.

The sqlc-generated code properly adds the openapi_spec column to the SELECT query and maps it to the OpenapiSpec field in the scanning operation.

Also applies to: 43-43, 62-62

go/apps/ctrl/run.go (2)

13-13: LGTM! Proper import for the new OpenAPI service.

The import correctly includes the new openapi package for the OpenAPI diff functionality.


162-164: LGTM! Clean refactoring with new OpenAPI service registration.

The refactoring from storing service instances in variables to directly registering handlers inline is a good simplification. The new OpenAPI service handler registration follows the established pattern and properly integrates the OpenAPI diff functionality.

go/apps/ctrl/services/openapi/service.go (1)

1-21: LGTM! Well-structured OpenAPI service implementation.

The service structure follows established patterns with proper dependency injection. The embedded UnimplementedOpenApiServiceHandler correctly provides the gRPC interface, and the constructor properly initializes all fields.

go/go.mod (2)

13-13: LGTM! Appropriate dependency updates for OpenAPI functionality.

The upgrade of kin-openapi to v0.132.0 and addition of oasdiff v1.11.4 correctly support the new OpenAPI diffing features.

Also applies to: 21-21


51-51: Security check passed for new indirect Go dependencies

All newly added indirect dependencies were verified against the GitHub Advisory Database at their current versions:

  • github.com/oasdiff/oasdiff v1.11.4 (no advisories)
  • github.com/tidwall/gjson v1.18.0
    • Known HIGH-severity advisories affect versions < 1.9.3, < 1.6.4, < 1.6.5, < 1.6.6
    • Current version (1.18.0) is well beyond the first patched releases (≥ 1.9.3)
  • github.com/wI2L/jsondiff v0.6.1 (no advisories)
  • cloud.google.com/go v0.121.0 (no advisories)

No further action required—these versions are free of known vulnerabilities.

go/apps/ctrl/services/openapi/utils.go (1)

10-26: LGTM! Well-implemented database utility function.

The implementation correctly handles database queries with proper error wrapping, uses read-only connections appropriately, and provides clear error messages for both database failures and missing OpenAPI specs.

go/pkg/db/version_insert.sql_generated.go (1)

25-25: LGTM! Database schema changes are consistent.

The generated code correctly adds the openapi_spec column to the insert operation with proper nullable string handling and consistent parameter ordering.

Also applies to: 42-42, 57-57, 75-75, 92-92, 106-106

go/pkg/db/querier_generated.go (1)

454-454: LGTM! Interface updates are consistent with schema changes.

The generated interface correctly includes the openapi_spec column in relevant method comments and adds the new UpdateVersionOpenApiSpec method with proper signature.

Also applies to: 911-911, 928-928, 1285-1290

go/pkg/db/version_update_openapi_spec.sql_generated.go (1)

13-32: LGTM! Generated update method follows proper patterns.

The implementation correctly provides a simple UPDATE operation for the openapi_spec column with proper parameter handling and error propagation.

go/apps/ctrl/services/openapi/get_diff.go (1)

63-68: Confirm operations sources map usage in backward-compatibility check

Passing an empty &diff.OperationsSourcesMap{} to CheckBackwardCompatibility at:

  • go/apps/ctrl/services/openapi/get_diff.go:63-68

likely means no operation-level sources are tracked. Please verify in the oasdiff library that either:

  • the checker populates missing entries internally when given an empty map, or
  • you should supply a fully populated map (for example via a helper like diff.GetOperationsSourcesMap(...)).

Otherwise, operation-level breaking changes may be overlooked.

go/proto/ctrl/v1/openapi.proto (1)

1-46: Well-structured protobuf definitions

The protobuf definitions are well-organized with clear message structures and appropriate use of optional fields. The static analysis warning about package directory can be safely ignored as it follows Go module conventions.

Copy link
Member

@Flo4604 Flo4604 left a comment

Choose a reason for hiding this comment

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

I added a few nits but works as excpected

Copy link
Collaborator Author

ty, checking
this is somewhat hacky, point taken 😄

…ing operationId locally (#3641)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
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: 1

♻️ Duplicate comments (1)
go/apps/ctrl/services/openapi/convert.go (1)

45-53: The pointer reuse issue still exists and needs to be fixed.

This is the same issue that was identified in previous reviews but appears to still be present. Taking the address of the loop variable operationId directly will cause all entries to share the same pointer value.

The fix should create a local copy of operationId within the loop:

 operationId := change.GetOperationId()
-result[i] = &ctrlv1.ChangelogEntry{
-    Id:          change.GetId(),
-    Text:        change.GetUncolorizedText(localizer),
-    Level:       level,
-    Operation:   change.GetOperation(),
-    Path:        change.GetPath(),
-    OperationId: &operationId,
-}
+
+var operationIdPtr *string
+if operationId != "" {
+    // Create a local copy to avoid pointer reuse in loop
+    opId := operationId
+    operationIdPtr = &opId
+}
+
+result[i] = &ctrlv1.ChangelogEntry{
+    Id:          change.GetId(),
+    Text:        change.GetUncolorizedText(localizer),
+    Level:       level,
+    Operation:   change.GetOperation(),
+    Path:        change.GetPath(),
+    OperationId: operationIdPtr,
+}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 056c771 and 0d981c9.

📒 Files selected for processing (1)
  • go/apps/ctrl/services/openapi/convert.go (1 hunks)
🧠 Learnings (2)
📓 Common learnings
Learnt from: Flo4604
PR: unkeyed/unkey#3421
File: go/apps/api/openapi/openapi.yaml:196-200
Timestamp: 2025-07-03T05:58:10.699Z
Learning: In the Unkey codebase, OpenAPI 3.1 is used, which allows sibling keys (such as `description`) alongside `$ref` in schema objects. Do not flag this as an error in future reviews.
Learnt from: Flo4604
PR: unkeyed/unkey#2955
File: go/apps/api/routes/v2_identities_create_identity/handler.go:162-202
Timestamp: 2025-03-19T09:25:59.751Z
Learning: In the Unkey codebase, input validation for API endpoints is primarily handled through OpenAPI schema validation, which occurs before requests reach the handler code. For example, in the identities.createIdentity endpoint, minimum values for ratelimit duration and limit are defined in the OpenAPI schema rather than duplicating these checks in the handler.
go/apps/ctrl/services/openapi/convert.go (4)

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's *.go code changes significantly, increase the patch-level version number.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Use AIDEV-NOTE:, AIDEV-TODO:, AIDEV-BUSINESS_RULE:, or AIDEV-QUESTION: (all-caps prefix) as anchor comments aimed at AI and developers.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Make sure to add relevant anchor comments whenever a file or piece of code is too complex, very important, confusing, or could have a bug.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Update relevant anchors when modifying associated code.

🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Flo4604
PR: unkeyed/unkey#3421
File: go/apps/api/openapi/openapi.yaml:196-200
Timestamp: 2025-07-03T05:58:10.699Z
Learning: In the Unkey codebase, OpenAPI 3.1 is used, which allows sibling keys (such as `description`) alongside `$ref` in schema objects. Do not flag this as an error in future reviews.
Learnt from: Flo4604
PR: unkeyed/unkey#2955
File: go/apps/api/routes/v2_identities_create_identity/handler.go:162-202
Timestamp: 2025-03-19T09:25:59.751Z
Learning: In the Unkey codebase, input validation for API endpoints is primarily handled through OpenAPI schema validation, which occurs before requests reach the handler code. For example, in the identities.createIdentity endpoint, minimum values for ratelimit duration and limit are defined in the OpenAPI schema rather than duplicating these checks in the handler.
go/apps/ctrl/services/openapi/convert.go (4)

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's *.go code changes significantly, increase the patch-level version number.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Use AIDEV-NOTE:, AIDEV-TODO:, AIDEV-BUSINESS_RULE:, or AIDEV-QUESTION: (all-caps prefix) as anchor comments aimed at AI and developers.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Make sure to add relevant anchor comments whenever a file or piece of code is too complex, very important, confusing, or could have a bug.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Update relevant anchors when modifying associated code.

⏰ 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). (6)
  • GitHub Check: Test Go API Local / Test
  • GitHub Check: Test Agent Local / test_agent_local
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Build / Build
  • GitHub Check: Test Packages / Test
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
go/apps/ctrl/services/openapi/convert.go (1)

9-30: LGTM! Well-structured conversion function.

The function correctly handles the conversion from diff.Summary to protobuf format with proper safety checks for missing categories.

Copy link
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e5f29bc and 2eacb07.

📒 Files selected for processing (1)
  • go/apps/ctrl/services/openapi/convert.go (1 hunks)
🧠 Learnings (2)
📓 Common learnings
Learnt from: Flo4604
PR: unkeyed/unkey#3421
File: go/apps/api/openapi/openapi.yaml:196-200
Timestamp: 2025-07-03T05:58:10.699Z
Learning: In the Unkey codebase, OpenAPI 3.1 is used, which allows sibling keys (such as `description`) alongside `$ref` in schema objects. Do not flag this as an error in future reviews.
Learnt from: Flo4604
PR: unkeyed/unkey#2955
File: go/apps/api/routes/v2_identities_create_identity/handler.go:162-202
Timestamp: 2025-03-19T09:25:59.751Z
Learning: In the Unkey codebase, input validation for API endpoints is primarily handled through OpenAPI schema validation, which occurs before requests reach the handler code. For example, in the identities.createIdentity endpoint, minimum values for ratelimit duration and limit are defined in the OpenAPI schema rather than duplicating these checks in the handler.
go/apps/ctrl/services/openapi/convert.go (5)

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's *.go code changes significantly, increase the patch-level version number.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Use AIDEV-NOTE:, AIDEV-TODO:, AIDEV-BUSINESS_RULE:, or AIDEV-QUESTION: (all-caps prefix) as anchor comments aimed at AI and developers.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Make sure to add relevant anchor comments whenever a file or piece of code is too complex, very important, confusing, or could have a bug.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Update relevant anchors when modifying associated code.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Do not remove AIDEV-*s without explicit human instruction.

🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Flo4604
PR: unkeyed/unkey#3421
File: go/apps/api/openapi/openapi.yaml:196-200
Timestamp: 2025-07-03T05:58:10.699Z
Learning: In the Unkey codebase, OpenAPI 3.1 is used, which allows sibling keys (such as `description`) alongside `$ref` in schema objects. Do not flag this as an error in future reviews.
Learnt from: Flo4604
PR: unkeyed/unkey#2955
File: go/apps/api/routes/v2_identities_create_identity/handler.go:162-202
Timestamp: 2025-03-19T09:25:59.751Z
Learning: In the Unkey codebase, input validation for API endpoints is primarily handled through OpenAPI schema validation, which occurs before requests reach the handler code. For example, in the identities.createIdentity endpoint, minimum values for ratelimit duration and limit are defined in the OpenAPI schema rather than duplicating these checks in the handler.
go/apps/ctrl/services/openapi/convert.go (5)

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's *.go code changes significantly, increase the patch-level version number.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Use AIDEV-NOTE:, AIDEV-TODO:, AIDEV-BUSINESS_RULE:, or AIDEV-QUESTION: (all-caps prefix) as anchor comments aimed at AI and developers.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Make sure to add relevant anchor comments whenever a file or piece of code is too complex, very important, confusing, or could have a bug.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Update relevant anchors when modifying associated code.

Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-21T18:05:58.187Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,env,conf,html,css,scss,xml,c,h,cpp,java,rb,rs,php,pl,sql} : Do not remove AIDEV-*s without explicit human instruction.

⏰ 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). (7)
  • GitHub Check: Test Go API Local / Test
  • GitHub Check: Build / Build
  • GitHub Check: Test Agent Local / test_agent_local
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Packages / Test
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
go/apps/ctrl/services/openapi/convert.go (1)

10-31: Well-structured conversion with proper error handling.

The convertSummaryToProto function correctly handles missing detail categories and uses explicit type casting. The defensive programming approach with the getCounts helper function prevents potential nil pointer issues.

@chronark chronark enabled auto-merge July 22, 2025 10:30
@chronark chronark disabled auto-merge July 22, 2025 10:30
@Flo4604
Copy link
Member

Flo4604 commented Jul 22, 2025

CleanShot 2025-07-22 at 12 45 18@2x do we not want to merge this?

Copy link
Collaborator Author

we do, but your review for some reason wasn't sufficient and I wanted to look into it later

@Flo4604
Copy link
Member

Flo4604 commented Jul 22, 2025

Waiting on code owner review from MichaelUnkey, mcstepp, ogzhanolguncu, and/or perkinsjr.

Ah maybe because some code got changed where i am not code owner?

Copy link
Collaborator Author

probably but I haven’t had time to dig in yet and add you

Copy link
Member

@perkinsjr perkinsjr left a comment

Choose a reason for hiding this comment

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

Approving to allow you to merge when you want.

@Flo4604 Flo4604 added this pull request to the merge queue Jul 22, 2025
@graphite-app
Copy link

graphite-app bot commented Jul 22, 2025

TV gif. Jeremy Clarkson gives a thumbs up and a sarcastic, goofy, toothy smile. (Added via Giphy)

@graphite-app
Copy link

graphite-app bot commented Jul 22, 2025

Graphite Automations

"Post a GIF when PR approved" took an action on this PR • (07/22/25)

1 gif was posted to this PR based on Andreas Thomas's automation.

Merged via the queue into main with commit 49fef6c Jul 22, 2025
18 checks passed
@Flo4604 Flo4604 deleted the 07-18-feat_scrape_and_diff_openapi.yaml branch July 22, 2025 11:29
@coderabbitai coderabbitai bot mentioned this pull request Sep 29, 2025
12 tasks
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.

3 participants