-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Check go and nodejs version by go.mod and package.json, update Go official site URL #19197
Conversation
Looks like upstream has removed support built with GO 1.16, the string should be updated here.
Maybe we can remove the whole
Line 3 in def5456
|
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.
Change is good in any case, it was missed in fe9626a
I think |
Why? Then why can I compile Gitea with my Go1.18 .......... |
Actually, I'm wrong, it specifies minimum as per https://go.dev/doc/modules/gomod-ref#go, so it might be an option to just parse it out of |
Why another? Go will report the correct required version automatically by |
Will go fail to build if the version is too low? If yes, than we can actually remove the check. |
Doesn't gitea have a minimum go version requirement? |
Yes, only the official supported Golang releases (the latest 2 minor versions) are supported.
Starting from 1.16, the So I think it's fine to remove the And it's also fine to keep the
|
Yes, I support this. Same can be done for |
I updated the go version parsing, and tested locally. |
Make go-check emit version hints when GO < 1.16? diff --git a/Makefile b/Makefile XGO_VERSION := go-1.18.x AIR_PACKAGE ?= github.com/cosmtrek/[email protected]
|
@silverwind I also make this PR use the nodejs version from package.json |
Makefile
Outdated
MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2) | ||
MIN_GO_VERSION := $(shell printf "%03d%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')) | ||
|
||
MIN_NODE_VERSION_STR := $(shell grep -Eo '"node":.*[0-9.]+"' package.json | sed -n 's/.*[^0-9.]\([0-9.]*\)"/\1/p') |
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.
May as well extract the third version segment as well because node version is always 3-segments as opposed to go version which is 2.
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.
It already has the 3-segments. The regex is [0-9.]*
Makefile
Outdated
MIN_NODE_VERSION := 012017000 | ||
|
||
MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2) | ||
MIN_GO_VERSION := $(shell printf "%03d%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')) |
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.
The line above extracts 2 segments, but this seems to output 3. Is it correct?
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.
It already has the 3-segments. The regex is [0-9.]*
Also, I strongly suggest not doing such |
Moved these lines into |
Things are going in a good direction, great, looking forward to it being fixed. |
Codecov Report
@@ Coverage Diff @@
## main #19197 +/- ##
==========================================
+ Coverage 46.55% 46.58% +0.02%
==========================================
Files 856 858 +2
Lines 123018 123128 +110
==========================================
+ Hits 57277 57365 +88
- Misses 58814 58833 +19
- Partials 6927 6930 +3
Continue to review full report at Codecov.
|
* giteaofficial/main: Check go and nodejs version by go.mod and package.json (go-gitea#19197) Add `ContextUser` to http request context (go-gitea#18798) Set OpenGraph title to DisplayName in profile pages (go-gitea#19206)
* Check go and nodejs version by go.mod and package.json * Update Go official site URL Co-authored-by: wxiaoguang <[email protected]>
* Check go and nodejs version by go.mod and package.json * Update Go official site URL Co-authored-by: wxiaoguang <[email protected]>
* Check go and nodejs version by go.mod and package.json * Update Go official site URL Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: gesangtome <[email protected]>
Looks like upstream has removed support built
with GO 1.16, the string should be updated here.