mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: stop amputating RC suffixes from docs URLs (#23903)
Fixes #23897 (docs link only — naming rename is in #23905) - Fix version stripping logic in both Go (`codersdk/deployment.go`) and TypeScript (`site/src/utils/docs.ts`) to preserve `-rc.X` suffixes instead of amputating them along with `-devel` - Add `v0.0.0` fallback in the TS frontend to match Go backend behavior for dev builds - Add tests covering RC, devel, and plain release version strings > 🤖 Written by a Coder Agent. Will be reviewed by a human.
This commit is contained in:
@@ -1251,7 +1251,11 @@ func DefaultSupportLinks(docsURL string) []LinkConfig {
|
||||
}
|
||||
|
||||
func removeTrailingVersionInfo(v string) string {
|
||||
return strings.Split(strings.Split(v, "-")[0], "+")[0]
|
||||
// Strip build metadata (everything after '+').
|
||||
v, _, _ = strings.Cut(v, "+")
|
||||
// Strip '-devel' suffix if present.
|
||||
v = strings.TrimSuffix(v, "-devel")
|
||||
return v
|
||||
}
|
||||
|
||||
func DefaultDocsURL() string {
|
||||
|
||||
Reference in New Issue
Block a user