Skip to content

Conversation

milindl
Copy link
Contributor

@milindl milindl commented Oct 13, 2025

What

Checklist

  • Contains customer facing changes? Including API/behavior changes
  • Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required

References

JIRA:

Test & Review

Open questions / Follow-ups

@milindl milindl requested review from a team as code owners October 13, 2025 10:22
@Copilot Copilot AI review requested due to automatic review settings October 13, 2025 10:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the macOS CI environment and addresses code-signing issues on newer macOS versions. The changes ensure tests can run properly by conditionally using go run instead of executing unsigned binaries.

  • Updated macOS version from 13.5 to 15 for ARM64 builds
  • Added conditional logic to handle code-signing requirements on newer macOS
  • Modified test execution to use go run when code-signing is available

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
.semaphore/semaphore.yml Updated macOS machine type from 13.5 to 15 for ARM64
.semaphore/semaphore_commands.sh Added conditional code-signing logic for test execution
.semaphore/semaphore_integration_commands.sh Added conditional code-signing logic for integration test execution

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

This line is extremely long and difficult to read. Consider breaking it into multiple lines or using separate conditional blocks for better readability and maintainability.

Suggested change
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
if [[ $(command -v codesign) ]]; then
which go-kafkacat
go run $GO_TAGS examples/library-version/library-version.go
(go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
else
go-kafkacat --help
library-version
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
fi

Copilot uses AI. Check for mistakes.


# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

This line is extremely long and difficult to read. Consider breaking it into multiple lines or using separate conditional blocks for better readability and maintainability.

Suggested change
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
if [[ $(command -v codesign) ]]; then
which go-kafkacat
go run $GO_TAGS examples/library-version/library-version.go
if ! go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO"; then
echo "Incorrect linkage, expected $EXPECT_LINK_INFO"
false
fi
else
go-kafkacat --help
library-version
if ! library-version | grep "$EXPECT_LINK_INFO"; then
echo "Incorrect linkage, expected $EXPECT_LINK_INFO"
false
fi
fi

Copilot uses AI. Check for mistakes.


# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

The command go run examples/library-version/library-version.go is executed twice in the same line, which is inefficient. Consider storing the output in a variable and reusing it.

Suggested change
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
if [[ $(command -v codesign) ]]; then
which go-kafkacat
output="$(go run $GO_TAGS examples/library-version/library-version.go)"
echo "$output"
(echo "$output" | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
else
go-kafkacat --help
library-version
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
fi

Copilot uses AI. Check for mistakes.


# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

The command go run examples/library-version/library-version.go is executed twice in the same line, which is inefficient. Consider storing the output in a variable and reusing it.

Suggested change
if [[ $(command -v codesign) ]]; then which go-kafkacat; go run $GO_TAGS examples/library-version/library-version.go; (go run $GO_TAGS examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
if [[ $(command -v codesign) ]]; then which go-kafkacat; output=$(go run $GO_TAGS examples/library-version/library-version.go); echo "$output"; (echo "$output" | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi

Copilot uses AI. Check for mistakes.

@sonarqube-confluent
Copy link

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage No coverage information (55.70% Estimated after merge)
  • Duplications No duplication information (0.00% Estimated after merge)

Project ID: confluent-kafka-go

View in SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant