diff --git a/.gitignore b/.gitignore index 1fe5aad..f5281a3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ # Added by cargo **/target **/plugins_dev.toml -.vscode \ No newline at end of file +.vscode +rr \ No newline at end of file diff --git a/builder/builder.go b/builder/builder.go index 1ddf2bb..d3851f5 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -63,17 +63,17 @@ func (b *Builder) Build(rrModule string) error { //nolint:gocyclo t.Entries = make([]*templates.Entry, len(b.modules)) for i := 0; i < len(b.modules); i++ { t.Entries[i] = &templates.Entry{ - Module: b.modules[i].ModuleName, - Prefix: randStringBytes(5), - Structure: pluginStructureStr, - Version: b.modules[i].Version, - Replace: b.modules[i].Replace, + Module: b.modules[i].ModuleName, + Prefix: randStringBytes(5), + Structure: pluginStructureStr, + PseudoVersion: b.modules[i].PseudoVersion, + Replace: b.modules[i].Replace, } } buf := new(bytes.Buffer) - // compatibility with the version 2 + // compatibility with version 2 switch t.ModuleVersion { case velox.V2023: err = templates.CompileTemplateV2023(buf, t) @@ -131,7 +131,7 @@ func (b *Builder) Build(rrModule string) error { //nolint:gocyclo buf.Reset() - // compatibility with the version 2 + // compatibility with version 2 switch t.ModuleVersion { case velox.V2023: err = templates.CompileGoModTemplate2023(buf, t) @@ -147,6 +147,8 @@ func (b *Builder) Build(rrModule string) error { //nolint:gocyclo return fmt.Errorf("unknown module version: %s", t.ModuleVersion) } + b.log.Debug("[RESULTING TEMPLATE]", zap.String("template", buf.String())) + _, err = goModFile.Write(buf.Bytes()) if err != nil { return err @@ -160,16 +162,9 @@ func (b *Builder) Build(rrModule string) error { //nolint:gocyclo return err } - for i := 0; i < len(t.Entries); i++ { - // go get only deps w/o replace - if t.Entries[i].Replace != "" { - t.Entries = append(t.Entries, b.getDepsReplace(t.Entries[i].Replace)...) - continue - } - err = b.goGetMod(t.Entries[i].Module, t.Entries[i].Version) - if err != nil { - return err - } + err = b.goModDowloadCmd() + if err != nil { + return err } err = b.goModTidyCmd() @@ -259,9 +254,9 @@ func (b *Builder) goBuildCmd(out string) error { return nil } -func (b *Builder) goModTidyCmd() error { - b.log.Info("[EXECUTING CMD]", zap.String("cmd", "go mod tidy")) - cmd := exec.Command("go", "mod", "tidy") +func (b *Builder) goModDowloadCmd() error { + b.log.Info("[EXECUTING CMD]", zap.String("cmd", "go mod download")) + cmd := exec.Command("go", "mod", "download") cmd.Stderr = b err := cmd.Start() if err != nil { @@ -274,11 +269,10 @@ func (b *Builder) goModTidyCmd() error { return nil } -func (b *Builder) goGetMod(repo, hash string) error { - b.log.Info("[EXECUTING CMD]", zap.String("cmd", "go get "+repo+"@"+hash)) - cmd := exec.Command("go", "get", repo+"@"+hash) //nolint:gosec +func (b *Builder) goModTidyCmd() error { + b.log.Info("[EXECUTING CMD]", zap.String("cmd", "go mod tidy")) + cmd := exec.Command("go", "mod", "tidy") cmd.Stderr = b - err := cmd.Start() if err != nil { return err diff --git a/builder/template_test.go b/builder/template_test.go index 0df58d4..72d95c3 100644 --- a/builder/template_test.go +++ b/builder/template_test.go @@ -14,6 +14,9 @@ package container import ( "github.com/roadrunner-server/informer/v4" "github.com/roadrunner-server/resetter/v4" + aba "github.com/roadrunner-server/some_plugin" + abc "github.com/roadrunner-server/some_plugin/v2" + abd "github.com/roadrunner-server/some_plugin/v22234" ab "github.com/roadrunner-server/rpc/v4" cd "github.com/roadrunner-server/http/v4" ef "github.com/roadrunner-server/grpc/v4" @@ -30,6 +33,9 @@ func Plugins() []any { &resetter.Plugin{}, // std and custom plugins + &aba.Plugin{}, + &abc.Plugin{}, + &abd.Plugin{}, &ab.Plugin{}, &cd.Plugin{}, &ef.Plugin{}, @@ -44,6 +50,24 @@ func TestCompile(t *testing.T) { Entries: make([]*templates.Entry, 0, 10), } + tt.Entries = append(tt.Entries, &templates.Entry{ + Module: "github.com/roadrunner-server/some_plugin", + Structure: "Plugin{}", + Prefix: "aba", + }) + + tt.Entries = append(tt.Entries, &templates.Entry{ + Module: "github.com/roadrunner-server/some_plugin/v2", + Structure: "Plugin{}", + Prefix: "abc", + }) + + tt.Entries = append(tt.Entries, &templates.Entry{ + Module: "github.com/roadrunner-server/some_plugin/v22234", + Structure: "Plugin{}", + Prefix: "abd", + }) + tt.Entries = append(tt.Entries, &templates.Entry{ Module: "github.com/roadrunner-server/rpc/v4", Structure: "Plugin{}", diff --git a/builder/templates/entry.go b/builder/templates/entry.go index fe449a2..ad7a82e 100644 --- a/builder/templates/entry.go +++ b/builder/templates/entry.go @@ -7,11 +7,14 @@ import ( // Entry represents all info about module type Entry struct { + // Module is the module name (github.com/roadrunner-server/logger/v2) Module string Structure string - Prefix string - Version string - // Replace directive, should include path + // Prefix is the prefix for the plugin to avoid collisions + Prefix string + // PseudoVersion is the pseudo version of the module (v0.0.0-20210101000000-000000000000) + PseudoVersion string + // Replace directive, should include a path Replace string } diff --git a/builder/templates/templateV2023.go b/builder/templates/templateV2023.go index a1cc60a..b09107b 100644 --- a/builder/templates/templateV2023.go +++ b/builder/templates/templateV2023.go @@ -5,7 +5,7 @@ module github.com/roadrunner-server/roadrunner/{{.ModuleVersion}} go 1.21 -toolchain go1.21.0 +toolchain go1.21.1 require ( github.com/buger/goterm v1.0.4 @@ -13,9 +13,15 @@ require ( github.com/joho/godotenv v1.5.1 github.com/olekukonko/tablewriter v0.0.5 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.15.0 + github.com/spf13/viper v1.17.0 github.com/stretchr/testify v1.8.2 go.uber.org/automaxprocs v1.5.2 + github.com/roadrunner-server/informer/v4 latest + github.com/roadrunner-server/resetter/v4 latest + + // Go module pseudo-version + {{range $v := .Entries}}{{$v.Module}} {{$v.PseudoVersion}} + {{end}} ) replace ( diff --git a/cmd/vx/main.go b/cmd/vx/main.go index 0c7fef2..94e9362 100644 --- a/cmd/vx/main.go +++ b/cmd/vx/main.go @@ -9,7 +9,7 @@ import ( ) func main() { - // os.Args[0] always contains path to the executable, like foo/bar/rr -> rr + // os.Args[0] always contains a path to the executable, like foo/bar/rr -> rr cmd := cli.NewCommand(filepath.Base(os.Args[0])) err := cmd.Execute() if err != nil { diff --git a/github/modinfo.go b/github/modinfo.go new file mode 100644 index 0000000..caddae4 --- /dev/null +++ b/github/modinfo.go @@ -0,0 +1,33 @@ +package github + +import ( + "fmt" + "regexp" + "strconv" + "time" + + m "golang.org/x/mod/module" +) + +var vr = regexp.MustCompile("/v(\\d+)$") //nolint:gosimple + +// here we accept a module name and return the version +// e.g.: github.com/roadrunner-server/logger/v2 => v2 +func parseModuleInfo(module string, t time.Time, rev string) string { + match := vr.FindStringSubmatch(module) + var version string + if len(match) > 1 { + if !IsDigit(match[1]) { + return m.PseudoVersion("", "", t, rev) + } + + version = fmt.Sprintf("v%s", match[1]) + } + + return m.PseudoVersion(version, "", t, rev) +} + +func IsDigit(num string) bool { + _, err := strconv.ParseInt(num, 10, 64) + return err == nil +} diff --git a/github/parse_test.go b/github/parse_test.go new file mode 100644 index 0000000..18297cd --- /dev/null +++ b/github/parse_test.go @@ -0,0 +1,62 @@ +package github + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +type tm struct { + module string + tm time.Time + sha string + expect string +} + +func TestParse(t *testing.T) { + tn, err := time.Parse("20060102150405", "20231008162055") + require.NoError(t, err) + + tests := []tm{ + { + module: "github.com/roadrunner-server/logger/va", + tm: tn, + sha: "1234567890", + expect: "v0.0.0-20231008162055-1234567890", + }, + { + module: "github.com/roadrunner-server/logger/v2", + tm: tn, + sha: "1234567890", + expect: "v2.0.0-20231008162055-1234567890", + }, + { + module: "github.com/roadrunner-server/logger/v2222222222222", + tm: tn, + sha: "1234567890", + expect: "v2222222222222.0.0-20231008162055-1234567890", + }, + { + module: "github.com/roadrunner-server/logger", + tm: tn, + sha: "1234567890", + expect: "v0.0.0-20231008162055-1234567890", + }, + { + module: "github.com/roadrunner-server/logger/v2", + tm: tn, + sha: "", + expect: "v2.0.0-20231008162055-", + }, + { + expect: "v0.0.0-00010101000000-", + }, + } + + for _, tt := range tests { + out := parseModuleInfo(tt.module, tt.tm, tt.sha) + assert.Equal(t, tt.expect, out) + } +} diff --git a/github/pool.go b/github/pool.go new file mode 100644 index 0000000..0622731 --- /dev/null +++ b/github/pool.go @@ -0,0 +1,220 @@ +package github + +import ( + "bufio" + "context" + "errors" + "fmt" + "net/http" + "path" + "strings" + "sync" + "time" + + "github.com/google/go-github/v53/github" + "github.com/roadrunner-server/velox" + "go.uber.org/zap" +) + +const ( + gomod string = "go.mod" + modLine string = "module" +) + +type processor struct { + maxWorkers int + errs []error + wg sync.WaitGroup + mu sync.Mutex + log *zap.Logger + queueCh chan *pcfg + modinfo []*velox.ModulesInfo + client *github.Client +} + +type pcfg struct { + pluginCfg *velox.PluginConfig + name string +} + +func newPool(log *zap.Logger, client *github.Client) *processor { + p := &processor{ + maxWorkers: 10, + log: log, + client: client, + modinfo: make([]*velox.ModulesInfo, 0, 10), + queueCh: make(chan *pcfg, 1), + wg: sync.WaitGroup{}, + mu: sync.Mutex{}, + errs: make([]error, 0, 1), + } + + // start the processor + p.run() + + return p +} + +func (p *processor) run() { + for i := 0; i < p.maxWorkers; i++ { + go func() { + for v := range p.queueCh { + modInfo := new(velox.ModulesInfo) + p.log.Debug("[FETCHING PLUGIN DATA]", + zap.String("repository", v.pluginCfg.Repo), + zap.String("owner", v.pluginCfg.Owner), + zap.String("folder", v.pluginCfg.Folder), + zap.String("plugin", v.name), + zap.String("ref", v.pluginCfg.Ref), + ) + + if v.pluginCfg.Ref == "" { + p.mu.Lock() + p.errs = append(p.errs, fmt.Errorf("ref can't be empty")) + p.mu.Unlock() + p.wg.Done() + continue + } + + rc, resp, err := p.client.Repositories.DownloadContents(context.Background(), + v.pluginCfg.Owner, + v.pluginCfg.Repo, + path.Join(v.pluginCfg.Folder, gomod), &github.RepositoryContentGetOptions{Ref: v.pluginCfg.Ref}, + ) + if err != nil { + p.mu.Lock() + p.errs = append(p.errs, err) + p.mu.Unlock() + p.wg.Done() + continue + } + + if resp.StatusCode != http.StatusOK { + p.mu.Lock() + p.errs = append(p.errs, fmt.Errorf("bad response status: %d", resp.StatusCode)) + p.mu.Unlock() + p.wg.Done() + continue + } + + scanner := bufio.NewScanner(rc) + for scanner.Scan() { + line := scanner.Text() + switch { //nolint:gocritic + case strings.HasPrefix(line, modLine): + p.log.Debug("[READING MODULE INFO]", zap.String("plugin", v.name), zap.String("module", line)) + + // module github.com/roadrunner-server/logger/v2, we split and get the second part + retMod := strings.Split(line, " ") + if len(retMod) < 2 || len(retMod) > 2 { + p.mu.Lock() + p.errs = append(p.errs, fmt.Errorf("failed to parse module info for the plugin: %s", line)) + p.mu.Unlock() + p.wg.Done() + continue + } + + modInfo.ModuleName = strings.TrimRight(retMod[1], "\n") + goto out + } + } + + out: + if errs := scanner.Err(); errs != nil { + p.mu.Lock() + p.errs = append(p.errs, errs) + p.mu.Unlock() + p.wg.Done() + continue + } + + err = resp.Body.Close() + if err != nil { + p.log.Warn("[FAILED TO CLOSE RESPONSE BODY]", zap.Error(err)) + } + + p.log.Debug("[REQUESTING COMMIT SHA-1]", zap.String("plugin", v.name), zap.String("ref", v.pluginCfg.Ref)) + commits, rsp, err := p.client.Repositories.ListCommits(context.Background(), v.pluginCfg.Owner, v.pluginCfg.Repo, &github.CommitsListOptions{ + SHA: v.pluginCfg.Ref, + Until: time.Now(), + ListOptions: github.ListOptions{ + Page: 1, + PerPage: 1, + }, + }) + if err != nil { + p.mu.Lock() + p.errs = append(p.errs, err) + p.mu.Unlock() + p.wg.Done() + continue + } + + if rsp.StatusCode != http.StatusOK { + p.mu.Lock() + p.errs = append(p.errs, fmt.Errorf("bad response status: %d", rsp.StatusCode)) + p.mu.Unlock() + p.wg.Done() + continue + } + + if len(commits) == 0 { + p.mu.Lock() + p.errs = append(p.errs, errors.New("empty commit SHA")) + p.mu.Unlock() + p.wg.Done() + continue + } + + // should be only one commit + at := commits[0].GetCommit().GetCommitter().GetDate() + // [:12] because of go.mod pseudo format specs + if len(commits[0].GetSHA()) < 12 { + p.mu.Lock() + p.errs = append(p.errs, fmt.Errorf("commit SHA is too short: %s", commits[0].GetSHA())) + p.mu.Unlock() + p.wg.Done() + continue + } + + modInfo.Version = commits[0].GetSHA()[:12] + modInfo.PseudoVersion = parseModuleInfo(modInfo.ModuleName, at.Time, commits[0].GetSHA()[:12]) + + if v.pluginCfg.Replace != "" { + p.log.Debug("[REPLACE REQUESTED]", zap.String("plugin", v.name), zap.String("path", v.pluginCfg.Replace)) + } + + p.mu.Lock() + p.modinfo = append(p.modinfo, modInfo) + p.mu.Unlock() + + p.wg.Done() + } + }() + } +} + +func (p *processor) add(pjob *pcfg) { + p.wg.Add(1) + p.queueCh <- pjob +} + +func (p *processor) errors() []error { + p.mu.Lock() + defer p.mu.Unlock() + return p.errs +} + +func (p *processor) moduleinfo() []*velox.ModulesInfo { + p.mu.Lock() + defer p.mu.Unlock() + return p.modinfo +} + +func (p *processor) wait() { + p.wg.Wait() +} + +func (p *processor) stop() { + close(p.queueCh) +} diff --git a/github/repo.go b/github/repo.go index 4153f45..0114491 100644 --- a/github/repo.go +++ b/github/repo.go @@ -2,7 +2,6 @@ package github import ( "archive/zip" - "bufio" "bytes" "context" "errors" @@ -13,9 +12,8 @@ import ( "path" "path/filepath" "strings" - "time" - "github.com/google/go-github/v49/github" + "github.com/google/go-github/v53/github" "github.com/roadrunner-server/velox" "go.uber.org/zap" "golang.org/x/oauth2" @@ -38,7 +36,7 @@ type GHRepo struct { func NewGHRepoInfo(cfg *velox.Config, log *zap.Logger) *GHRepo { var client *http.Client - // if token exists, use it to increase rate limiter + // if a token exists, use it to increase rate limiter if t := cfg.GitHub.Token; t != nil { ctx := context.Background() ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: t.Token}) @@ -198,74 +196,22 @@ func extract(dest string, zf *zip.File) error { // https://github.com/spiral/roadrunner-binary/archive/refs/tags/v2.7.0.zip func (r *GHRepo) GetPluginsModData() ([]*velox.ModulesInfo, error) { - modInfoRet := make([]*velox.ModulesInfo, 0, 5) - + poolExecutor := newPool(r.log, r.client) for k, v := range r.config.GitHub.Plugins { - modInfo := new(velox.ModulesInfo) - r.log.Debug("[FETCHING PLUGIN DATA]", zap.String("repository", v.Repo), zap.String("owner", v.Owner), zap.String("folder", v.Folder), zap.String("plugin", k), zap.String("ref", v.Ref)) - - if v.Ref == "" { - return nil, errors.New("ref can't be empty") - } - - rc, resp, err := r.client.Repositories.DownloadContents(context.Background(), v.Owner, v.Repo, path.Join(v.Folder, "go.mod"), &github.RepositoryContentGetOptions{Ref: v.Ref}) - if err != nil { - return nil, err - } - - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("bad response status: %d", resp.StatusCode) - } - - rdr := bufio.NewReader(rc) - ret, err := rdr.ReadString('\n') - if err != nil { - return nil, err - } - - r.log.Debug("[READING MODULE INFO]", zap.String("plugin", k), zap.String("mod", ret)) - - // module github.com/roadrunner-server/logger/v2, we split and get the second part - retMod := strings.Split(ret, " ") - if len(retMod) < 2 { - return nil, fmt.Errorf("failed to parse module info for the plugin: %s", ret) - } - - err = resp.Body.Close() - if err != nil { - return nil, err - } - - modInfo.ModuleName = strings.TrimRight(retMod[1], "\n") - - r.log.Debug("[REQUESTING COMMIT SHA-1]", zap.String("plugin", k), zap.String("ref", v.Ref)) - commits, rsp, err := r.client.Repositories.ListCommits(context.Background(), v.Owner, v.Repo, &github.CommitsListOptions{ - SHA: v.Ref, - Until: time.Now(), - ListOptions: github.ListOptions{ - Page: 1, - PerPage: 1, - }, + poolExecutor.add(&pcfg{ + pluginCfg: v, + name: k, }) - if err != nil { - return nil, err - } - - if rsp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("bad response status: %d", rsp.StatusCode) - } - - for i := 0; i < len(commits); i++ { - modInfo.Version = *commits[i].SHA - } + } - if v.Replace != "" { - r.log.Debug("[REPLACE REQUESTED]", zap.String("plugin", k), zap.String("path", v.Replace)) - } + poolExecutor.wait() - modInfo.Replace = v.Replace - modInfoRet = append(modInfoRet, modInfo) + if len(poolExecutor.errors()) != 0 { + return nil, errors.Join(poolExecutor.errors()...) } - return modInfoRet, nil + mi := poolExecutor.moduleinfo() + poolExecutor.stop() + + return mi, nil } diff --git a/go.mod b/go.mod index 7e47227..3284a10 100644 --- a/go.mod +++ b/go.mod @@ -2,11 +2,11 @@ module github.com/roadrunner-server/velox go 1.21 -toolchain go1.21.0 +toolchain go1.21.1 require ( github.com/fatih/color v1.15.0 - github.com/google/go-github/v49 v49.1.0 + github.com/google/go-github/v53 v53.2.0 github.com/hashicorp/go-version v1.6.0 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.7.0 @@ -14,10 +14,13 @@ require ( github.com/stretchr/testify v1.8.4 github.com/xanzy/go-gitlab v0.93.0 go.uber.org/zap v1.26.0 + golang.org/x/mod v0.13.0 golang.org/x/oauth2 v0.13.0 ) require ( + github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c // indirect + github.com/cloudflare/circl v1.3.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/golang/protobuf v1.5.3 // indirect diff --git a/go.sum b/go.sum index 35162ba..fede17b 100644 --- a/go.sum +++ b/go.sum @@ -38,11 +38,16 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c h1:kMFnB0vCcX7IL/m9Y5LO+KQYv+t1CQOiFe6+SV2J7bE= +github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -109,8 +114,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v49 v49.1.0 h1:LFkMgawGQ8dfzWLH/rNE0b3u1D3n6/dw7ZmrN3b+YFY= -github.com/google/go-github/v49 v49.1.0/go.mod h1:MUUzHPrhGniB6vUKa27y37likpipzG+BXXJbG04J334= +github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= +github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -237,6 +242,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -275,6 +282,9 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -308,6 +318,9 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -330,6 +343,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -369,11 +383,17 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -383,6 +403,9 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -438,6 +461,7 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/modulesInfo.go b/modulesInfo.go index b7ec879..fe25361 100644 --- a/modulesInfo.go +++ b/modulesInfo.go @@ -4,6 +4,8 @@ package velox type ModulesInfo struct { // Version - commit sha or tag Version string + // PseudoVersion - Go pseudo version + PseudoVersion string // module name - eg: github.com/roadrunner-server/logger/v2 ModuleName string // Replace (for the local dev)