Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ jobs:
name: build docker images(dataset-controller)
command: |
FLUID_VERSION=$(sed -n -e 's/^VERSION := //p' Makefile)
HELM_VERSION=$(sed -n -e 's/^HELM_VERSION ?= //p' Makefile)
FLUID_VERSION=$FLUID_VERSION-$(git rev-parse --short HEAD || echo "HEAD")
Comment on lines 26 to 27
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The CI script parses HELM_VERSION from the Makefile inline in the docker build invocation. Since sed succeeds even when there is no match, this can silently pass an empty HELM_VERSION and build with an unintended Helm version. Consider extracting HELM_VERSION into a variable on its own line and adding an explicit non-empty check (fail fast) before running docker build (and reuse the variable for readability).

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

PR description still contains placeholder text (e.g., fixes #XXXX) and is missing verification details/test notes. Please update the PR template fields so reviewers can trace the motivating issue and how this change was validated.

Copilot uses AI. Check for mistakes.
docker build --build-arg TARGETARCH=amd64 --build-arg HELM_VERSION=v3.17.3 --build-arg FLUID_VERSION=$FLUID_VERSION . -f docker/Dockerfile.dataset -t dataset-controller:${CIRCLE_BUILD_NUM}
docker build --build-arg TARGETARCH=amd64 --build-arg HELM_VERSION=$HELM_VERSION --build-arg FLUID_VERSION=$FLUID_VERSION . -f docker/Dockerfile.dataset -t dataset-controller:${CIRCLE_BUILD_NUM}
Comment on lines +28 to +29
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The extraction of HELM_VERSION from the Makefile is repeated across multiple steps, which is a maintainability concern. Additionally, the sed command is somewhat fragile as it doesn't handle trailing spaces or comments on the same line.

Consider using a more robust regex and quoting the variables in the docker build command to prevent issues with special characters or spaces. Also, using the ${VAR:-DEFAULT} syntax allows overriding the version via environment variables, matching the ?= semantics in the Makefile.

            HELM_VERSION=${HELM_VERSION:-$(sed -n -e 's/^HELM_VERSION ?= \([^ ]*\).*/\1/p' Makefile)}
            docker build --build-arg TARGETARCH=amd64 --build-arg HELM_VERSION="$HELM_VERSION" --build-arg FLUID_VERSION="$FLUID_VERSION" . -f docker/Dockerfile.dataset -t dataset-controller:${CIRCLE_BUILD_NUM}

- run:
name: build docker images(alluxioruntime-controller)
command: |
FLUID_VERSION=$(sed -n -e 's/^VERSION := //p' Makefile)
FLUID_VERSION=$FLUID_VERSION-$(git rev-parse --short HEAD || echo "HEAD")
Comment on lines 32 to 34
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

Same concern as above: parsing HELM_VERSION inline via sed can yield an empty value without failing the step. Extract it once, validate it, and reuse it in the docker build command to avoid silent version drift.

Copilot uses AI. Check for mistakes.
docker build --build-arg TARGETARCH=amd64 --build-arg HELM_VERSION=v3.17.3 --build-arg FLUID_VERSION=$FLUID_VERSION . -f docker/Dockerfile.alluxioruntime -t alluxioruntime-controller:${CIRCLE_BUILD_NUM}
docker build --build-arg TARGETARCH=amd64 --build-arg HELM_VERSION=$(sed -n -e 's/^HELM_VERSION ?= //p' Makefile) --build-arg FLUID_VERSION=$FLUID_VERSION . -f docker/Dockerfile.alluxioruntime -t alluxioruntime-controller:${CIRCLE_BUILD_NUM}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Similar to the previous step, extracting HELM_VERSION into a variable makes the build command cleaner and easier to read.

            HELM_VERSION=$(sed -n -e 's/^HELM_VERSION ?= //p' Makefile)
            docker build --build-arg TARGETARCH=amd64 --build-arg HELM_VERSION=$HELM_VERSION --build-arg FLUID_VERSION=$FLUID_VERSION . -f docker/Dockerfile.alluxioruntime -t alluxioruntime-controller:${CIRCLE_BUILD_NUM}

- run:
name: build docker images(fluid-csi)
command: |
FLUID_VERSION=$(sed -n -e 's/^VERSION := //p' Makefile)
FLUID_VERSION=$FLUID_VERSION-$(git rev-parse --short HEAD || echo "HEAD")
Comment on lines 39 to 41
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

Same concern as above: sed will return success even if HELM_VERSION isn't matched, which can result in an empty build-arg. Extract HELM_VERSION into a variable, assert it's non-empty, then invoke docker build.

Copilot uses AI. Check for mistakes.
docker build --build-arg TARGETARCH=amd64 --build-arg HELM_VERSION=v3.17.3 . -f docker/Dockerfile.csi -t fluid-csi:${CIRCLE_BUILD_NUM}
docker build --build-arg TARGETARCH=amd64 --build-arg HELM_VERSION=$(sed -n -e 's/^HELM_VERSION ?= //p' Makefile) . -f docker/Dockerfile.csi -t fluid-csi:${CIRCLE_BUILD_NUM}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The HELM_VERSION and TARGETARCH build arguments are not defined or used in docker/Dockerfile.csi. Passing unused build arguments can lead to confusion and should be removed to keep the CI configuration clean. Additionally, the FLUID_VERSION variable constructed in lines 38-39 is also unused in this specific build step.

            docker build . -f docker/Dockerfile.csi -t fluid-csi:${CIRCLE_BUILD_NUM}


# maybe later we need to upload output to helm repository
Loading