From 954feea2b24e3d642ca4a6304747e93ca657ac25 Mon Sep 17 00:00:00 2001 From: quinna-h Date: Tue, 24 Dec 2024 10:30:46 -0500 Subject: [PATCH 1/5] wip --- .github/workflows/supported-versions.yml | 44 ++++++ parse_go_mod.go | 163 +++++++++++++++++++++++ 2 files changed, 207 insertions(+) create mode 100644 .github/workflows/supported-versions.yml create mode 100644 parse_go_mod.go diff --git a/.github/workflows/supported-versions.yml b/.github/workflows/supported-versions.yml new file mode 100644 index 0000000000..7cf89d175b --- /dev/null +++ b/.github/workflows/supported-versions.yml @@ -0,0 +1,44 @@ +name: Supported Versions +on: + workflow_run: + workflows: ["Smoke Tests"] + branches: [main] + types: + - completed + +concurrency: + # Automatically cancel previous runs if a new one is triggered to conserve resources. + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + on-smoke-tests-success: + runs-on: ubuntu-latest + permissions: + actions: read + contents: write + pull-requests: write + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - uses: actions/checkout@v4 + + - run: echo 'Smoke Tests workflow passed' + + - run: go run parse_go_mod.go + + - run: git diff + + # note: This will only run when there *are* changes to integration versions + - name: Create Pull Request + id: pr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: "update-latest-supported-versions" + commit-message: "Update supported versions" + base: main + title: "chore: update latest supported" + labels: changelog/no-changelog + body: "Test" diff --git a/parse_go_mod.go b/parse_go_mod.go new file mode 100644 index 0000000000..d218ad8bc1 --- /dev/null +++ b/parse_go_mod.go @@ -0,0 +1,163 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2024 Datadog, Inc. + +package main + +import ( + "bufio" + "bytes" + "context" + "fmt" + "os" + "os/exec" + "regexp" + "strings" + "sync" + "time" +) + +type ModuleVersion struct { + Name string + MinVersion string + MaxVersion string +} + +func parseGoMod(filePath string) ([]ModuleVersion, error) { + // This parses the go.mod file and extracts modules with their minimum versions. + var modules []ModuleVersion + + file, err := os.Open(filePath) + if err != nil { + return nil, fmt.Errorf("error: %s not found", filePath) + } + defer file.Close() + + regex := regexp.MustCompile(`^\s*([^\s]+)\s+v([0-9]+\.[0-9]+\.[0-9]+.*)`) + + scanner := bufio.NewScanner(file) + inRequireBlock := false + + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) + + if strings.HasPrefix(line, "require (") { + inRequireBlock = true + continue + } + + if inRequireBlock && line == ")" { + inRequireBlock = false + continue + } + + if inRequireBlock || strings.HasPrefix(line, "require ") { + match := regex.FindStringSubmatch(line) + if match != nil { + modules = append(modules, ModuleVersion{ + Name: match[1], + MinVersion: match[2], + }) + } + } + } + + if err := scanner.Err(); err != nil { + return nil, fmt.Errorf("error reading file: %v", err) + } + + return modules, nil +} + +func fetchLatestVersion(module string) (string, error) { + // Fetches latest version with `go list` + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + + cmd := exec.CommandContext(ctx, "go", "list", "-m", "-versions", module) + var stdout, stderr bytes.Buffer + cmd.Stdout = &stdout + cmd.Stderr = &stderr + + err := cmd.Run() + if ctx.Err() == context.DeadlineExceeded { + return "", fmt.Errorf("command timed out") + } + if err != nil { + return "", fmt.Errorf("command error: %s", stderr.String()) + } + + versions := strings.Fields(stdout.String()) + if len(versions) < 1 { + return "", fmt.Errorf("no versions found for module: %s", module) + } + + return versions[len(versions)-1], nil +} + +func fetchAllLatestVersions(modules []ModuleVersion) []ModuleVersion { + // Concurrently fetches the latest version of each module. + + var wg sync.WaitGroup + var mu sync.Mutex + + updatedModules := make([]ModuleVersion, 0, len(modules)) + + wg.Add(len(modules)) + for _, mod := range modules { + go func(mod ModuleVersion) { + defer wg.Done() + latestVersion, err := fetchLatestVersion(mod.Name) + if err != nil { + fmt.Printf("Error fetching latest version for %s: %v\n", mod.Name, err) + mu.Lock() + updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, "Error"}) + mu.Unlock() + return + } + mu.Lock() + updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, latestVersion}) + mu.Unlock() + }(mod) + } + + wg.Wait() + return updatedModules +} + +func outputVersionsAsMarkdown(modules []ModuleVersion, filePath string) error { + file, err := os.Create(filePath) + if err != nil { + return fmt.Errorf("error creating file: %v", err) + } + defer file.Close() + + fmt.Fprintln(file, "| Dependency | Minimum Version | Maximum Version |") + fmt.Fprintln(file, "|------------|-----------------|-----------------|") + for _, mod := range modules { + fmt.Fprintf(file, "| %s | v%s | %s |\n", mod.Name, mod.MinVersion, mod.MaxVersion) + } + return nil +} + +func main() { + goModPath := "integration_go.mod" // Modify path as needed + outputPath := "minimum_versions.md" + + modules, err := parseGoMod(goModPath) + if err != nil { + fmt.Println(err) + return + } + + modulesWithLatest := fetchAllLatestVersions(modules) + + err = outputVersionsAsMarkdown(modulesWithLatest, outputPath) + if err != nil { + fmt.Printf("Error writing output file: %v\n", err) + return + } + + fmt.Println("Version information written to", outputPath) +} From 661323543a3673bd7199a4ca42b706075c8d6939 Mon Sep 17 00:00:00 2001 From: quinna-h Date: Tue, 24 Dec 2024 10:31:42 -0500 Subject: [PATCH 2/5] add table --- supported_versions.md | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 supported_versions.md diff --git a/supported_versions.md b/supported_versions.md new file mode 100644 index 0000000000..c10763795c --- /dev/null +++ b/supported_versions.md @@ -0,0 +1,87 @@ +| Dependency | Minimum Version | Maximum Version | +|------------|-----------------|-----------------| +| github.com/go-chi/chi/v5 | v5.0.10 | v5.2.0 | +| github.com/tidwall/buntdb | v1.3.0 | v1.3.2 | +| github.com/go-redis/redis/v7 | v7.4.1 | v7.4.1 | +| github.com/99designs/gqlgen | v0.17.36 | v0.17.61 | +| github.com/emicklei/go-restful | v2.16.0+incompatible | v2.16.0+incompatible | +| github.com/IBM/sarama | v1.40.0 | v1.43.3 | +| github.com/aws/aws-sdk-go | v1.44.327 | v1.55.5 | +| github.com/globalsign/mgo | v0.0.0-20181015135952-eeefdecb41b8 | github.com/globalsign/mgo | +| github.com/denisenkom/go-mssqldb | v0.11.0 | v0.12.3 | +| github.com/gin-gonic/gin | v1.9.1 | v1.10.0 | +| github.com/graphql-go/handler | v0.2.3 | v0.2.4 | +| github.com/gocql/gocql | v1.6.0 | v1.7.0 | +| github.com/Shopify/sarama | v1.38.1 | v1.43.3 | +| github.com/google/pprof | v0.0.0-20230817174616-7a8ec2ada47b | github.com/google/pprof | +| github.com/go-redis/redis/v8 | v8.11.5 | v8.11.5 | +| github.com/jinzhu/gorm | v1.9.16 | v1.9.16 | +| github.com/google/uuid | v1.5.0 | v1.6.0 | +| github.com/syndtr/goleveldb | v1.0.1-0.20220721030215-126854af5e6d | v1.0.0 | +| github.com/aws/aws-sdk-go-v2/service/dynamodb | v1.21.4 | v1.38.1 | +| github.com/go-pg/pg/v10 | v10.11.1 | v10.14.0 | +| github.com/hashicorp/vault/sdk | v0.9.2 | v0.14.0 | +| github.com/lib/pq | v1.10.2 | v1.10.9 | +| github.com/sirupsen/logrus | v1.9.3 | v1.9.3 | +| github.com/hashicorp/vault/api | v1.9.2 | v1.15.0 | +| github.com/go-sql-driver/mysql | v1.6.0 | v1.8.1 | +| github.com/emicklei/go-restful/v3 | v3.11.0 | v3.12.1 | +| github.com/aws/aws-sdk-go-v2/service/ec2 | v1.93.2 | v1.198.1 | +| gorm.io/driver/postgres | v1.4.6 | v1.5.11 | +| github.com/aws/aws-sdk-go-v2/config | v1.18.21 | v1.28.7 | +| github.com/urfave/negroni | v1.0.0 | v1.0.0 | +| google.golang.org/protobuf | v1.33.0 | v1.36.1 | +| github.com/redis/go-redis/v9 | v9.7.0 | v9.7.0 | +| github.com/elastic/go-elasticsearch/v8 | v8.15.0 | v8.17.0 | +| github.com/garyburd/redigo | v1.6.4 | v1.6.4 | +| github.com/gomodule/redigo | v1.8.9 | v1.9.2 | +| go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | v0.44.0 | v0.58.0 | +| google.golang.org/api | v0.128.0 | v0.214.0 | +| gopkg.in/jinzhu/gorm.v1 | v1.9.2 | v1.9.2 | +| github.com/aws/aws-sdk-go-v2/service/eventbridge | v1.20.4 | v1.36.1 | +| github.com/twitchtv/twirp | v8.1.3+incompatible | v8.1.3+incompatible | +| github.com/aws/aws-sdk-go-v2/service/s3 | v1.32.0 | v1.71.1 | +| github.com/mattn/go-sqlite3 | v1.14.18 | v1.14.24 | +| k8s.io/client-go | v0.23.17 | v0.33.0-alpha.0 | +| github.com/gofiber/fiber/v2 | v2.52.5 | v2.52.5 | +| github.com/aws/aws-sdk-go-v2/service/kinesis | v1.18.4 | v1.32.8 | +| gorm.io/driver/mysql | v1.0.1 | v1.5.7 | +| github.com/aws/aws-sdk-go-v2 | v1.20.3 | v2.0.0-preview.4+incompatible | +| gopkg.in/olivere/elastic.v5 | v5.0.84 | v5.0.86 | +| gopkg.in/olivere/elastic.v3 | v3.0.75 | v3.0.75 | +| github.com/confluentinc/confluent-kafka-go/v2 | v2.2.0 | v2.6.1 | +| github.com/aws/aws-sdk-go-v2/service/sfn | v1.19.4 | v1.34.2 | +| github.com/aws/aws-sdk-go-v2/service/sqs | v1.24.4 | v1.37.3 | +| github.com/hashicorp/go-secure-stdlib/parseutil | v0.1.7 | v0.1.8 | +| google.golang.org/grpc | v1.57.1 | v1.70.0-dev | +| github.com/go-redis/redis | v6.15.9+incompatible | v6.15.9+incompatible | +| gorm.io/driver/sqlserver | v1.4.2 | v1.5.4 | +| cloud.google.com/go/pubsub | v1.33.0 | v1.45.3 | +| github.com/uptrace/bun | v1.1.17 | v1.2.6 | +| github.com/gorilla/mux | v1.8.0 | v1.8.1 | +| github.com/go-chi/chi | v1.5.4 | v4.1.2+incompatible | +| gorm.io/gorm | v1.25.3 | v1.25.12 | +| github.com/elastic/go-elasticsearch/v6 | v6.8.5 | v6.8.10 | +| github.com/go-redis/redis/v9 | v9.7.0 // renamed to redis/go-redis in v9 | v9.7.0 | +| github.com/zenazn/goji | v1.0.1 | v1.0.1 | +| github.com/miekg/dns | v1.1.55 | v1.1.62 | +| github.com/vektah/gqlparser/v2 | v2.5.16 | v2.5.20 | +| github.com/hashicorp/go-multierror | v1.1.1 | v1.1.1 | +| github.com/confluentinc/confluent-kafka-go | v1.9.2 | v1.9.3-RC3 | +| github.com/segmentio/kafka-go | v0.4.42 | v0.4.47 | +| github.com/labstack/echo | v3.3.10+incompatible | v3.3.10+incompatible | +| github.com/aws/aws-sdk-go-v2/service/sns | v1.21.4 | v1.33.8 | +| github.com/graph-gophers/graphql-go | v1.5.0 | v1.5.0 | +| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.2 | +| github.com/graphql-go/graphql | v0.8.1 | v0.8.1 | +| github.com/uptrace/bun/dialect/sqlitedialect | v1.1.17 | v1.2.6 | +| github.com/bradfitz/gomemcache | v0.0.0-20230611145640-acc696258285 | github.com/bradfitz/gomemcache | +| github.com/labstack/echo/v4 | v4.11.1 | v4.13.3 | +| github.com/elastic/go-elasticsearch/v7 | v7.17.10 | v7.17.10 | +| github.com/julienschmidt/httprouter | v1.3.0 | v1.3.0 | +| github.com/microsoft/go-mssqldb | v0.21.0 | v1.8.0 | +| github.com/jmoiron/sqlx | v1.3.5 | v1.4.0 | +| go.mongodb.org/mongo-driver | v1.12.1 | v1.17.1 | +| github.com/hashicorp/consul/api | v1.24.0 | v1.31.0 | +| github.com/dimfeld/httptreemux/v5 | v5.5.0 | v5.5.0 | +| github.com/valyala/fasthttp | v1.51.0 | v1.58.0 | From 5583f818469790dd5913e616516e68f2049ebad4 Mon Sep 17 00:00:00 2001 From: quinna-h Date: Thu, 26 Dec 2024 13:40:21 -0500 Subject: [PATCH 3/5] remove non-contrib packages and add aut-instrumented --- integration_go.mod | 2 - parse_go_mod.go | 65 +++++++++++++--- supported_versions.md | 172 +++++++++++++++++++++--------------------- 3 files changed, 141 insertions(+), 98 deletions(-) diff --git a/integration_go.mod b/integration_go.mod index 0bf48eaca0..8f446e9960 100644 --- a/integration_go.mod +++ b/integration_go.mod @@ -42,7 +42,6 @@ require ( github.com/gocql/gocql v1.6.0 github.com/gofiber/fiber/v2 v2.52.5 github.com/gomodule/redigo v1.8.9 - github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b github.com/google/uuid v1.5.0 github.com/gorilla/mux v1.8.0 github.com/graph-gophers/graphql-go v1.5.0 @@ -50,7 +49,6 @@ require ( github.com/graphql-go/handler v0.2.3 github.com/hashicorp/consul/api v1.24.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 github.com/hashicorp/vault/api v1.9.2 github.com/hashicorp/vault/sdk v0.9.2 github.com/jackc/pgx/v5 v5.6.0 diff --git a/parse_go_mod.go b/parse_go_mod.go index d218ad8bc1..97415673b1 100644 --- a/parse_go_mod.go +++ b/parse_go_mod.go @@ -22,6 +22,8 @@ type ModuleVersion struct { Name string MinVersion string MaxVersion string + isInstrumented bool + } func parseGoMod(filePath string) ([]ModuleVersion, error) { @@ -89,6 +91,7 @@ func fetchLatestVersion(module string) (string, error) { } versions := strings.Fields(stdout.String()) + fmt.Println("Versions:", versions) if len(versions) < 1 { return "", fmt.Errorf("no versions found for module: %s", module) } @@ -96,9 +99,9 @@ func fetchLatestVersion(module string) (string, error) { return versions[len(versions)-1], nil } -func fetchAllLatestVersions(modules []ModuleVersion) []ModuleVersion { +func fetchAllLatestVersions(modules []ModuleVersion, instrumentedSet map[string]struct{}) []ModuleVersion { // Concurrently fetches the latest version of each module. - + var wg sync.WaitGroup var mu sync.Mutex @@ -108,16 +111,20 @@ func fetchAllLatestVersions(modules []ModuleVersion) []ModuleVersion { for _, mod := range modules { go func(mod ModuleVersion) { defer wg.Done() + fmt.Printf("Fetching latest version for module: %s\n", mod.Name) latestVersion, err := fetchLatestVersion(mod.Name) if err != nil { fmt.Printf("Error fetching latest version for %s: %v\n", mod.Name, err) mu.Lock() - updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, "Error"}) + updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, "Error", false}) mu.Unlock() return } + _, isInstrumented := instrumentedSet[mod.Name] + mu.Lock() - updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, latestVersion}) + updatedModules = append(updatedModules, ModuleVersion{mod.Name, + mod.MinVersion, latestVersion, isInstrumented}) mu.Unlock() }(mod) } @@ -133,17 +140,57 @@ func outputVersionsAsMarkdown(modules []ModuleVersion, filePath string) error { } defer file.Close() - fmt.Fprintln(file, "| Dependency | Minimum Version | Maximum Version |") - fmt.Fprintln(file, "|------------|-----------------|-----------------|") + fmt.Fprintln(file, "| Dependency | Minimum Version | Maximum Version | Auto-Instrumented |") + fmt.Fprintln(file, "|------------|-----------------|-----------------|-----------------|") for _, mod := range modules { - fmt.Fprintf(file, "| %s | v%s | %s |\n", mod.Name, mod.MinVersion, mod.MaxVersion) + fmt.Fprintf(file, "| %s | v%s | %s | %+v\n", mod.Name, mod.MinVersion, mod.MaxVersion, mod.isInstrumented) } return nil } func main() { goModPath := "integration_go.mod" // Modify path as needed - outputPath := "minimum_versions.md" + outputPath := "supported_versions.md" + instrumentedSet := map[string]struct{}{ + "database/sql": {}, + "github.com/gin-gonic/gin": {}, + "github.com/go-chi/chi/v5": {}, + "github.com/go-chi/chi": {}, + "github.com/go-redis/redis/v7": {}, + "github.com/go-redis/redis/v8": {}, + "github.com/gofiber/fiber/v2": {}, + "github.com/gomodule/redigo/redis": {}, + "github.com/gorilla/mux": {}, + "github.com/jinzhu/gorm": {}, + "github.com/labstack/echo/v4": {}, + "google.golang.org/grpc": {}, + "gorm.io/gorm": {}, + "net/http": {}, + "go.mongodb.org/mongo-driver/mongo": {}, + "github.com/aws-sdk-go/aws": {}, + "github.com/hashicorp/vault": {}, + "github.com/IBM/sarama": {}, + "github.com/Shopify/sarama": {}, + "k8s.io/client-go": {}, + "log/slog": {}, + "os": {}, + "github.com/aws/aws-sdk-go-v2": {}, + "github.com/redis/go-redis/v9": {}, + "github.com/gocql/gocql": {}, + "cloud.google.com/go/pubsub": {}, + "github.com/99designs/gqlgen": {}, + "github.com/redis/go-redis": {}, + "github.com/graph-gophers/graphql-go": {}, + "github.com/graphql-go/graphql": {}, + "github.com/jackc/pgx": {}, + "github.com/elastic/go-elasticsearch": {}, + "github.com/twitchtv/twirp": {}, + "github.com/segmentio/kafka-go": {}, + "github.com/confluentinc/confluent-kafka-go/kafka": {}, + "github.com/confluentinc/confluent-kafka-go/kafka/v2": {}, + "github.com/julienschmidt/httprouter": {}, + "github.com/sirupsen/logrus": {}, + } modules, err := parseGoMod(goModPath) if err != nil { @@ -151,7 +198,7 @@ func main() { return } - modulesWithLatest := fetchAllLatestVersions(modules) + modulesWithLatest := fetchAllLatestVersions(modules, instrumentedSet) err = outputVersionsAsMarkdown(modulesWithLatest, outputPath) if err != nil { diff --git a/supported_versions.md b/supported_versions.md index c10763795c..c56bd0ff1e 100644 --- a/supported_versions.md +++ b/supported_versions.md @@ -1,87 +1,85 @@ -| Dependency | Minimum Version | Maximum Version | -|------------|-----------------|-----------------| -| github.com/go-chi/chi/v5 | v5.0.10 | v5.2.0 | -| github.com/tidwall/buntdb | v1.3.0 | v1.3.2 | -| github.com/go-redis/redis/v7 | v7.4.1 | v7.4.1 | -| github.com/99designs/gqlgen | v0.17.36 | v0.17.61 | -| github.com/emicklei/go-restful | v2.16.0+incompatible | v2.16.0+incompatible | -| github.com/IBM/sarama | v1.40.0 | v1.43.3 | -| github.com/aws/aws-sdk-go | v1.44.327 | v1.55.5 | -| github.com/globalsign/mgo | v0.0.0-20181015135952-eeefdecb41b8 | github.com/globalsign/mgo | -| github.com/denisenkom/go-mssqldb | v0.11.0 | v0.12.3 | -| github.com/gin-gonic/gin | v1.9.1 | v1.10.0 | -| github.com/graphql-go/handler | v0.2.3 | v0.2.4 | -| github.com/gocql/gocql | v1.6.0 | v1.7.0 | -| github.com/Shopify/sarama | v1.38.1 | v1.43.3 | -| github.com/google/pprof | v0.0.0-20230817174616-7a8ec2ada47b | github.com/google/pprof | -| github.com/go-redis/redis/v8 | v8.11.5 | v8.11.5 | -| github.com/jinzhu/gorm | v1.9.16 | v1.9.16 | -| github.com/google/uuid | v1.5.0 | v1.6.0 | -| github.com/syndtr/goleveldb | v1.0.1-0.20220721030215-126854af5e6d | v1.0.0 | -| github.com/aws/aws-sdk-go-v2/service/dynamodb | v1.21.4 | v1.38.1 | -| github.com/go-pg/pg/v10 | v10.11.1 | v10.14.0 | -| github.com/hashicorp/vault/sdk | v0.9.2 | v0.14.0 | -| github.com/lib/pq | v1.10.2 | v1.10.9 | -| github.com/sirupsen/logrus | v1.9.3 | v1.9.3 | -| github.com/hashicorp/vault/api | v1.9.2 | v1.15.0 | -| github.com/go-sql-driver/mysql | v1.6.0 | v1.8.1 | -| github.com/emicklei/go-restful/v3 | v3.11.0 | v3.12.1 | -| github.com/aws/aws-sdk-go-v2/service/ec2 | v1.93.2 | v1.198.1 | -| gorm.io/driver/postgres | v1.4.6 | v1.5.11 | -| github.com/aws/aws-sdk-go-v2/config | v1.18.21 | v1.28.7 | -| github.com/urfave/negroni | v1.0.0 | v1.0.0 | -| google.golang.org/protobuf | v1.33.0 | v1.36.1 | -| github.com/redis/go-redis/v9 | v9.7.0 | v9.7.0 | -| github.com/elastic/go-elasticsearch/v8 | v8.15.0 | v8.17.0 | -| github.com/garyburd/redigo | v1.6.4 | v1.6.4 | -| github.com/gomodule/redigo | v1.8.9 | v1.9.2 | -| go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | v0.44.0 | v0.58.0 | -| google.golang.org/api | v0.128.0 | v0.214.0 | -| gopkg.in/jinzhu/gorm.v1 | v1.9.2 | v1.9.2 | -| github.com/aws/aws-sdk-go-v2/service/eventbridge | v1.20.4 | v1.36.1 | -| github.com/twitchtv/twirp | v8.1.3+incompatible | v8.1.3+incompatible | -| github.com/aws/aws-sdk-go-v2/service/s3 | v1.32.0 | v1.71.1 | -| github.com/mattn/go-sqlite3 | v1.14.18 | v1.14.24 | -| k8s.io/client-go | v0.23.17 | v0.33.0-alpha.0 | -| github.com/gofiber/fiber/v2 | v2.52.5 | v2.52.5 | -| github.com/aws/aws-sdk-go-v2/service/kinesis | v1.18.4 | v1.32.8 | -| gorm.io/driver/mysql | v1.0.1 | v1.5.7 | -| github.com/aws/aws-sdk-go-v2 | v1.20.3 | v2.0.0-preview.4+incompatible | -| gopkg.in/olivere/elastic.v5 | v5.0.84 | v5.0.86 | -| gopkg.in/olivere/elastic.v3 | v3.0.75 | v3.0.75 | -| github.com/confluentinc/confluent-kafka-go/v2 | v2.2.0 | v2.6.1 | -| github.com/aws/aws-sdk-go-v2/service/sfn | v1.19.4 | v1.34.2 | -| github.com/aws/aws-sdk-go-v2/service/sqs | v1.24.4 | v1.37.3 | -| github.com/hashicorp/go-secure-stdlib/parseutil | v0.1.7 | v0.1.8 | -| google.golang.org/grpc | v1.57.1 | v1.70.0-dev | -| github.com/go-redis/redis | v6.15.9+incompatible | v6.15.9+incompatible | -| gorm.io/driver/sqlserver | v1.4.2 | v1.5.4 | -| cloud.google.com/go/pubsub | v1.33.0 | v1.45.3 | -| github.com/uptrace/bun | v1.1.17 | v1.2.6 | -| github.com/gorilla/mux | v1.8.0 | v1.8.1 | -| github.com/go-chi/chi | v1.5.4 | v4.1.2+incompatible | -| gorm.io/gorm | v1.25.3 | v1.25.12 | -| github.com/elastic/go-elasticsearch/v6 | v6.8.5 | v6.8.10 | -| github.com/go-redis/redis/v9 | v9.7.0 // renamed to redis/go-redis in v9 | v9.7.0 | -| github.com/zenazn/goji | v1.0.1 | v1.0.1 | -| github.com/miekg/dns | v1.1.55 | v1.1.62 | -| github.com/vektah/gqlparser/v2 | v2.5.16 | v2.5.20 | -| github.com/hashicorp/go-multierror | v1.1.1 | v1.1.1 | -| github.com/confluentinc/confluent-kafka-go | v1.9.2 | v1.9.3-RC3 | -| github.com/segmentio/kafka-go | v0.4.42 | v0.4.47 | -| github.com/labstack/echo | v3.3.10+incompatible | v3.3.10+incompatible | -| github.com/aws/aws-sdk-go-v2/service/sns | v1.21.4 | v1.33.8 | -| github.com/graph-gophers/graphql-go | v1.5.0 | v1.5.0 | -| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.2 | -| github.com/graphql-go/graphql | v0.8.1 | v0.8.1 | -| github.com/uptrace/bun/dialect/sqlitedialect | v1.1.17 | v1.2.6 | -| github.com/bradfitz/gomemcache | v0.0.0-20230611145640-acc696258285 | github.com/bradfitz/gomemcache | -| github.com/labstack/echo/v4 | v4.11.1 | v4.13.3 | -| github.com/elastic/go-elasticsearch/v7 | v7.17.10 | v7.17.10 | -| github.com/julienschmidt/httprouter | v1.3.0 | v1.3.0 | -| github.com/microsoft/go-mssqldb | v0.21.0 | v1.8.0 | -| github.com/jmoiron/sqlx | v1.3.5 | v1.4.0 | -| go.mongodb.org/mongo-driver | v1.12.1 | v1.17.1 | -| github.com/hashicorp/consul/api | v1.24.0 | v1.31.0 | -| github.com/dimfeld/httptreemux/v5 | v5.5.0 | v5.5.0 | -| github.com/valyala/fasthttp | v1.51.0 | v1.58.0 | +| Dependency | Minimum Version | Maximum Version | Auto-Instrumented | +|------------|-----------------|-----------------|-----------------| +| github.com/go-chi/chi/v5 | v5.0.10 | v5.2.0 | true +| go.mongodb.org/mongo-driver | v1.12.1 | v1.17.1 | false +| github.com/sirupsen/logrus | v1.9.3 | v1.9.3 | true +| github.com/aws/aws-sdk-go-v2/service/dynamodb | v1.21.4 | v1.38.1 | false +| github.com/tidwall/buntdb | v1.3.0 | v1.3.2 | false +| github.com/aws/aws-sdk-go-v2/config | v1.18.21 | v1.28.7 | false +| github.com/go-pg/pg/v10 | v10.11.1 | v10.14.0 | false +| github.com/graphql-go/handler | v0.2.3 | v0.2.4 | false +| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.2 | false +| github.com/denisenkom/go-mssqldb | v0.11.0 | v0.12.3 | false +| github.com/emicklei/go-restful/v3 | v3.11.0 | v3.12.1 | false +| github.com/go-sql-driver/mysql | v1.6.0 | v1.8.1 | false +| github.com/gomodule/redigo | v1.8.9 | v1.9.2 | false +| github.com/jinzhu/gorm | v1.9.16 | v1.9.16 | true +| github.com/miekg/dns | v1.1.55 | v1.1.62 | false +| github.com/gin-gonic/gin | v1.9.1 | v1.10.0 | true +| github.com/aws/aws-sdk-go-v2/service/s3 | v1.32.0 | v1.71.1 | false +| github.com/confluentinc/confluent-kafka-go | v1.9.2 | v1.9.3-RC3 | false +| github.com/go-redis/redis | v6.15.9+incompatible | v6.15.9+incompatible | false +| cloud.google.com/go/pubsub | v1.33.0 | v1.45.3 | true +| github.com/jmoiron/sqlx | v1.3.5 | v1.4.0 | false +| github.com/julienschmidt/httprouter | v1.3.0 | v1.3.0 | true +| gorm.io/driver/sqlserver | v1.4.2 | v1.5.4 | false +| github.com/aws/aws-sdk-go-v2/service/kinesis | v1.18.4 | v1.32.8 | false +| github.com/graphql-go/graphql | v0.8.1 | v0.8.1 | true +| github.com/aws/aws-sdk-go-v2 | v1.20.3 | v2.0.0-preview.4+incompatible | true +| github.com/go-redis/redis/v8 | v8.11.5 | v8.11.5 | true +| github.com/aws/aws-sdk-go | v1.44.327 | v1.55.5 | false +| github.com/go-redis/redis/v7 | v7.4.1 | v7.4.1 | true +| github.com/hashicorp/vault/sdk | v0.9.2 | v0.14.0 | false +| github.com/IBM/sarama | v1.40.0 | v1.43.3 | true +| github.com/valyala/fasthttp | v1.51.0 | v1.58.0 | false +| github.com/segmentio/kafka-go | v0.4.42 | v0.4.47 | true +| github.com/elastic/go-elasticsearch/v6 | v6.8.5 | v6.8.10 | false +| github.com/microsoft/go-mssqldb | v0.21.0 | v1.8.0 | false +| github.com/confluentinc/confluent-kafka-go/v2 | v2.2.0 | v2.6.1 | false +| github.com/bradfitz/gomemcache | v0.0.0-20230611145640-acc696258285 | github.com/bradfitz/gomemcache | false +| github.com/zenazn/goji | v1.0.1 | v1.0.1 | false +| gopkg.in/olivere/elastic.v5 | v5.0.84 | v5.0.86 | false +| github.com/garyburd/redigo | v1.6.4 | v1.6.4 | false +| github.com/aws/aws-sdk-go-v2/service/sfn | v1.19.4 | v1.34.2 | false +| github.com/redis/go-redis/v9 | v9.7.0 | v9.7.0 | true +| gorm.io/driver/postgres | v1.4.6 | v1.5.11 | false +| github.com/vektah/gqlparser/v2 | v2.5.16 | v2.5.21 | false +| github.com/99designs/gqlgen | v0.17.36 | v0.17.61 | true +| gorm.io/gorm | v1.25.3 | v1.25.12 | true +| github.com/twitchtv/twirp | v8.1.3+incompatible | v8.1.3+incompatible | true +| google.golang.org/protobuf | v1.33.0 | v1.36.1 | false +| github.com/go-chi/chi | v1.5.4 | v4.1.2+incompatible | true +| github.com/hashicorp/go-multierror | v1.1.1 | v1.1.1 | false +| k8s.io/client-go | v0.23.17 | v0.33.0-alpha.0 | true +| github.com/syndtr/goleveldb | v1.0.1-0.20220721030215-126854af5e6d | v1.0.0 | false +| github.com/hashicorp/consul/api | v1.24.0 | v1.31.0 | false +| github.com/go-redis/redis/v9 | v9.7.0 // renamed to redis/go-redis in v9 | v9.7.0 | false +| github.com/globalsign/mgo | v0.0.0-20181015135952-eeefdecb41b8 | github.com/globalsign/mgo | false +| github.com/aws/aws-sdk-go-v2/service/sns | v1.21.4 | v1.33.8 | false +| gopkg.in/jinzhu/gorm.v1 | v1.9.2 | v1.9.2 | false +| github.com/aws/aws-sdk-go-v2/service/ec2 | v1.93.2 | v1.198.1 | false +| github.com/elastic/go-elasticsearch/v8 | v8.15.0 | v8.17.0 | false +| github.com/elastic/go-elasticsearch/v7 | v7.17.10 | v7.17.10 | false +| github.com/mattn/go-sqlite3 | v1.14.18 | v1.14.24 | false +| github.com/urfave/negroni | v1.0.0 | v1.0.0 | false +| github.com/graph-gophers/graphql-go | v1.5.0 | v1.5.0 | true +| github.com/lib/pq | v1.10.2 | v1.10.9 | false +| github.com/uptrace/bun/dialect/sqlitedialect | v1.1.17 | v1.2.6 | false +| github.com/labstack/echo | v3.3.10+incompatible | v3.3.10+incompatible | false +| github.com/dimfeld/httptreemux/v5 | v5.5.0 | v5.5.0 | false +| gorm.io/driver/mysql | v1.0.1 | v1.5.7 | false +| github.com/aws/aws-sdk-go-v2/service/eventbridge | v1.20.4 | v1.36.1 | false +| gopkg.in/olivere/elastic.v3 | v3.0.75 | v3.0.75 | false +| github.com/Shopify/sarama | v1.38.1 | v1.43.3 | true +| google.golang.org/api | v0.128.0 | v0.214.0 | false +| github.com/uptrace/bun | v1.1.17 | v1.2.6 | false +| go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | v0.44.0 | v0.58.0 | false +| google.golang.org/grpc | v1.57.1 | v1.70.0-dev | true +| github.com/gofiber/fiber/v2 | v2.52.5 | v2.52.5 | true +| github.com/emicklei/go-restful | v2.16.0+incompatible | v2.16.0+incompatible | false +| github.com/google/uuid | v1.5.0 | v1.6.0 | false +| github.com/gocql/gocql | v1.6.0 | v1.7.0 | true +| github.com/aws/aws-sdk-go-v2/service/sqs | v1.24.4 | v1.37.3 | false +| github.com/labstack/echo/v4 | v4.11.1 | v4.13.3 | true +| github.com/gorilla/mux | v1.8.0 | v1.8.1 | true +| github.com/hashicorp/vault/api | v1.9.2 | v1.15.0 | false From 827f52f392b9f49799c2d6d05af4d6281aa53416 Mon Sep 17 00:00:00 2001 From: quinna-h Date: Thu, 26 Dec 2024 18:11:00 -0500 Subject: [PATCH 4/5] wip --- .../apps/output_integration_versions.go | 30 +++- .github/workflows/supported-versions.yml | 2 +- supported_versions.md | 138 +++++++++--------- 3 files changed, 92 insertions(+), 78 deletions(-) rename parse_go_mod.go => .github/workflows/apps/output_integration_versions.go (86%) diff --git a/parse_go_mod.go b/.github/workflows/apps/output_integration_versions.go similarity index 86% rename from parse_go_mod.go rename to .github/workflows/apps/output_integration_versions.go index 97415673b1..409cd7849a 100644 --- a/parse_go_mod.go +++ b/.github/workflows/apps/output_integration_versions.go @@ -12,6 +12,7 @@ import ( "fmt" "os" "os/exec" + "sort" "regexp" "strings" "sync" @@ -91,15 +92,20 @@ func fetchLatestVersion(module string) (string, error) { } versions := strings.Fields(stdout.String()) - fmt.Println("Versions:", versions) + // fmt.Println("Versions:", versions) if len(versions) < 1 { return "", fmt.Errorf("no versions found for module: %s", module) } return versions[len(versions)-1], nil } +func isModuleInstrumented(moduleName string, instrumentedSet map[string]struct{}) bool { + // whether the module has automatic tracing supported (by Orchestrion) + _, isInstrumented := instrumentedSet[moduleName] + return isInstrumented +} -func fetchAllLatestVersions(modules []ModuleVersion, instrumentedSet map[string]struct{}) []ModuleVersion { +func fetchAllLatestVersions(modules []ModuleVersion) []ModuleVersion { // Concurrently fetches the latest version of each module. var wg sync.WaitGroup @@ -111,20 +117,18 @@ func fetchAllLatestVersions(modules []ModuleVersion, instrumentedSet map[string] for _, mod := range modules { go func(mod ModuleVersion) { defer wg.Done() - fmt.Printf("Fetching latest version for module: %s\n", mod.Name) latestVersion, err := fetchLatestVersion(mod.Name) if err != nil { fmt.Printf("Error fetching latest version for %s: %v\n", mod.Name, err) mu.Lock() - updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, "Error", false}) + updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, "Error", mod.isInstrumented}) mu.Unlock() return } - _, isInstrumented := instrumentedSet[mod.Name] mu.Lock() updatedModules = append(updatedModules, ModuleVersion{mod.Name, - mod.MinVersion, latestVersion, isInstrumented}) + mod.MinVersion, latestVersion, mod.isInstrumented}) mu.Unlock() }(mod) } @@ -142,6 +146,12 @@ func outputVersionsAsMarkdown(modules []ModuleVersion, filePath string) error { fmt.Fprintln(file, "| Dependency | Minimum Version | Maximum Version | Auto-Instrumented |") fmt.Fprintln(file, "|------------|-----------------|-----------------|-----------------|") + + // Sort modules by name + sort.Slice(modules, func(i, j int) bool { + return modules[i].Name < modules[j].Name + }) + for _, mod := range modules { fmt.Fprintf(file, "| %s | v%s | %s | %+v\n", mod.Name, mod.MinVersion, mod.MaxVersion, mod.isInstrumented) } @@ -149,7 +159,7 @@ func outputVersionsAsMarkdown(modules []ModuleVersion, filePath string) error { } func main() { - goModPath := "integration_go.mod" // Modify path as needed + goModPath := "integration_go.mod" // path to integration_go.mod outputPath := "supported_versions.md" instrumentedSet := map[string]struct{}{ "database/sql": {}, @@ -198,7 +208,11 @@ func main() { return } - modulesWithLatest := fetchAllLatestVersions(modules, instrumentedSet) + for i := range modules { + modules[i].isInstrumented = isModuleInstrumented(modules[i].Name, instrumentedSet) + } + + modulesWithLatest := fetchAllLatestVersions(modules) err = outputVersionsAsMarkdown(modulesWithLatest, outputPath) if err != nil { diff --git a/.github/workflows/supported-versions.yml b/.github/workflows/supported-versions.yml index 7cf89d175b..7cb9f5c89f 100644 --- a/.github/workflows/supported-versions.yml +++ b/.github/workflows/supported-versions.yml @@ -26,7 +26,7 @@ jobs: - run: echo 'Smoke Tests workflow passed' - - run: go run parse_go_mod.go + - run: go run .github/workflows/apps/output_integration_versions.go - run: git diff diff --git a/supported_versions.md b/supported_versions.md index c56bd0ff1e..784653a9fd 100644 --- a/supported_versions.md +++ b/supported_versions.md @@ -1,85 +1,85 @@ | Dependency | Minimum Version | Maximum Version | Auto-Instrumented | |------------|-----------------|-----------------|-----------------| -| github.com/go-chi/chi/v5 | v5.0.10 | v5.2.0 | true -| go.mongodb.org/mongo-driver | v1.12.1 | v1.17.1 | false -| github.com/sirupsen/logrus | v1.9.3 | v1.9.3 | true -| github.com/aws/aws-sdk-go-v2/service/dynamodb | v1.21.4 | v1.38.1 | false -| github.com/tidwall/buntdb | v1.3.0 | v1.3.2 | false +| cloud.google.com/go/pubsub | v1.33.0 | v1.45.3 | true +| github.com/99designs/gqlgen | v0.17.36 | v0.17.61 | true +| github.com/IBM/sarama | v1.40.0 | v1.43.3 | true +| github.com/Shopify/sarama | v1.38.1 | v1.43.3 | true +| github.com/aws/aws-sdk-go | v1.44.327 | v1.55.5 | false +| github.com/aws/aws-sdk-go-v2 | v1.20.3 | v2.0.0-preview.4+incompatible | true | github.com/aws/aws-sdk-go-v2/config | v1.18.21 | v1.28.7 | false -| github.com/go-pg/pg/v10 | v10.11.1 | v10.14.0 | false -| github.com/graphql-go/handler | v0.2.3 | v0.2.4 | false -| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.2 | false +| github.com/aws/aws-sdk-go-v2/service/dynamodb | v1.21.4 | v1.38.1 | false +| github.com/aws/aws-sdk-go-v2/service/ec2 | v1.93.2 | v1.198.1 | false +| github.com/aws/aws-sdk-go-v2/service/eventbridge | v1.20.4 | v1.36.1 | false +| github.com/aws/aws-sdk-go-v2/service/kinesis | v1.18.4 | v1.32.8 | false +| github.com/aws/aws-sdk-go-v2/service/s3 | v1.32.0 | v1.71.1 | false +| github.com/aws/aws-sdk-go-v2/service/sfn | v1.19.4 | v1.34.2 | false +| github.com/aws/aws-sdk-go-v2/service/sns | v1.21.4 | v1.33.8 | false +| github.com/aws/aws-sdk-go-v2/service/sqs | v1.24.4 | v1.37.3 | false +| github.com/bradfitz/gomemcache | v0.0.0-20230611145640-acc696258285 | github.com/bradfitz/gomemcache | false +| github.com/confluentinc/confluent-kafka-go | v1.9.2 | v1.9.3-RC3 | false +| github.com/confluentinc/confluent-kafka-go/v2 | v2.2.0 | v2.6.1 | false | github.com/denisenkom/go-mssqldb | v0.11.0 | v0.12.3 | false +| github.com/dimfeld/httptreemux/v5 | v5.5.0 | v5.5.0 | false +| github.com/elastic/go-elasticsearch/v6 | v6.8.5 | v6.8.10 | false +| github.com/elastic/go-elasticsearch/v7 | v7.17.10 | v7.17.10 | false +| github.com/elastic/go-elasticsearch/v8 | v8.15.0 | v8.17.0 | false +| github.com/emicklei/go-restful | v2.16.0+incompatible | v2.16.0+incompatible | false | github.com/emicklei/go-restful/v3 | v3.11.0 | v3.12.1 | false +| github.com/garyburd/redigo | v1.6.4 | v1.6.4 | false +| github.com/gin-gonic/gin | v1.9.1 | v1.10.0 | true +| github.com/globalsign/mgo | v0.0.0-20181015135952-eeefdecb41b8 | github.com/globalsign/mgo | false +| github.com/go-chi/chi | v1.5.4 | v4.1.2+incompatible | true +| github.com/go-chi/chi/v5 | v5.0.10 | v5.2.0 | true +| github.com/go-pg/pg/v10 | v10.11.1 | v10.14.0 | false +| github.com/go-redis/redis | v6.15.9+incompatible | v6.15.9+incompatible | false +| github.com/go-redis/redis/v7 | v7.4.1 | v7.4.1 | true +| github.com/go-redis/redis/v8 | v8.11.5 | v8.11.5 | true +| github.com/go-redis/redis/v9 | v9.7.0 // renamed to redis/go-redis in v9 | v9.7.0 | false | github.com/go-sql-driver/mysql | v1.6.0 | v1.8.1 | false +| github.com/gocql/gocql | v1.6.0 | v1.7.0 | true +| github.com/gofiber/fiber/v2 | v2.52.5 | v2.52.5 | true | github.com/gomodule/redigo | v1.8.9 | v1.9.2 | false +| github.com/google/uuid | v1.5.0 | v1.6.0 | false +| github.com/gorilla/mux | v1.8.0 | v1.8.1 | true +| github.com/graph-gophers/graphql-go | v1.5.0 | v1.5.0 | true +| github.com/graphql-go/graphql | v0.8.1 | v0.8.1 | true +| github.com/graphql-go/handler | v0.2.3 | v0.2.4 | false +| github.com/hashicorp/consul/api | v1.24.0 | v1.31.0 | false +| github.com/hashicorp/go-multierror | v1.1.1 | v1.1.1 | false +| github.com/hashicorp/vault/api | v1.9.2 | v1.15.0 | false +| github.com/hashicorp/vault/sdk | v0.9.2 | v0.14.0 | false +| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.2 | false | github.com/jinzhu/gorm | v1.9.16 | v1.9.16 | true -| github.com/miekg/dns | v1.1.55 | v1.1.62 | false -| github.com/gin-gonic/gin | v1.9.1 | v1.10.0 | true -| github.com/aws/aws-sdk-go-v2/service/s3 | v1.32.0 | v1.71.1 | false -| github.com/confluentinc/confluent-kafka-go | v1.9.2 | v1.9.3-RC3 | false -| github.com/go-redis/redis | v6.15.9+incompatible | v6.15.9+incompatible | false -| cloud.google.com/go/pubsub | v1.33.0 | v1.45.3 | true | github.com/jmoiron/sqlx | v1.3.5 | v1.4.0 | false | github.com/julienschmidt/httprouter | v1.3.0 | v1.3.0 | true -| gorm.io/driver/sqlserver | v1.4.2 | v1.5.4 | false -| github.com/aws/aws-sdk-go-v2/service/kinesis | v1.18.4 | v1.32.8 | false -| github.com/graphql-go/graphql | v0.8.1 | v0.8.1 | true -| github.com/aws/aws-sdk-go-v2 | v1.20.3 | v2.0.0-preview.4+incompatible | true -| github.com/go-redis/redis/v8 | v8.11.5 | v8.11.5 | true -| github.com/aws/aws-sdk-go | v1.44.327 | v1.55.5 | false -| github.com/go-redis/redis/v7 | v7.4.1 | v7.4.1 | true -| github.com/hashicorp/vault/sdk | v0.9.2 | v0.14.0 | false -| github.com/IBM/sarama | v1.40.0 | v1.43.3 | true -| github.com/valyala/fasthttp | v1.51.0 | v1.58.0 | false -| github.com/segmentio/kafka-go | v0.4.42 | v0.4.47 | true -| github.com/elastic/go-elasticsearch/v6 | v6.8.5 | v6.8.10 | false +| github.com/labstack/echo | v3.3.10+incompatible | v3.3.10+incompatible | false +| github.com/labstack/echo/v4 | v4.11.1 | v4.13.3 | true +| github.com/lib/pq | v1.10.2 | v1.10.9 | false +| github.com/mattn/go-sqlite3 | v1.14.18 | v1.14.24 | false | github.com/microsoft/go-mssqldb | v0.21.0 | v1.8.0 | false -| github.com/confluentinc/confluent-kafka-go/v2 | v2.2.0 | v2.6.1 | false -| github.com/bradfitz/gomemcache | v0.0.0-20230611145640-acc696258285 | github.com/bradfitz/gomemcache | false -| github.com/zenazn/goji | v1.0.1 | v1.0.1 | false -| gopkg.in/olivere/elastic.v5 | v5.0.84 | v5.0.86 | false -| github.com/garyburd/redigo | v1.6.4 | v1.6.4 | false -| github.com/aws/aws-sdk-go-v2/service/sfn | v1.19.4 | v1.34.2 | false +| github.com/miekg/dns | v1.1.55 | v1.1.62 | false | github.com/redis/go-redis/v9 | v9.7.0 | v9.7.0 | true -| gorm.io/driver/postgres | v1.4.6 | v1.5.11 | false -| github.com/vektah/gqlparser/v2 | v2.5.16 | v2.5.21 | false -| github.com/99designs/gqlgen | v0.17.36 | v0.17.61 | true -| gorm.io/gorm | v1.25.3 | v1.25.12 | true -| github.com/twitchtv/twirp | v8.1.3+incompatible | v8.1.3+incompatible | true -| google.golang.org/protobuf | v1.33.0 | v1.36.1 | false -| github.com/go-chi/chi | v1.5.4 | v4.1.2+incompatible | true -| github.com/hashicorp/go-multierror | v1.1.1 | v1.1.1 | false -| k8s.io/client-go | v0.23.17 | v0.33.0-alpha.0 | true +| github.com/segmentio/kafka-go | v0.4.42 | v0.4.47 | true +| github.com/sirupsen/logrus | v1.9.3 | v1.9.3 | true | github.com/syndtr/goleveldb | v1.0.1-0.20220721030215-126854af5e6d | v1.0.0 | false -| github.com/hashicorp/consul/api | v1.24.0 | v1.31.0 | false -| github.com/go-redis/redis/v9 | v9.7.0 // renamed to redis/go-redis in v9 | v9.7.0 | false -| github.com/globalsign/mgo | v0.0.0-20181015135952-eeefdecb41b8 | github.com/globalsign/mgo | false -| github.com/aws/aws-sdk-go-v2/service/sns | v1.21.4 | v1.33.8 | false -| gopkg.in/jinzhu/gorm.v1 | v1.9.2 | v1.9.2 | false -| github.com/aws/aws-sdk-go-v2/service/ec2 | v1.93.2 | v1.198.1 | false -| github.com/elastic/go-elasticsearch/v8 | v8.15.0 | v8.17.0 | false -| github.com/elastic/go-elasticsearch/v7 | v7.17.10 | v7.17.10 | false -| github.com/mattn/go-sqlite3 | v1.14.18 | v1.14.24 | false -| github.com/urfave/negroni | v1.0.0 | v1.0.0 | false -| github.com/graph-gophers/graphql-go | v1.5.0 | v1.5.0 | true -| github.com/lib/pq | v1.10.2 | v1.10.9 | false -| github.com/uptrace/bun/dialect/sqlitedialect | v1.1.17 | v1.2.6 | false -| github.com/labstack/echo | v3.3.10+incompatible | v3.3.10+incompatible | false -| github.com/dimfeld/httptreemux/v5 | v5.5.0 | v5.5.0 | false -| gorm.io/driver/mysql | v1.0.1 | v1.5.7 | false -| github.com/aws/aws-sdk-go-v2/service/eventbridge | v1.20.4 | v1.36.1 | false -| gopkg.in/olivere/elastic.v3 | v3.0.75 | v3.0.75 | false -| github.com/Shopify/sarama | v1.38.1 | v1.43.3 | true -| google.golang.org/api | v0.128.0 | v0.214.0 | false +| github.com/tidwall/buntdb | v1.3.0 | v1.3.2 | false +| github.com/twitchtv/twirp | v8.1.3+incompatible | v8.1.3+incompatible | true | github.com/uptrace/bun | v1.1.17 | v1.2.6 | false +| github.com/uptrace/bun/dialect/sqlitedialect | v1.1.17 | v1.2.6 | false +| github.com/urfave/negroni | v1.0.0 | v1.0.0 | false +| github.com/valyala/fasthttp | v1.51.0 | v1.58.0 | false +| github.com/vektah/gqlparser/v2 | v2.5.16 | v2.5.21 | false +| github.com/zenazn/goji | v1.0.1 | v1.0.1 | false +| go.mongodb.org/mongo-driver | v1.12.1 | v1.17.1 | false | go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | v0.44.0 | v0.58.0 | false +| google.golang.org/api | v0.128.0 | v0.214.0 | false | google.golang.org/grpc | v1.57.1 | v1.70.0-dev | true -| github.com/gofiber/fiber/v2 | v2.52.5 | v2.52.5 | true -| github.com/emicklei/go-restful | v2.16.0+incompatible | v2.16.0+incompatible | false -| github.com/google/uuid | v1.5.0 | v1.6.0 | false -| github.com/gocql/gocql | v1.6.0 | v1.7.0 | true -| github.com/aws/aws-sdk-go-v2/service/sqs | v1.24.4 | v1.37.3 | false -| github.com/labstack/echo/v4 | v4.11.1 | v4.13.3 | true -| github.com/gorilla/mux | v1.8.0 | v1.8.1 | true -| github.com/hashicorp/vault/api | v1.9.2 | v1.15.0 | false +| google.golang.org/protobuf | v1.33.0 | v1.36.1 | false +| gopkg.in/jinzhu/gorm.v1 | v1.9.2 | v1.9.2 | false +| gopkg.in/olivere/elastic.v3 | v3.0.75 | v3.0.75 | false +| gopkg.in/olivere/elastic.v5 | v5.0.84 | v5.0.86 | false +| gorm.io/driver/mysql | v1.0.1 | v1.5.7 | false +| gorm.io/driver/postgres | v1.4.6 | v1.5.11 | false +| gorm.io/driver/sqlserver | v1.4.2 | v1.5.4 | false +| gorm.io/gorm | v1.25.3 | v1.25.12 | true +| k8s.io/client-go | v0.23.17 | v0.33.0-alpha.0 | true From 26b5d2633c704c020c9d239cc0d7073f60ed0a5d Mon Sep 17 00:00:00 2001 From: quinna-h Date: Fri, 3 Jan 2025 12:29:09 -0500 Subject: [PATCH 5/5] update logic --- .../apps/output_integration_versions.go | 19 +++++++- supported_versions.md | 44 +++++++++---------- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/.github/workflows/apps/output_integration_versions.go b/.github/workflows/apps/output_integration_versions.go index 409cd7849a..87ee018e8b 100644 --- a/.github/workflows/apps/output_integration_versions.go +++ b/.github/workflows/apps/output_integration_versions.go @@ -27,6 +27,14 @@ type ModuleVersion struct { } +func isSubdirectory(url, pattern string) bool { + if strings.HasPrefix(url, pattern) { + // Ensure the match is either exact or followed by a "/" + return len(url) == len(pattern) || url[len(pattern)] == '/' + } + return false +} + func parseGoMod(filePath string) ([]ModuleVersion, error) { // This parses the go.mod file and extracts modules with their minimum versions. var modules []ModuleVersion @@ -101,7 +109,14 @@ func fetchLatestVersion(module string) (string, error) { } func isModuleInstrumented(moduleName string, instrumentedSet map[string]struct{}) bool { // whether the module has automatic tracing supported (by Orchestrion) - _, isInstrumented := instrumentedSet[moduleName] + // _, isInstrumented := instrumentedSet[moduleName] + isInstrumented := false + for key := range instrumentedSet { + if isSubdirectory(moduleName, key) { + isInstrumented = true + break + } + } return isInstrumented } @@ -177,7 +192,7 @@ func main() { "gorm.io/gorm": {}, "net/http": {}, "go.mongodb.org/mongo-driver/mongo": {}, - "github.com/aws-sdk-go/aws": {}, + "github.com/aws/aws-sdk-go": {}, "github.com/hashicorp/vault": {}, "github.com/IBM/sarama": {}, "github.com/Shopify/sarama": {}, diff --git a/supported_versions.md b/supported_versions.md index 784653a9fd..62cd9ae59d 100644 --- a/supported_versions.md +++ b/supported_versions.md @@ -1,28 +1,28 @@ | Dependency | Minimum Version | Maximum Version | Auto-Instrumented | |------------|-----------------|-----------------|-----------------| | cloud.google.com/go/pubsub | v1.33.0 | v1.45.3 | true -| github.com/99designs/gqlgen | v0.17.36 | v0.17.61 | true -| github.com/IBM/sarama | v1.40.0 | v1.43.3 | true -| github.com/Shopify/sarama | v1.38.1 | v1.43.3 | true -| github.com/aws/aws-sdk-go | v1.44.327 | v1.55.5 | false +| github.com/99designs/gqlgen | v0.17.36 | v0.17.62 | true +| github.com/IBM/sarama | v1.40.0 | v1.44.0 | true +| github.com/Shopify/sarama | v1.38.1 | v1.44.0 | true +| github.com/aws/aws-sdk-go | v1.44.327 | v1.55.5 | true | github.com/aws/aws-sdk-go-v2 | v1.20.3 | v2.0.0-preview.4+incompatible | true -| github.com/aws/aws-sdk-go-v2/config | v1.18.21 | v1.28.7 | false -| github.com/aws/aws-sdk-go-v2/service/dynamodb | v1.21.4 | v1.38.1 | false -| github.com/aws/aws-sdk-go-v2/service/ec2 | v1.93.2 | v1.198.1 | false -| github.com/aws/aws-sdk-go-v2/service/eventbridge | v1.20.4 | v1.36.1 | false -| github.com/aws/aws-sdk-go-v2/service/kinesis | v1.18.4 | v1.32.8 | false -| github.com/aws/aws-sdk-go-v2/service/s3 | v1.32.0 | v1.71.1 | false -| github.com/aws/aws-sdk-go-v2/service/sfn | v1.19.4 | v1.34.2 | false -| github.com/aws/aws-sdk-go-v2/service/sns | v1.21.4 | v1.33.8 | false -| github.com/aws/aws-sdk-go-v2/service/sqs | v1.24.4 | v1.37.3 | false +| github.com/aws/aws-sdk-go-v2/config | v1.18.21 | v1.28.7 | true +| github.com/aws/aws-sdk-go-v2/service/dynamodb | v1.21.4 | v1.38.1 | true +| github.com/aws/aws-sdk-go-v2/service/ec2 | v1.93.2 | v1.198.1 | true +| github.com/aws/aws-sdk-go-v2/service/eventbridge | v1.20.4 | v1.36.1 | true +| github.com/aws/aws-sdk-go-v2/service/kinesis | v1.18.4 | v1.32.8 | true +| github.com/aws/aws-sdk-go-v2/service/s3 | v1.32.0 | v1.71.1 | true +| github.com/aws/aws-sdk-go-v2/service/sfn | v1.19.4 | v1.34.2 | true +| github.com/aws/aws-sdk-go-v2/service/sns | v1.21.4 | v1.33.8 | true +| github.com/aws/aws-sdk-go-v2/service/sqs | v1.24.4 | v1.37.4 | true | github.com/bradfitz/gomemcache | v0.0.0-20230611145640-acc696258285 | github.com/bradfitz/gomemcache | false | github.com/confluentinc/confluent-kafka-go | v1.9.2 | v1.9.3-RC3 | false | github.com/confluentinc/confluent-kafka-go/v2 | v2.2.0 | v2.6.1 | false | github.com/denisenkom/go-mssqldb | v0.11.0 | v0.12.3 | false | github.com/dimfeld/httptreemux/v5 | v5.5.0 | v5.5.0 | false -| github.com/elastic/go-elasticsearch/v6 | v6.8.5 | v6.8.10 | false -| github.com/elastic/go-elasticsearch/v7 | v7.17.10 | v7.17.10 | false -| github.com/elastic/go-elasticsearch/v8 | v8.15.0 | v8.17.0 | false +| github.com/elastic/go-elasticsearch/v6 | v6.8.5 | v6.8.10 | true +| github.com/elastic/go-elasticsearch/v7 | v7.17.10 | v7.17.10 | true +| github.com/elastic/go-elasticsearch/v8 | v8.15.0 | v8.17.0 | true | github.com/emicklei/go-restful | v2.16.0+incompatible | v2.16.0+incompatible | false | github.com/emicklei/go-restful/v3 | v3.11.0 | v3.12.1 | false | github.com/garyburd/redigo | v1.6.4 | v1.6.4 | false @@ -37,7 +37,7 @@ | github.com/go-redis/redis/v9 | v9.7.0 // renamed to redis/go-redis in v9 | v9.7.0 | false | github.com/go-sql-driver/mysql | v1.6.0 | v1.8.1 | false | github.com/gocql/gocql | v1.6.0 | v1.7.0 | true -| github.com/gofiber/fiber/v2 | v2.52.5 | v2.52.5 | true +| github.com/gofiber/fiber/v2 | v2.52.5 | v2.52.6 | true | github.com/gomodule/redigo | v1.8.9 | v1.9.2 | false | github.com/google/uuid | v1.5.0 | v1.6.0 | false | github.com/gorilla/mux | v1.8.0 | v1.8.1 | true @@ -46,9 +46,9 @@ | github.com/graphql-go/handler | v0.2.3 | v0.2.4 | false | github.com/hashicorp/consul/api | v1.24.0 | v1.31.0 | false | github.com/hashicorp/go-multierror | v1.1.1 | v1.1.1 | false -| github.com/hashicorp/vault/api | v1.9.2 | v1.15.0 | false -| github.com/hashicorp/vault/sdk | v0.9.2 | v0.14.0 | false -| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.2 | false +| github.com/hashicorp/vault/api | v1.9.2 | v1.15.0 | true +| github.com/hashicorp/vault/sdk | v0.9.2 | v0.14.0 | true +| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.2 | true | github.com/jinzhu/gorm | v1.9.16 | v1.9.16 | true | github.com/jmoiron/sqlx | v1.3.5 | v1.4.0 | false | github.com/julienschmidt/httprouter | v1.3.0 | v1.3.0 | true @@ -64,8 +64,8 @@ | github.com/syndtr/goleveldb | v1.0.1-0.20220721030215-126854af5e6d | v1.0.0 | false | github.com/tidwall/buntdb | v1.3.0 | v1.3.2 | false | github.com/twitchtv/twirp | v8.1.3+incompatible | v8.1.3+incompatible | true -| github.com/uptrace/bun | v1.1.17 | v1.2.6 | false -| github.com/uptrace/bun/dialect/sqlitedialect | v1.1.17 | v1.2.6 | false +| github.com/uptrace/bun | v1.1.17 | v1.2.7 | false +| github.com/uptrace/bun/dialect/sqlitedialect | v1.1.17 | v1.2.7 | false | github.com/urfave/negroni | v1.0.0 | v1.0.0 | false | github.com/valyala/fasthttp | v1.51.0 | v1.58.0 | false | github.com/vektah/gqlparser/v2 | v2.5.16 | v2.5.21 | false