Skip to content

feat: add BYOC support for TiDB Cloud navigation and content#718

Open
shhdgit wants to merge 1 commit into
preview-nextgenfrom
byoc-preview
Open

feat: add BYOC support for TiDB Cloud navigation and content#718
shhdgit wants to merge 1 commit into
preview-nextgenfrom
byoc-preview

Conversation

@shhdgit

@shhdgit shhdgit commented Jul 6, 2026

Copy link
Copy Markdown
Member

No description provided.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
website-docs Error Error Jul 6, 2026 2:26pm

Request Review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces support for a new "BYOC" (Bring Your Own Cloud) plan across the TiDB Cloud documentation website. The changes include updating the CloudPlan enum, adding GraphQL schema extensions for BYOC navigation, updating UI components (such as the header navigation and version selector), adding translations, and implementing corresponding tests. The review feedback focuses on code quality improvements, such as simplifying redundant conditional checks in the plan detection logic, using a more maintainable enum check via Object.values in useCloudPlan.ts, and formatting a template literal for better readability in CloudVersionSelect.tsx.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread gatsby/cloud-plan.ts
Comment on lines +153 to +161
if (
byoc.has(fileName) &&
!premium.has(fileName) &&
!essential.has(fileName) &&
!dedicated.has(fileName) &&
!starter.has(fileName)
) {
return CloudPlan.Byoc;
}

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

Since this is the final check in a sequence of if-else style conditions, we already know that fileName is not present in dedicated, starter, essential, or premium (otherwise, the function would have already returned). Therefore, we can simplify this condition to just check byoc.has(fileName).

  if (byoc.has(fileName)) {
    return CloudPlan.Byoc;
  }

Comment on lines 23 to 31
function isCloudPlan(value: string | null): value is CloudPlan {
return (
value === CloudPlan.Dedicated ||
value === CloudPlan.Starter ||
value === CloudPlan.Essential ||
value === CloudPlan.Premium
value === CloudPlan.Premium ||
value === CloudPlan.Byoc
);
}

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

Instead of manually listing all enum values in the comparison, we can use Object.values(CloudPlan).includes() to check if the value is a valid CloudPlan. This is more maintainable as it automatically supports any new plans added to the CloudPlan enum in the future.

function isCloudPlan(value: string | null): value is CloudPlan {
  return Object.values(CloudPlan).includes(value as CloudPlan);
}

Comment on lines +78 to +82
if (version === CloudPlan.Byoc) {
return `/${pathConfig.repo}/${
CloudPlan.Premium
}/?${searchParams.toString()}`;
}

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.

low

This template literal can be simplified to a single line to improve readability.

    if (version === CloudPlan.Byoc) {
      return `/${pathConfig.repo}/${CloudPlan.Premium}/?${searchParams.toString()}`;
    }

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.

1 participant