-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: cherry pick pika 355 to 40 #3061
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
Changes from 12 commits
0aa43fc
2898a92
2af64e5
5d0b587
1be9d3f
fc14508
a47a7fc
899b347
013ac00
e780a9f
08f1a85
5c5d89d
057720a
e23ec9d
605e7a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,30 +1,36 @@ | ||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||
|
|
||||||||||||||||||
| version=`git log --date=iso --pretty=format:"%cd @%H" -1` | ||||||||||||||||||
| CODIS_MAJOR=3 | ||||||||||||||||||
| CODIS_MINOR=5 | ||||||||||||||||||
| CODIS_PATCH=4 | ||||||||||||||||||
|
|
||||||||||||||||||
| gitsha=`git log --pretty=format:"%H" -1` | ||||||||||||||||||
| if [ $? -ne 0 ]; then | ||||||||||||||||||
| version="unknown version" | ||||||||||||||||||
| gitsha ="unknown version gitsha" | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix syntax error in error handling. There's a syntax error in the fallback assignment for gitsha - there should not be a space between the variable name and the equals sign in bash. - gitsha ="unknown version gitsha"
+ gitsha="unknown version gitsha"📝 Committable suggestion
Suggested change
|
||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| compile=`date +"%F %T %z"`" by "`go version` | ||||||||||||||||||
| compile=`date +"%F %T %Z"` | ||||||||||||||||||
| if [ $? -ne 0 ]; then | ||||||||||||||||||
| compile="unknown datetime" | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| describe=`git describe --tags 2>/dev/null` | ||||||||||||||||||
| if [ $? -eq 0 ]; then | ||||||||||||||||||
| version="${version} @${describe}" | ||||||||||||||||||
| goversion=$(go version | sed 's/go version //') | ||||||||||||||||||
| if [ $? -ne 0 ]; then | ||||||||||||||||||
| compile="unknown go version" | ||||||||||||||||||
| fi | ||||||||||||||||||
|
Comment on lines
+17
to
20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error handling sets the wrong variable. When the goversion=$(go version | sed 's/go version //')
if [ $? -ne 0 ]; then
- compile="unknown go version"
+ goversion="unknown go version"
fi📝 Committable suggestion
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| cat << EOF | gofmt > pkg/utils/version.go | ||||||||||||||||||
| package utils | ||||||||||||||||||
|
|
||||||||||||||||||
| const ( | ||||||||||||||||||
| Version = "$version" | ||||||||||||||||||
| Version = "$CODIS_MAJOR.$CODIS_MINOR.$CODIS_PATCH" | ||||||||||||||||||
| Gitsha = "$gitsha" | ||||||||||||||||||
| Compile = "$compile" | ||||||||||||||||||
| GoVersion = "$goversion" | ||||||||||||||||||
| ) | ||||||||||||||||||
| EOF | ||||||||||||||||||
|
|
||||||||||||||||||
| cat << EOF > bin/version | ||||||||||||||||||
| version = $version | ||||||||||||||||||
| gitsha = $gitsha | ||||||||||||||||||
| compile = $compile | ||||||||||||||||||
| EOF | ||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed critical field assignment bug in
UnmarshalJSONThis change corrects a critical bug where master host and port values were previously swapped during JSON unmarshalling. The fix ensures proper assignment of host and port values, preventing potential connection issues between master and slave servers.