Skip to content

schema variants#7534

Draft
n1ru4l wants to merge 1 commit intomainfrom
feat-schema-variant-versions
Draft

schema variants#7534
n1ru4l wants to merge 1 commit intomainfrom
feat-schema-variant-versions

Conversation

@n1ru4l
Copy link
Copy Markdown
Contributor

@n1ru4l n1ru4l commented Jan 22, 2026

Background

Description

Checklist

  • Input validation
  • Output encoding
  • Authentication management
  • Session management
  • Access control
  • Cryptographic practices
  • Error handling and logging
  • Data protection
  • Communication security
  • System configuration
  • Database security
  • File management
  • Memory management
  • Testing

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @n1ru4l, 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 lays the groundwork for a robust schema variant management system by introducing a new set of database tables. These tables are designed to store and version different configurations of GraphQL schemas, allowing for detailed tracking of their evolution, composition, and associated changes. This foundational change enables the system to support multiple schema variants and maintain a comprehensive history of each variant's versions.

Highlights

  • New Database Schema for Graph Variants: Introduced three new database tables: graph_variants, graph_variant_versions, and graph_variants_version_to_log to manage and track different GraphQL schema variants and their historical versions.
  • Graph Variants Table: The graph_variants table stores metadata for each schema variant, including its name, associated target, and timestamps for creation and retirement.
  • Graph Variant Versions Table: The graph_variant_versions table tracks specific versions of a graph variant, storing details such as schema composition errors, composite and supergraph SDLs, schema changes, and a reference to the previous version for historical tracking.
  • Schema Log Integration: A join table, graph_variants_version_to_log, was added to link specific graph variant versions to entries in the schema_log table, enabling comprehensive auditing and history.
  • Migration Registration: The new database migration script (2026.01.20T10.00.00.graph-variant-versions.ts) has been registered in run-pg-migrations.ts to ensure these schema changes are applied during database updates.
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.

@github-actions
Copy link
Copy Markdown
Contributor

📚 Storybook Deployment

The latest changes are available as preview in: https://pr-7534.hive-storybook.pages.dev

Copy link
Copy Markdown
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 introduces a database migration for schema variants. I've found a few issues in the new migration script: a misleading index name, a typo in a column name, and an incorrectly defined index. These should be addressed to ensure correctness and maintainability.

"id" uuid DEFAULT uuid_generate_v4() PRIMARY KEY NOT NULL
, "graph_variant_id" uuid REFERENCES "graph_variants"("id") ON DELETE CASCADE
, "schema_composition_errors" jsonb DEFAULT NULL
, "compositite_schema_sdl" jsonb DEFAULT NULL
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

There's a typo in the column name compositite_schema_sdl. It should be composite_schema_sdl.

Suggested change
, "compositite_schema_sdl" jsonb DEFAULT NULL
, "composite_schema_sdl" jsonb DEFAULT NULL

Comment on lines +35 to +36
CREATE INDEX "idx_graph_variant_versions_previous_graph_variant_version_id"
ON "graph_variant_versions" ("id")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The index idx_graph_variant_versions_previous_graph_variant_version_id is created on the id column, but its name suggests it should be on previous_graph_variant_version_id. The id column is already indexed as it's the primary key, so this index is redundant. It should be created on previous_graph_variant_version_id to improve lookup performance for version history.

Suggested change
CREATE INDEX "idx_graph_variant_versions_previous_graph_variant_version_id"
ON "graph_variant_versions" ("id")
CREATE INDEX "idx_graph_variant_versions_previous_graph_variant_version_id"
ON "graph_variant_versions" ("previous_graph_variant_version_id")

Comment on lines +17 to +18
CREATE UNIQUE INDEX "uniq_feature_flags_target_id_name"
ON "graph_variants" ("target_id", "name")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The unique index name uniq_feature_flags_target_id_name seems to be a copy-paste from another migration. It should probably be uniq_graph_variants_target_id_name to match the table name graph_variants for better clarity and maintainability.

Suggested change
CREATE UNIQUE INDEX "uniq_feature_flags_target_id_name"
ON "graph_variants" ("target_id", "name")
CREATE UNIQUE INDEX "uniq_graph_variants_target_id_name"
ON "graph_variants" ("target_id", "name")

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 22, 2026

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tag: 7617d01bbf3c605396238d614d7d2c9a5713135b

@github-actions
Copy link
Copy Markdown
Contributor

💻 Website Preview

The latest changes are available as preview in: https://pr-7534.hive-landing-page.pages.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant