Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tidb): checkout to minor version of tidb-test for hotfix #3321

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

purelind
Copy link
Collaborator

For the hotfix branch(example release-8.5-20250114-v8.5.0), we need to checkout the corresponding minimum version of the tidb-test code (release-8.5.0).

Copy link

ti-chi-bot bot commented Jan 20, 2025

I have already done a preliminary review for you, and I hope to help you do a better job.

Based on the pull request title and description, the changes are made to the component.groovy file to checkout the corresponding minimum version of the tidb-test code for hotfix branch releases.

From the diff, it looks like the changes are adding some conditional logic to checkout the specific branch (componentBranch) of the tidb-test code from the PR title if it is specified. If not specified, it will checkout the base branch of the tidb-test code. This seems like a reasonable change.

However, there are a couple of suggestions for improvement:

  1. The println statements in the code should be removed as they are not necessary and do not provide any value to the script execution.
  2. The echo statements in the code should be updated to use println instead, as echo is not a valid Groovy command.

Other than that, the pull request looks good.

@ti-chi-bot ti-chi-bot bot requested a review from wuhuizuo January 20, 2025 09:16
@ti-chi-bot ti-chi-bot bot added the size/S label Jan 20, 2025
@purelind
Copy link
Collaborator Author

Test:

  1. hotfix branch: https://do.pingcap.net/jenkins/blue/organizations/jenkins/pingcap%2Ftidb%2Frelease-8.5%2Fpull_mysql_test/detail/pull_mysql_test/633/pipeline/
image 2. normal release-branch: https://do.pingcap.net/jenkins/blue/organizations/jenkins/pingcap%2Ftidb%2Frelease-8.5%2Fpull_mysql_test/detail/pull_mysql_test/634/pipeline/ image

Copy link

ti-chi-bot bot commented Jan 20, 2025

I have already done a preliminary review for you, and I hope to help you do a better job.

Based on the PR title and description, the key change in this PR is to checkout the corresponding minimum version of the tidb-test code for a specific hotfix branch. The changes in the code are related to handling the case when a branch or commit sha is specified in the PR title.

One potential problem is that the current code assumes that a branch or commit sha is specified in multiple PR titles during hotfix branch batch merge. This may lead to errors if the branch or commit sha is not specified in the PR title or the specified branch or commit sha is incorrect.

To fix this, the code logic should be updated to more clearly handle the case when a branch or commit sha is specified in the PR title. Also, the error handling should be improved to prevent any incorrect assumptions about the specified branches or commit shas.

Additionally, some code comments or documentation can be added to explain the changes in this PR and provide more context for future code maintainers.

@purelind
Copy link
Collaborator Author

purelind commented Jan 21, 2025

/hold

Need to test different situations to see if they meet expectations.

Copy link

ti-chi-bot bot commented Jan 21, 2025

I have already done a preliminary review for you, and I hope to help you do a better job.

Based on the pull request, the key change is to checkout the corresponding minimum version of the tidb-test code for the hotfix branch. The code changes are mostly related to validating and filtering tidb-test refs.

There are no potential problems in this pull request.

However, I would suggest adding more comments to explain the changes and improve the readability of the code. Additionally, it is always a good practice to run unit tests and integration tests before merging the changes.

@ti-chi-bot ti-chi-bot bot added size/M and removed size/S labels Jan 21, 2025
Signed-off-by: purelind <[email protected]>
Copy link

ti-chi-bot bot commented Jan 21, 2025

I have already done a preliminary review for you, and I hope to help you do a better job.

Key changes:

  • The code now validates and filters tidb-test refs specified in the PR title.
  • If no tidb-test refs are specified, it will checkout the base branch of the component.
  • If a single tidb-test branch is specified, it will checkout that branch.
  • If multiple tidb-test PRs are specified, it will merge them with the same base branch.
  • It added a new function validateAndFilterRefs to validate and filter tidb-test refs.

Potential problems:

  • It's unclear if the new changes have been tested.
  • The code has too many comments, which could make it hard to read.
  • The validateAndFilterRefs function could be improved by adding more detailed error messages.

Fixing suggestions:

  • Add a section to the PR description that explains how the changes were tested and what the expected results are.
  • Remove unnecessary comments to make the code more readable.
  • Improve the validateAndFilterRefs function by adding more detailed error messages. For example, it could indicate which PRs have conflicting base branches.

Copy link

ti-chi-bot bot commented Jan 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wuhuizuo

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 added the lgtm label Jan 21, 2025
Copy link

ti-chi-bot bot commented Jan 21, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-01-21 03:22:58.92828616 +0000 UTC m=+151106.259205564: ☑️ agreed by wuhuizuo.

@ti-chi-bot ti-chi-bot bot added the approved label Jan 21, 2025
@wuhuizuo
Copy link
Collaborator

/hold

please rename the testRefs var.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants