Closed wuhuizuo closed 1 month ago
I have already done a preliminary review for you, and I hope to help you do a better job.
From the pull request, it looks like the change is to update the Dockerfile URL location in various pipeline files. The change suggests using the new URL location for the Dockerfile.
There don't seem to be any potential issues with this change, since it is only an update to the URL location and does not affect the code itself.
However, one suggestion to make is to ensure that the new URL location is correct and accessible. It would be good to test the URLs to make sure they work and update them if needed.
Another suggestion is to consider using variables or constants to store the URL locations, so that they can be easily updated in the future if needed.
Overall, this seems like a simple and straightforward change that should not cause any issues.
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, it seems that the changes are related to using a new Dockerfile URL location for Jenkins pipelines. Specifically, the changes in the docker-common.groovy
file involve modifying the way the BASE_IMG
argument is passed to Docker build commands. This is achieved by adding an additional_args
variable that is used to store the --build-arg BASE_IMG
argument if it is present in the params
variable.
The changes in other files involve updating the URLs for Dockerfiles to use the new location.
Overall, the changes seem straightforward and should not introduce any issues. However, there are a few things that could be improved:
additional_args
variable could be defined using a template string to make the code more readable.DOCKERFILE
variable is empty before attempting to download the Dockerfile.if
statements checking for the presence of BASE_IMG
and RELEASE_TAG
could be combined into a single check using an &&
operator.Here's an example of how the code in the docker-common.groovy
file could be improved:
+ def additional_args = ""
+ if (params.BASE_IMG) {
+ additional_args += " --build-arg BASE_IMG=${params.BASE_IMG}"
+ }
+
+ sh """
+ cd monitoring/
+ mv Dockerfile Dockerfile.bak || true
+-curl -C - --retry 5 --retry-delay 6 --retry-max-time 60 -o Dockerfile ${DOCKERFILE}
++if [ -n "$DOCKERFILE" ]; then
++ curl -C - --retry 5 --retry-delay 6 --retry-max-time 60 -o Dockerfile ${DOCKERFILE}
++fi
+ cat Dockerfile
+-docker build --pull -t ${imagePlaceHolder} . --build-arg BASE_IMG=${params.BASE_IMG}
++docker build --pull -t ${imagePlaceHolder} .${additional_args}
+ """
Similar changes could be made to the other files in the pull request.
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 changes are:
additionalArgs
variable has been added to the docker-common.groovy
file to allow for passing in the BASE_IMG
build argument.tiflash
in the cd/atom-jobs/products/tiflash/master.groovy
file has been updated.tidb
in the cd/dev-build.groovy
, cd/nightly/release-all-images-by-branch.groovy
, cd/pre-release-community-docker-rocky.groovy
, and cd/pre-release-enterprise-docker-rocky.groovy
files has been updated.There do not appear to be any potential problems with this pull request.
Suggestions:
additionalArgs
assignment explaining its purpose and how to use it.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, this PR is about refactoring the Jenkins pipelines to use a new Dockerfile URL location by reverting changes made in a previous PR (2959).
The main changes in the diff are:
additionalArgs
variable that concatenates --build-arg BASE_IMG=${params.BASE_IMG}
if params.BASE_IMG
exists.DOCKERFILE
with the new URL location for the Dockerfile.docker build
command with docker build --pull -t ${imagePlaceHolder} . ${additionalArgs}
There are no potential problems that I could identify. However, here are some suggestions:
Overall, the changes seem reasonable and should improve the maintainability of the pipelines.
/approve
/approve
[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
Reverts PingCAP-QE/ci#2959