Skip to content

Commit 051ce13

Browse files
authored
[#147]: release: v2024.1.0
2 parents da4f143 + 18d0f93 commit 051ce13

File tree

22 files changed

+238
-97
lines changed

22 files changed

+238
-97
lines changed

.github/workflows/linters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
- name: Run linter
1919
uses: golangci/golangci-lint-action@v4.0.0 # Action page: <https://github.com/golangci/golangci-lint-action>
2020
with:
21-
version: v1.54 # without patch version
21+
version: v1.57 # without patch version
2222
only-new-issues: false # show only new issues if it's a pull request
2323
args: --timeout=10m --build-tags=race

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ jobs:
7979
TIME: ${{ secrets.TIME }}
8080
run: |
8181
go install github.com/roadrunner-server/velox/cmd/vx@latest
82-
vx build -c velox_rr_v2023.toml -o="."
82+
vx build -c velox_rr_v2024.toml -o="."
8383
./rr --version

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363
CGO_ENABLED: 0
6464
LDFLAGS: >-
6565
-s
66-
-X github.com/roadrunner-server/velox/internal/version.version=${{ steps.values.outputs.version }}
67-
-X github.com/roadrunner-server/velox/internal/version.buildTime=${{ steps.values.outputs.timestamp }}
66+
-X github.com/roadrunner-server/velox/v2024/internal/version.version=${{ steps.values.outputs.version }}
67+
-X github.com/roadrunner-server/velox/v2024/internal/version.buildTime=${{ steps.values.outputs.timestamp }}
6868
run: |
6969
go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/vx
7070
stat "./${{ steps.values.outputs.binary-name }}"
@@ -92,7 +92,7 @@ jobs:
9292
- name: Create distributive
9393
run: |
9494
mkdir ${{ steps.dist-dir.outputs.name }}
95-
rm velox.toml && mv velox_rr_v2023.toml velox.toml
95+
rm velox.toml && mv velox_rr_v2024.toml velox.toml
9696
mv "./${{ steps.values.outputs.binary-name }}" ./${{ steps.dist-dir.outputs.name }}/
9797
cp ./README.md ./LICENSE ./velox.toml ./${{ steps.dist-dir.outputs.name }}/
9898
@@ -165,5 +165,10 @@ jobs:
165165
tags: |
166166
spiralscout/velox:latest
167167
spiralscout/velox:${{ steps.values.outputs.version }}
168+
spiralscout/velox:2024.1
169+
spiralscout/velox:2024
170+
168171
ghcr.io/roadrunner-server/velox:latest
169172
ghcr.io/roadrunner-server/velox:${{ steps.values.outputs.version }}
173+
ghcr.io/roadrunner-server/velox:2024.1
174+
ghcr.io/roadrunner-server/velox:2024

.golangci.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,11 @@
33
run:
44
go: '1.17'
55
timeout: 1m
6-
skip-dirs:
7-
- .github
8-
- .git
96
allow-parallel-runners: true
107

11-
output:
12-
format: colored-line-number # colored-line-number|line-number|json|tab|checkstyle|code-climate
13-
148
linters-settings:
159
wsl:
1610
allow-assign-and-anything: true
17-
govet:
18-
check-shadowing: true
19-
golint:
20-
min-confidence: 0.1
2111
godot:
2212
scope: declarations
2313
capital: true
@@ -35,7 +25,6 @@ linters-settings:
3525
range-loops: true
3626
for-loops: true
3727
nolintlint:
38-
allow-leading-space: false
3928
require-specific: true
4029

4130
linters: # All available linters list: <https://golangci-lint.run/usage/linters/>
@@ -76,6 +65,9 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
7665
- whitespace # Tool for detection of leading and trailing whitespace
7766

7867
issues:
68+
exclude-dirs:
69+
- .github
70+
- .git
7971
exclude-rules:
8072
- path: _test\.go
8173
linters:

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ WORKDIR /src
1212

1313
# arguments to pass on each go tool link invocation
1414
ENV LDFLAGS="-s \
15-
-X github.com/roadrunner-server/velox/internal/version.version=$APP_VERSION \
16-
-X github.com/roadrunner-server/velox/internal/version.buildTime=$BUILD_TIME"
15+
-X github.com/roadrunner-server/velox/v2024/internal/version.version=$APP_VERSION \
16+
-X github.com/roadrunner-server/velox/v2024/internal/version.buildTime=$BUILD_TIME"
1717

1818
# verbose
1919
RUN set -x

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
1. ⚠️ Do not use the plugin's `master` branch.
2222
2. ⚠️ Use tags with the **same** **major** version (e.g `logger` v3.0.3 + `amqp` v3.0.5, but not `logger` v4.0.0 + `amqp` v3.0.5)
2323
3. ⚠️ **Currently supported plugins version is: `v4.x.x`**
24-
4. ⚠️ **Currently supported RR version is: `>=v2023.x.x`**
24+
4. ⚠️ **Currently supported RR version is: `>=v2024.x.x`**
2525

2626
# Docs: [link](https://docs.roadrunner.dev/customization/build)

builder/builder.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"syscall"
1414

1515
"github.com/hashicorp/go-version"
16-
"github.com/roadrunner-server/velox"
17-
"github.com/roadrunner-server/velox/builder/templates"
16+
"github.com/roadrunner-server/velox/v2024"
17+
"github.com/roadrunner-server/velox/v2024/builder/templates"
1818
"go.uber.org/zap"
1919
)
2020

@@ -75,6 +75,11 @@ func (b *Builder) Build(rrModule string) error { //nolint:gocyclo
7575

7676
// compatibility with version 2
7777
switch t.ModuleVersion {
78+
case velox.V2024:
79+
err = templates.CompileTemplateV2024(buf, t)
80+
if err != nil {
81+
return err
82+
}
7883
case velox.V2023:
7984
err = templates.CompileTemplateV2023(buf, t)
8085
if err != nil {
@@ -133,6 +138,11 @@ func (b *Builder) Build(rrModule string) error { //nolint:gocyclo
133138

134139
// compatibility with version 2
135140
switch t.ModuleVersion {
141+
case velox.V2024:
142+
err = templates.CompileGoModTemplate2024(buf, t)
143+
if err != nil {
144+
return err
145+
}
136146
case velox.V2023:
137147
err = templates.CompileGoModTemplate2023(buf, t)
138148
if err != nil {
@@ -200,7 +210,7 @@ func (b *Builder) Write(d []byte) (int, error) {
200210
func validateModule(module string) (string, error) {
201211
if module == "master" {
202212
// default branch
203-
return velox.V2023, nil
213+
return velox.V2024, nil
204214
}
205215

206216
v, err := version.NewVersion(module)

builder/builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"path"
66
"testing"
77

8-
"github.com/roadrunner-server/velox"
8+
"github.com/roadrunner-server/velox/v2024"
99
"go.uber.org/zap"
1010
)
1111

builder/template_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"testing"
66

7-
"github.com/roadrunner-server/velox/builder/templates"
7+
"github.com/roadrunner-server/velox/v2024/builder/templates"
88
"github.com/stretchr/testify/require"
99
)
1010

builder/templates/entry.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,31 @@ func CompileGoModTemplate2023(buf *bytes.Buffer, data *Template) error {
7979

8080
return nil
8181
}
82+
83+
func CompileTemplateV2024(buf *bytes.Buffer, data *Template) error {
84+
tmplt, err := template.New("plugins.go").Parse(PluginsTemplateV2024)
85+
if err != nil {
86+
return err
87+
}
88+
89+
err = tmplt.Execute(buf, data)
90+
if err != nil {
91+
return err
92+
}
93+
94+
return nil
95+
}
96+
97+
func CompileGoModTemplate2024(buf *bytes.Buffer, data *Template) error {
98+
tmplt, err := template.New("go.mod").Parse(GoModTemplateV2024)
99+
if err != nil {
100+
return err
101+
}
102+
103+
err = tmplt.Execute(buf, data)
104+
if err != nil {
105+
return err
106+
}
107+
108+
return nil
109+
}

builder/templates/templateV2024.go

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package templates
2+
3+
const GoModTemplateV2024 string = `
4+
module github.com/roadrunner-server/roadrunner/{{.ModuleVersion}}
5+
6+
go 1.21
7+
8+
toolchain go1.21.5
9+
10+
require (
11+
github.com/buger/goterm v1.0.4
12+
github.com/dustin/go-humanize v1.0.1
13+
github.com/joho/godotenv v1.5.1
14+
github.com/olekukonko/tablewriter v0.0.5
15+
github.com/spf13/cobra v1.8.0
16+
github.com/spf13/viper v1.18.2
17+
github.com/stretchr/testify v1.8.2
18+
go.uber.org/automaxprocs v1.5.2
19+
github.com/roadrunner-server/informer/v4 latest
20+
github.com/roadrunner-server/resetter/v4 latest
21+
github.com/roadrunner-server/config/v4 latest
22+
23+
// Go module pseudo-version
24+
{{range $v := .Entries}}{{$v.Module}} {{$v.PseudoVersion}}
25+
{{end}}
26+
)
27+
28+
exclude (
29+
github.com/spf13/viper v1.18.0
30+
github.com/spf13/viper v1.18.1
31+
github.com/uber-go/tally/v4 v4.1.11
32+
github.com/uber-go/tally/v4 v4.1.12
33+
go.temporal.io/api v1.26.1
34+
)
35+
36+
replace (
37+
{{range $v := .Entries}}{{if (ne $v.Replace "")}}{{$v.Module}} => {{$v.Replace}}
38+
{{end}}{{end}}
39+
)
40+
`
41+
42+
const PluginsTemplateV2024 string = `
43+
package container
44+
45+
import (
46+
"github.com/roadrunner-server/informer/v4"
47+
"github.com/roadrunner-server/resetter/v4"
48+
{{range $v := .Entries}}{{$v.Prefix}} "{{$v.Module}}"
49+
{{end}}
50+
)
51+
52+
func Plugins() []any {
53+
return []any {
54+
// bundled
55+
// informer plugin (./rr workers, ./rr workers -i)
56+
&informer.Plugin{},
57+
// resetter plugin (./rr reset)
58+
&resetter.Plugin{},
59+
60+
// std and custom plugins
61+
{{range $v := .Entries}}&{{$v.Prefix}}.{{$v.Structure}},
62+
{{end}}
63+
}
64+
}
65+
`

cmd/vx/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"path/filepath"
66

77
"github.com/fatih/color"
8-
"github.com/roadrunner-server/velox/internal/cli"
8+
"github.com/roadrunner-server/velox/v2024/internal/cli"
99
)
1010

1111
func main() {

config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
const (
1111
ref string = "ref"
1212
defaultBranch string = "master"
13+
V2024 string = "v2024"
1314
V2023 string = "v2023"
1415
V2 string = "v2"
1516
gitlabBaseURL string = "https://gitlab.com"

github/parse_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55
"time"
66

7-
"github.com/roadrunner-server/velox"
7+
"github.com/roadrunner-server/velox/v2024"
88
"github.com/stretchr/testify/assert"
99
"github.com/stretchr/testify/require"
1010
)

github/pool.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"sync"
1212
"time"
1313

14-
"github.com/google/go-github/v53/github"
15-
"github.com/roadrunner-server/velox"
14+
"github.com/google/go-github/v61/github"
15+
"github.com/roadrunner-server/velox/v2024"
1616
"go.uber.org/zap"
1717
)
1818

github/repo.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"path/filepath"
1414
"strings"
1515

16-
"github.com/google/go-github/v53/github"
17-
"github.com/roadrunner-server/velox"
16+
"github.com/google/go-github/v61/github"
17+
"github.com/roadrunner-server/velox/v2024"
1818
"go.uber.org/zap"
1919
"golang.org/x/oauth2"
2020
)
@@ -54,7 +54,7 @@ func NewGHRepoInfo(cfg *velox.Config, log *zap.Logger) *GHRepo {
5454
// DownloadTemplate downloads template repository ->
5555
func (r *GHRepo) DownloadTemplate(tmp, version string) (string, error) { //nolint:gocyclo
5656
r.log.Info("[GET ARCHIVE LINK]", zap.String("owner", rrOwner), zap.String("repository", rrRepo), zap.String("encoding", "zip"), zap.String("ref", version))
57-
url, resp, err := r.client.Repositories.GetArchiveLink(context.Background(), rrOwner, rrRepo, github.Zipball, &github.RepositoryContentGetOptions{Ref: version}, true)
57+
url, resp, err := r.client.Repositories.GetArchiveLink(context.Background(), rrOwner, rrRepo, github.Zipball, &github.RepositoryContentGetOptions{Ref: version}, 10)
5858
if err != nil {
5959
return "", err
6060
}

gitlab/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"strings"
1212
"time"
1313

14-
"github.com/roadrunner-server/velox"
14+
"github.com/roadrunner-server/velox/v2024"
1515
"github.com/xanzy/go-gitlab"
1616
"go.uber.org/zap"
1717
)

go.mod

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
module github.com/roadrunner-server/velox
1+
module github.com/roadrunner-server/velox/v2024
22

33
go 1.22.2
44

55
require (
66
github.com/fatih/color v1.16.0
7-
github.com/google/go-github/v53 v53.2.0
7+
github.com/google/go-github/v61 v61.0.0
88
github.com/hashicorp/go-version v1.6.0
99
github.com/pkg/errors v0.9.1
1010
github.com/spf13/cobra v1.8.0
@@ -17,8 +17,6 @@ require (
1717
)
1818

1919
require (
20-
github.com/ProtonMail/go-crypto v1.0.0 // indirect
21-
github.com/cloudflare/circl v1.3.7 // indirect
2220
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2321
github.com/fsnotify/fsnotify v1.7.0 // indirect
2422
github.com/google/go-querystring v1.1.0 // indirect
@@ -40,7 +38,6 @@ require (
4038
github.com/spf13/pflag v1.0.5 // indirect
4139
github.com/subosito/gotenv v1.6.0 // indirect
4240
go.uber.org/multierr v1.11.0 // indirect
43-
golang.org/x/crypto v0.22.0 // indirect
4441
golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8 // indirect
4542
golang.org/x/sys v0.19.0 // indirect
4643
golang.org/x/text v0.14.0 // indirect

0 commit comments

Comments
 (0)