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

feat(packages): support enterprise build profile for tidb #187

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

wuhuizuo
Copy link
Contributor

  • container images.
  • add plugins tarballs.
  • will not publish tiup for enterprise profile.

Signed-off-by: wuhuizuo [email protected]

- container images.
- add plugins tarballs.
- will not publish tiup for enterprise profile.

Signed-off-by: wuhuizuo <[email protected]>
@ti-chi-bot ti-chi-bot bot requested review from jayl1e and purelind December 26, 2023 07:48
@ti-chi-bot ti-chi-bot bot added the size/L label Dec 26, 2023
Copy link

ti-chi-bot bot commented Dec 26, 2023

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

Review Summary

This pull request mainly focuses on adding support for an enterprise build profile for TiDB, a popular open-source NewSQL database.

Key Changes

  1. The README file has been updated to describe the different profiles including release, debug, enterprise, and fips.
  2. The packages.yaml.tmpl file has been significantly updated to include steps for the enterprise profile. This includes scripts for preparing the enterprise server build, cloning and checking out enterprise plugin code, running go plugins for audit and whitelist, and other necessary steps. Moreover, the file now has checks for the enterprise profile in the profile field and several if conditions were updated.
  3. The build-package-artifacts.sh.tmpl and build-package-images.sh.tmpl scripts have been updated to account for the enterprise profile.
  4. Overall, the code changes involve the introduction of an enterprise profile for building TiDB, including the creation of container images, handling plugins, and managing the publication of packages.

Potential Problems

  1. Hardcoded URLs: The code contains hardcoded URLs to GitHub repositories and Dockerfiles. If those URLs change in the future, the build process may break. Consider replacing hardcoded URLs with configurable parameters.
  2. Error handling: The code does not seem to handle potential errors that might occur during the build process, such as failure to clone the repository, failure to compile the code, etc. Proper error handling should be added to make the code more robust.
  3. Versioning: The enterprise build versioning might not be in sync with the main TiDB versioning because it's manually set in the scripts. This could lead to confusion and inconsistency.
  4. Lack of tests: The pull request does not include any unit or integration tests. It's important to ensure that these changes don't break existing functionality and behave as expected.

Suggestions

  1. Make URLs configurable: Replace hardcoded URLs with configurable parameters. This would make it easier to maintain and modify the build process in the future.
  2. Add error handling: Implement proper error handling in the scripts to ensure that the build process is robust and can handle potential issues.
  3. Use automated versioning: Consider using automated versioning to keep the enterprise build version in sync with the main TiDB version.
  4. Add tests: Add unit and integration tests to verify the new functionality and ensure it does not break existing features.

Copy link

ti-chi-bot bot commented Dec 26, 2023

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

Summary of Changes

The pull request aims to add support for an enterprise build profile for TiDB. Here are the key changes:

  • Updates to the README file to include different build profiles.
  • Modifications to packages.yaml.tmpl to include the enterprise profile for the build process, including fetching and building enterprise plugins.
  • Changes to build-package-artifacts.sh.tmpl and build-package-images.sh.tmpl to handle conditional artifacts based on the build profile.
  • Updates to ci.sh to handle the enterprise build profile.

Potential Problems

  1. There is a lot of code duplication in the packages.yaml.tmpl file for the enterprise profile. This could make maintenance harder in the future.
  2. The scripts now have conditional logic based on the build profile, which could introduce bugs if not tested thoroughly.

Suggestions

  1. Refactoring: Consider refactoring the code to eliminate duplication and make the scripts more maintainable.
  2. Testing: Ensure that the new enterprise build profile does not break the existing build profiles (release, debug, fips).
  3. Documentation: Please provide more details in the PR description about the implications of the changes, especially for those unfamiliar with the enterprise build profile.
  4. Error Handling: Make sure that the scripts handle errors appropriately, especially in situations when fetching or building the enterprise plugins fails.

Review Markdown

### Summary
This PR adds support for an enterprise build profile for TiDB. The key changes involve updates to build scripts and configurations to handle this new profile.

### Potential Issues
1. Code Duplication: There seems to be a lot of code duplication in the changes to `packages.yaml.tmpl`.
2. New Conditional Logic: The introduction of new conditional logic in scripts like `build-package-artifacts.sh.tmpl` and `build-package-images.sh.tmpl` could lead to potential issues if not thoroughly tested.

### Suggestions
1. **Refactoring**: It would be beneficial to refactor the code to reduce duplication.
2. **Thorough Testing**: Please ensure that the new enterprise build profile does not break existing functionality for other build profiles.
3. **Documentation**: The PR description could provide more context about the enterprise build profile and how these changes affect the build process.
4. **Error Handling**: Ensure that potential failures in the new steps for the enterprise profile (like fetching or building plugins) are handled appropriately.

@wuhuizuo wuhuizuo force-pushed the feature/tidb/enterprise branch from eff1f15 to 665f2ee Compare December 26, 2023 07:57
Copy link

ti-chi-bot bot commented Dec 26, 2023

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

Review Summary

This pull request mainly aims to add enterprise build profile support for TiDB package. Below are the key changes:

  1. README.md Update: Profiles section has been added to the README.md file which includes release, debug, enterprise, and fips profiles.

  2. packages.yaml.tmpl Update: This file has undergone significant transformations. New build scripts for the enterprise profile have been added which include steps for preparing the enterprise server, checking out the enterprise-plugin code, auditing the go plugin, and creating the whitelist. Artifacts section has also been expanded for the enterprise profile which includes plugin files and images.

  3. build-package-artifacts.sh.tmpl, build-package-images.sh.tmpl Update: The script files have been updated to include checks for the enterprise profile.

  4. ci.sh Update: The continuous integration script has been updated to include tests for the enterprise profile.

Potential Problems

  1. Repeated Code: There is a lot of repeated code for different versions in the packages.yaml.tmpl file. This could lead to maintenance issues in the future.

  2. Lack of Error Handling: The script files do not seem to have proper error handling. If any of the steps fail, the script may continue to execute and may lead to unexpected results.

  3. Lack of Documentation: The pull request lacks elaborate documentation explaining the changes and their impact. It would be beneficial for the maintainers and users if more information is provided about the changes, especially the new enterprise build profile.

Suggested Fixes

  1. Code Optimization: Consider refactoring the code to reduce duplication. This could potentially be achieved through the use of functions or loops.

  2. Add Error Handling: Add appropriate error handling in the script files. This could include checking the success of each command and exiting or handling the error appropriately if any command fails.

  3. Improve Documentation: Add more details to the pull request description explaining the changes and their impact. Include information about the new enterprise build profile, how it can be used, and how it affects the build process.

@wuhuizuo wuhuizuo added lgtm and removed lgtm labels Dec 27, 2023
@wuhuizuo
Copy link
Contributor Author

/approve

Copy link

ti-chi-bot bot commented Dec 27, 2023

[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 approved label Dec 27, 2023
@ti-chi-bot ti-chi-bot bot merged commit 856f4bc into main Dec 27, 2023
2 checks passed
@ti-chi-bot ti-chi-bot bot deleted the feature/tidb/enterprise branch December 27, 2023 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant