Skip to content

Conversation

FingerLeader
Copy link
Contributor

@FingerLeader FingerLeader commented Mar 26, 2025

First-time contributors' checklist

What is changed, added or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Signed-off-by: FingerLeader <wanxfinger@gmail.com>
@ti-chi-bot ti-chi-bot bot added contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. labels Mar 26, 2025
Copy link

ti-chi-bot bot commented Mar 26, 2025

Hi @FingerLeader. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 26, 2025
@qiancai qiancai self-assigned this Apr 3, 2025
@qiancai qiancai added translation/no-need No need to translate this PR. area/tidb-cloud This PR relates to the area of TiDB Cloud. labels Apr 3, 2025
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Apr 3, 2025
@qiancai qiancai added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Apr 3, 2025
@qiancai
Copy link
Collaborator

qiancai commented Apr 3, 2025

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Apr 3, 2025
@qiancai
Copy link
Collaborator

qiancai commented Apr 3, 2025

/bot-review

Copy link

github-actions bot commented Apr 3, 2025

✅ AI review completed, 10 comments generated.

@pingcap pingcap deleted a comment from github-actions bot Apr 3, 2025
@lilin90 lilin90 requested a review from Copilot April 7, 2025 02:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

@lilin90
Copy link
Member

lilin90 commented Apr 7, 2025

/gemini review

Copy link

@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 adds documentation for migrating cluster resources to serverless/dedicated cluster resources using Terraform. The documentation provides a step-by-step guide with commands and examples. Overall, the documentation is clear and helpful, but there are a few areas that could be improved for clarity and completeness.

Summary of Findings

  • Prerequisites: Specific Terraform Provider Version: The prerequisite section mentions updating the TiDB Cloud Terraform Provider but uses a placeholder version (x.x.x). This should be replaced with a specific, tested version to ensure the instructions work correctly.
  • Inconsistent Resource Naming in Examples: In Step 4, the example configurations for serverless and dedicated clusters use the same resource name (new_cluster). This could lead to confusion and should be clarified or corrected to use distinct names.
  • Missing Context for your_target_cluster_resource: In Step 2, the documentation uses ${your_target_cluster_resource} without explicitly defining or explaining where this value comes from. It should be clarified that this is the full resource name as listed by terraform state list.

Merge Readiness

The pull request introduces a new documentation page for migrating cluster resources using Terraform. While the steps are generally well-explained, addressing the identified issues regarding the Terraform provider version, resource naming consistency, and clarification of variable usage would significantly improve the documentation's clarity and usability. I am unable to approve this pull request, and recommend that the author address the identified issues before merging.

Comment on lines 40 to 41
resource "tidbcloud_serverless_cluster" "new_cluster" {} # Serverless
resource "tidbcloud_serverless_cluster" "new_cluster" {} # Dedicated

Choose a reason for hiding this comment

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

high

Using the same resource name new_cluster for both serverless and dedicated clusters might be confusing. Consider using distinct names to avoid potential issues.

Suggested change
resource "tidbcloud_serverless_cluster" "new_cluster" {} # Serverless
resource "tidbcloud_serverless_cluster" "new_cluster" {} # Dedicated
resource "tidbcloud_serverless_cluster" "new_serverless_cluster" {} # Serverless
resource "tidbcloud_dedicated_cluster" "new_dedicated_cluster" {} # Dedicated


## Step 2. Delete the existed resource from state

Run the `terraform state rm ${your_target_cluster_resource}` to delete the resource from state.

Choose a reason for hiding this comment

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

medium

It would be helpful to clarify where the ${your_target_cluster_resource} value comes from. Perhaps reference the output of the command in Step 1?

Suggested change
Run the `terraform state rm ${your_target_cluster_resource}` to delete the resource from state.
Run the `terraform state rm tidbcloud_cluster.your_old_cluster` to delete the resource from state.

