Skip to content
Merged
Changes from all 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
26 changes: 19 additions & 7 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
run: sudo apt install curl

- name: Build the image
run: go mod tidy -compat=1.21 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest
run: go mod tidy -compat=1.25 && go mod vendor && docker build . --file Dockerfile --tag quay.io/fetchit/fetchit-amd:latest
Copy link

Choose a reason for hiding this comment

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

suggestion (review_instructions): Using -compat=1.25 may be ahead of the Go toolchain version used in your images/runners, which can cause portability or build issues if 1.25 isn’t available or the module’s go directive is lower.

It might be safer to align -compat with the actual Go version used in your Dockerfile/CI runners and the go directive in go.mod. If your toolchain or go directive is still on an earlier version (e.g., 1.21/1.22), setting -compat=1.25 could introduce subtle incompatibilities or rely on a version that isn’t yet supported in all environments. Consider updating the Go toolchain and go directive in tandem, or keeping -compat at the supported version for now.

Review instructions:

Path patterns: *

Instructions:
Include suggestions that improve code portability or correctness, especially when specific language features are used.

Copy link

Choose a reason for hiding this comment

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

issue (review_instructions): Bumping -compat to 1.25 in CI without confirming the actual Go toolchain and deployment targets may cause module resolution differences or failures compared to local/prod builds.

Using go mod tidy -compat=1.25 changes how module requirements are resolved and the minimum go version recorded in go.mod. If your actual Go toolchain in CI (or in production) is still <1.25, this can lead to go mod tidy failures or subtle differences in resolved dependencies between CI and other environments.

Actionable suggestion: either (a) also bump the Go toolchain version used in this workflow to 1.25 and ensure production uses the same, or (b) keep -compat aligned with the lowest Go version you actively support and run in production (e.g., leave it at 1.21 if that’s still the target), so dependency resolution is consistent across environments.

Review instructions:

Path patterns: *

Instructions:
Identify potential bugs or risks in the code and provide a clear explanation of the issue.

Copy link

Choose a reason for hiding this comment

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

issue (review_instructions): Using go mod tidy -compat=1.25 is likely a bug, since Go 1.25 does not exist yet and will cause this workflow step to fail.

go mod tidy’s -compat flag must reference a Go version that the toolchain actually understands. As of now, Go releases only go up to 1.22, so -compat=1.25 will cause go mod tidy to fail with an "unknown go version" error, breaking every job that runs this command.

Suggested fix: change -compat=1.25 to a supported version (for example, -compat=1.21 as before, or whatever version your go toolchain and go directive in go.mod actually target), and do the same for the other updated steps in this workflow.

Review instructions:

Path patterns: *

Instructions:
Identify and highlight potential bugs or risks in the code, such as missing syntax elements that could lead to unintended behavior.


- name: Export image
run: docker save -o /tmp/fetchit.tar quay.io/fetchit/fetchit-amd:latest
Expand All @@ -110,7 +110,7 @@ jobs:
- uses: actions/checkout@v4

- name: Build the image
run: go mod tidy -compat=1.21 && go mod vendor && make build-ansible-cross-build-linux-amd64
run: go mod tidy -compat=1.25 && go mod vendor && make build-ansible-cross-build-linux-amd64

- name: docker list images
run: docker images
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
run: sudo apt install podman build-essential qemu-user qemu-user-static

- name: Build the image
run: go mod tidy -compat=1.21 && go mod vendor && CTR_CMD=podman make build-ansible-cross-build-linux-arm64
run: go mod tidy -compat=1.25 && go mod vendor && CTR_CMD=podman make build-ansible-cross-build-linux-arm64

- name: Export image
run: podman save -o /tmp/ansible-arm.tar quay.io/fetchit/fetchit-ansible-arm:latest
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
- uses: actions/checkout@v4

- name: Build the image
run: go mod tidy -compat=1.21 && go mod vendor && make build-systemd-cross-build-linux-amd64
run: go mod tidy -compat=1.25 && go mod vendor && make build-systemd-cross-build-linux-amd64

- name: docker list images
run: docker images
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
run: sudo apt install podman build-essential qemu-user qemu-user-static

- name: Build the image
run: go mod tidy -compat=1.21 && go mod vendor && CTR_CMD=podman make build-systemd-cross-build-linux-arm64
run: go mod tidy -compat=1.25 && go mod vendor && CTR_CMD=podman make build-systemd-cross-build-linux-arm64

- name: Export image
run: podman save -o /tmp/systemd-arm.tar quay.io/fetchit/fetchit-systemd-arm:latest
Expand Down Expand Up @@ -994,8 +994,20 @@ jobs:
- name: tag the image
run: sudo podman tag quay.io/sallyom/httpd-ex:latest registry.access.redhat.com/ubi8/httpd-24:latest

- name: Debug - Check what curl returns
run: curl -v http://localhost:8080/ || true

- name: Debug - Check what curl returns for index.html
run: curl -v http://localhost:8080/index.html || true

- name: Debug - Exec into container to check httpd
run: sudo podman exec httpd ps aux || true

- name: Debug - Check if index.html exists in container
run: sudo podman exec httpd ls -la /var/www/html/ || true

- name: Wait for podman auto-update
run: timeout 150 bash -c -- 'msg=0 ; until [ $msg -ge 1 ]; do msg=$( curl -s localhost:8080/index.html | grep "Welcome to your static httpd application" | wc -l ); done'
run: timeout 150 bash -c -- 'msg=0 ; until [ $msg -ge 1 ]; do msg=$( curl -s localhost:8080/index.html | grep "Welcome to your static httpd application" | wc -l ); sleep 2; done'

- name: check the service
if: always()
Expand Down Expand Up @@ -1968,7 +1980,7 @@ jobs:
run: sudo apt install podman build-essential qemu-user qemu-user-static

- name: Build the arm image
run: go mod tidy -compat=1.21 && go mod vendor && CTR_CMD=podman make build-containerized-cross-build-linux-arm64
run: go mod tidy -compat=1.25 && go mod vendor && CTR_CMD=podman make build-containerized-cross-build-linux-arm64

- name: Export image
run: podman save -o /tmp/fetchit-arm.tar quay.io/fetchit/fetchit-arm:latest
Expand Down
Loading