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): update tiup ctl package config for range [v8.4.0, ) #411

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

wuhuizuo
Copy link
Contributor

  • support zip type url, oci artifacts, or local file.
  • update etcd url for ctl pkg in range [v8.4.0, )

Signed-off-by: wuhuizuo [email protected]

- support zip type url, oci artifacts, or local file.
- update etcd url for ctl pkg in range [v8.4.0, )

Signed-off-by: wuhuizuo <[email protected]>
@ti-chi-bot ti-chi-bot bot requested a review from purelind September 11, 2024 09:37
@ti-chi-bot ti-chi-bot bot added the size/L label Sep 11, 2024
Copy link

ti-chi-bot bot commented Sep 11, 2024

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

This pull request introduces the feature of extracting files from zip archives, and it also updates the etcd URL for the ctl package for version ranges beyond v8.4.0.

The key changes made in the pull request are:

  1. The script to build package artifacts, package images, and compose offline package artifacts now supports extraction from zip archives in addition to tar.gz archives.
  2. The version range for the etcd URL in the packages.yaml.tmpl file has been updated to support versions v8.4.0 and beyond.
  3. The packages.yaml.tmpl file now includes additional artifacts and their respective sources for the ctl package.

Potential issues:

  1. The script fails if the archive format of the source is not .tar.gz or .zip. This could be a problem if other archive formats need to be supported in the future.
  2. The pull request does not include any test cases to validate the new feature. This might lead to undetected bugs or issues in the future.

Suggestions for improvements:

  1. Add support for other popular archive formats, or consider using a library/tool that can handle multiple archive formats.
  2. Add test cases to validate the new functionality and prevent potential issues in the future.
  3. It would be great if there was more detailed documentation on the new feature and how it is supposed to work. This could help other developers better understand the code changes.
  4. Ensure that all URLs used in the code are valid and accessible. This is especially important for URLs used to download files, as a broken or inaccessible link could cause the script to fail.

Copy link

ti-chi-bot bot commented Sep 11, 2024

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

The pull request titled "feat(packages): support extract from zip file" seems to add support for extracting files from zip archives. The change is significant in the context of packaging and version control, particularly when dealing with cross-platform compatibility and binary distribution.

Key Changes:

  1. Updated the semantic version constraint in packages.yaml.tmpl from ">= 6.1.0-0" to ">= 8.4.0-0".

  2. Added a new block, artifacts, with multiple download sources and destinations for various packages, including support for .zip files.

  3. Updated build-package-artifacts.sh.tmpl, build-package-images.sh.tmpl, and compose-offline-packages-artifacts.sh.tmpl scripts to handle both .tar.gz and .zip archives based on the file extension.

Potential Problems:

  1. In packages.yaml.tmpl, the URL for the etcd package is updated. It is important to ensure the new URL points to the correct package.

  2. This PR introduces support for .zip files. Extraction from .zip files may cause compatibility issues on certain platforms or configurations.

  3. The PR changes the semantic version check for the package from 6.1.0 to 8.4.0. If there are backward compatibility issues, this could potentially break the existing code.

Fixing Suggestions:

  1. Ensure that the URLs for all the packages are correct and point to the expected version of each package.

  2. Verify that the extraction from .zip files is working correctly on all supported platforms.

  3. If there are backward compatibility issues due to the change in version check, consider providing support for older versions as well or adequately notify users about this change.

  4. Test the changes with different scenarios to ensure that the extraction process works as expected.

  5. Consider adding error handling logic when the archive format is not supported. Currently, the script only fails with a message. A better approach could be to skip the current artifact and continue with others, logging the error for further investigation.

os: [linux, darwin]
arch: [amd64, arm64]
profile: [release, experiment]
artifacts:
- name: "ctl-{{ .Release.version }}-{{ .Release.os }}-{{ .Release.arch }}.tar.gz"
files:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. removed binlogctl.
  2. update etcdctl version to v3.5.15.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/cc @Benjamin2037

PTAL for point 1.

Comment on lines +72 to +77
- name: etcdctl
src:
type: http
url: "https://github.com/etcd-io/etcd/releases/download/v3.5.15/etcd-v3.5.15-{{ .Release.os }}-{{ .Release.arch }}{{ ternary ".zip" ".tar.gz" (eq .Release.os "darwin") }}"
extract: true
extract_inner_path: etcd-v3.5.15-{{ .Release.os }}-{{ .Release.arch }}/etcdctl
Copy link
Contributor Author

Choose a reason for hiding this comment

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

/cc @lhy1024

PTAL, from v8.4.0 update etcdctl binary in TiUP ctl package.

Copy link

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

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

lgtm for the part of etcd

Copy link

ti-chi-bot bot commented Sep 11, 2024

@lhy1024: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

lgtm for the part of etcd

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/test-infra repository.

@wuhuizuo wuhuizuo changed the title feat(packages): support extract from zip file feat(packages): update tiup ctl package config for range [v8.4.0, ) Sep 11, 2024
Copy link

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Sep 11, 2024

@Benjamin2037: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

LGTM

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/test-infra repository.

@wuhuizuo
Copy link
Contributor Author

/approve

@ti-chi-bot ti-chi-bot bot added the approved label Sep 11, 2024
Copy link
Contributor

@purelind purelind left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

ti-chi-bot bot commented Sep 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, lhy1024, purelind, 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 Sep 11, 2024
Copy link

ti-chi-bot bot commented Sep 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-11 09:51:49.923979501 +0000 UTC m=+436379.664403433: ☑️ agreed by purelind.

@ti-chi-bot ti-chi-bot bot merged commit 4be0411 into main Sep 11, 2024
3 checks passed
@ti-chi-bot ti-chi-bot bot deleted the chore/update-ctl-for-v8.4.0 branch September 11, 2024 09: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.

4 participants