Comment on lines 48 to 49
terraform import tidbcloud_serverless_cluster.new_cluster ${id} # Serverless
terraform import tidbcloud_dedicated_cluster.new_cluster ${id} # Dedicated

Choose a reason for hiding this comment

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

medium

To align with the previous suggestion, the resource names here should be updated to reflect the new resource names.

Suggested change
terraform import tidbcloud_serverless_cluster.new_cluster ${id} # Serverless
terraform import tidbcloud_dedicated_cluster.new_cluster ${id} # Dedicated
terraform import tidbcloud_serverless_cluster.new_serverless_cluster ${id} # Serverless
terraform import tidbcloud_dedicated_cluster.new_dedicated_cluster ${id} # Dedicated

Copy link

ti-chi-bot bot commented Apr 7, 2025

@gemini-code-assist[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Code Review

This pull request adds documentation for migrating cluster resources to serverless/dedicated cluster resources using Terraform. The documentation provides a step-by-step guide with commands and examples. Overall, the documentation is clear and helpful, but there are a few areas that could be improved for clarity and completeness.

Summary of Findings

  • Prerequisites: Specific Terraform Provider Version: The prerequisite section mentions updating the TiDB Cloud Terraform Provider but uses a placeholder version (x.x.x). This should be replaced with a specific, tested version to ensure the instructions work correctly.
  • Inconsistent Resource Naming in Examples: In Step 4, the example configurations for serverless and dedicated clusters use the same resource name (new_cluster). This could lead to confusion and should be clarified or corrected to use distinct names.
  • Missing Context for your_target_cluster_resource: In Step 2, the documentation uses ${your_target_cluster_resource} without explicitly defining or explaining where this value comes from. It should be clarified that this is the full resource name as listed by terraform state list.

Merge Readiness

The pull request introduces a new documentation page for migrating cluster resources using Terraform. While the steps are generally well-explained, addressing the identified issues regarding the Terraform provider version, resource naming consistency, and clarification of variable usage would significantly improve the documentation's clarity and usability. I am unable to approve this pull request, and recommend that the author address the identified issues before merging.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@pingcap pingcap deleted a comment from github-actions bot Apr 24, 2025
@pingcap pingcap deleted a comment from github-actions bot Apr 24, 2025
Signed-off-by: FingerLeader <wanxfinger@gmail.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
FingerLeader and others added 3 commits May 23, 2025 15:38
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label May 23, 2025
@Oreoxmt Oreoxmt self-requested a review May 23, 2025 07:41
@qiancai qiancai changed the title Add terraform migrate cluster resource doc cloud: add terraform migrate cluster resource doc May 23, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 23, 2025
Copy link

ti-chi-bot bot commented May 23, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-05-23 07:40:02.192600394 +0000 UTC m=+18628.137865245: ☑️ agreed by qiancai.
  • 2025-05-23 08:40:22.704287927 +0000 UTC m=+22248.649552737: ☑️ agreed by Oreoxmt.

Co-authored-by: Aolin <aolinz@outlook.com>
@qiancai
Copy link
Collaborator

qiancai commented May 23, 2025

/approve

1 similar comment
@qiancai
Copy link
Collaborator

qiancai commented May 23, 2025

/approve

@ti-chi-bot ti-chi-bot bot added the approved label May 23, 2025
Copy link

ti-chi-bot bot commented May 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiancai

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot merged commit 1da3d6b into pingcap:master May 23, 2025
9 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #21026.

@FingerLeader FingerLeader deleted the add-terraform-migrate-doc branch May 23, 2025 09:37
@qiancai qiancai added the cherry-pick-release-cloud/no-need No need to cherry pick this PR to the "release-cloud" branch. label Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/tidb-cloud This PR relates to the area of TiDB Cloud. cherry-pick-release-cloud/no-need No need to cherry pick this PR to the "release-cloud" branch. contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. lgtm needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. ok-to-test Indicates a PR is ready to be tested. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/no-need No need to translate this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants