Skip to content

Conversation

aofei
Copy link
Member

@aofei aofei commented Jun 14, 2025

Release-as: 0.21.0

Release-as: 0.21.0

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
@Copilot Copilot AI review requested due to automatic review settings June 14, 2025 13:21
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 refactors the binary version handling to simplify version injection and improve consistency by renaming the version variable and function.

  • Renames the global version variable to VersionOverride and the version retrieval function to Version.
  • Updates build commands in Dockerfile and test workflow to remove explicit ldflags injection for version information.
  • Adjusts the .goreleaser.yaml configuration to use VersionOverride for version injection in releases.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cmd/goproxy/internal/internal.go Renames Version variable to VersionOverride and updates version retrieval logic.
cmd/goproxy/internal/goproxy_cmd.go Replaces call to binaryVersion() with Version() to use the updated version logic.
Dockerfile Simplifies the go build command by removing explicit ldflags settings for version injection.
.goreleaser.yaml Updates ldflags to use VersionOverride for release builds.
.github/workflows/test.yaml Adjusts the build command to match the new approach by removing version ldflags.
Comments suppressed due to low confidence (2)

Dockerfile:17

  • The updated Dockerfile build command no longer injects version information via ldflags. Please verify that this omission is intentional given that .goreleaser.yaml still sets the version via VersionOverride.
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o bin/ ./cmd/goproxy;

.github/workflows/test.yaml:51

  • The build command in the test workflow no longer sets ldflags for version injection. Confirm that test builds are expected to lack version details to maintain consistency with other build configurations.
run: go build -v -trimpath -ldflags "-s -w" -o bin/ ./cmd/goproxy

Copy link

codecov bot commented Jun 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 81.20%. Comparing base (0e9ff62) to head (d23619f).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cmd/goproxy/internal/internal.go 0.00% 6 Missing ⚠️
cmd/goproxy/internal/goproxy_cmd.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #129      +/-   ##
==========================================
+ Coverage   80.67%   81.20%   +0.53%     
==========================================
  Files          11       11              
  Lines        1371     1362       -9     
==========================================
  Hits         1106     1106              
+ Misses        257      248       -9     
  Partials        8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aofei aofei merged commit 1b19b35 into goproxy:master Jun 14, 2025
6 of 7 checks passed
@aofei aofei deleted the cmd/goproxy branch June 14, 2025 13:28
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