Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(go): bump the module version and support go install #979

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

qwqcode
Copy link
Member

@qwqcode qwqcode commented Sep 18, 2024

BREAKING CHANGE: The original Go module name was github.com/ArtalkJS/Artalk, but it has now been updated to github.com/ArtalkJS/Artalk/v2. This modification may impact the CI if you're compiling Artalk and passing a -ldflags -X version flag. The frontend UI client remains unaffected, and this change only concerns server-side developers.

Follow Go Mod File Retract:

If a module is released at major version v2 or higher, its path must have a major version suffix. A module with a major version suffix may be defined in one of two subdirectories: one with the suffix, and one without. For example, suppose a new version of the module above is released with the path example.com/monorepo/foo/bar/v2. Its go.mod file may be in either foo/bar or foo/bar/v2.

https://go.dev/ref/mod#go-mod-file-retract

BREAKING CHANGE: The original Go module name was `github.com/ArtalkJS/Artalk`, but it has now been updated to `github.com/ArtalkJS/Artalk/v2`. This modification may impact the CI if you're compiling Artalk and passing a `-ldflags -X` version flag. The frontend UI client remains unaffected, and this change only concerns server-side developers.
@qwqcode qwqcode changed the title refactor(go): bump the module version and support go install refactor(go): bump the module version and support go install Sep 18, 2024
Copy link

codecov bot commented Sep 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 32.16%. Comparing base (a98a50a) to head (df26393).
Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
internal/config/meta/gen/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #979   +/-   ##
=======================================
  Coverage   32.16%   32.16%           
=======================================
  Files         205      205           
  Lines        6842     6842           
=======================================
  Hits         2201     2201           
  Misses       4487     4487           
  Partials      154      154           
Flag Coverage Δ
go 32.16% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@qwqcode qwqcode merged commit 798ac17 into master Sep 18, 2024
6 of 7 checks passed
@qwqcode qwqcode deleted the refactor/go branch September 18, 2024 08:14
qwqcode added a commit that referenced this pull request Sep 18, 2024
BREAKING CHANGE: The original Go module name was `github.com/ArtalkJS/Artalk`, but it has now been updated to `github.com/artalkjs/artalk/v2` (all lowercase). This modification may impact the CI if you're compiling Artalk and passing a `-ldflags -X` version flag. The frontend UI client remains unaffected, and this change only concerns server-side developers.
@qwqcode
Copy link
Member Author

qwqcode commented Sep 18, 2024

Since the binary file name after go install must match the module name, the module name had to be changed to all lowercase. This ensures that the artalk command can be found in the command line (rather than using the capitalized Artalk as the binary program name).

golang/go#44469

qwqcode added a commit that referenced this pull request Sep 18, 2024
BREAKING CHANGE: The original Go module name was `github.com/ArtalkJS/Artalk`, which has now been modified to `github.com/artalkjs/artalk/v2` (all lowercase). This change may affect the CI pipeline or other areas if you are compiling the Artalk server and have specified the fixed Go module name. Regarding the original `-ldflags -X github.com/ArtalkJS/Artalk/internal/config.Version` and `CommitHash` definitions, please remove them, as they are now obsolete. The `Version` has been hardcoded into the Go code, and the `CommitHash` is now read from the Go build info via runtime/debug’s vcs.revision value. This change only affects the server developers and does not impact the frontend UI client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant