Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
quinna-h committed Dec 26, 2024
1 parent 5583f81 commit 827f52f
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 78 deletions.
30 changes: 22 additions & 8 deletions parse_go_mod.go → ...flows/apps/output_integration_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"fmt"
"os"
"os/exec"
"sort"
"regexp"
"strings"
"sync"
Expand Down Expand Up @@ -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
Expand All @@ -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)
}
Expand All @@ -142,14 +146,20 @@ 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)
}
return nil
}

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": {},
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/supported-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
138 changes: 69 additions & 69 deletions supported_versions.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 827f52f

Please sign in to comment.