Skip to content

Commit

Permalink
Merge branch 'main' into rarguellof/APPSEC-53291/support-pubsub-3
Browse files Browse the repository at this point in the history
  • Loading branch information
rarguelloF committed Sep 23, 2024
2 parents 8280d60 + c6451d2 commit 02ca2f3
Show file tree
Hide file tree
Showing 122 changed files with 839 additions and 514 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
go generate ./...
go -C _integration-tests generate -tags=integration ./...
env:
GOFLAGS: -cover -covermode=atomic -coverpkg=github.com/datadog/orchestrion/...,./...
GOFLAGS: -cover -covermode=atomic -coverpkg=github.com/DataDog/orchestrion/...,./...
GOCOVERDIR: ${{ github.workspace }}/coverage
- name: Consolidate coverage report
if: github.event_name != 'merge_group'
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
mkdir -p coverage
test_args=("-shuffle=on" "-race" "-v")
if [ "${{ github.event_name }}" != "merge_group" ]; then
test_args+=("-cover" "-covermode=atomic" "-coverpkg=./...,github.com/datadog/orchestrion/..." "-coverprofile=${{ github.workspace }}/coverage/unit.out")
test_args+=("-cover" "-covermode=atomic" "-coverpkg=./...,github.com/DataDog/orchestrion/..." "-coverprofile=${{ github.workspace }}/coverage/unit.out")
fi
go test "${test_args[@]}" ./...
- name: Run integraton suite unit tests
Expand All @@ -203,7 +203,7 @@ jobs:
mkdir -p coverage
test_args=("-shuffle=on" "-race" "-v")
if [ "${{ github.event_name }}" != "merge_group" ]; then
test_args+=("-cover" "-covermode=atomic" "-coverpkg=./...,github.com/datadog/orchestrion/..." "-coverprofile=${{ github.workspace }}/coverage/integration.out")
test_args+=("-cover" "-covermode=atomic" "-coverpkg=./...,github.com/DataDog/orchestrion/..." "-coverprofile=${{ github.workspace }}/coverage/integration.out")
fi
go -C _integration-tests test "${test_args[@]}" ./...
- name: Determine simple go version
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
mkdir -p "${GOCOVERDIR}"
test_args=("-shuffle=on" "-v")
if [ "${{ github.event_name }}" != "merge_group" ]; then
test_args+=("-coverpkg=./...,github.com/datadog/orchestrion/..." "-covermode=atomic" "-cover" "-coverprofile=${{ github.workspace }}/coverage/integration.run.out")
test_args+=("-coverpkg=./...,github.com/DataDog/orchestrion/..." "-covermode=atomic" "-cover" "-coverprofile=${{ github.workspace }}/coverage/integration.run.out")
fi
case "${{ matrix.build-mode }}" in
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ orchestrion,github.com/DataDog/datadog-go/v5/statsd,MIT,"Copyright (c) 2015 Data
orchestrion,github.com/DataDog/go-libddwaf/v3,Apache-2.0,"Copyright 2016-present Datadog, Inc."
orchestrion,github.com/DataDog/go-sqllexer,MIT,"Copyright (c) 2023 Datadog, Inc."
orchestrion,github.com/DataDog/go-tuf,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved."
orchestrion,github.com/DataDog/orchestrion,Apache-2.0,"Copyright 2023 Datadog, Inc. | Copyright [2023-Present] Datadog, Inc."
orchestrion,github.com/Microsoft/go-winio,MIT,Copyright (c) 2015 Microsoft
orchestrion,github.com/aymanbagabas/go-osc52/v2,MIT,Copyright (c) 2022 Ayman Bagabas
orchestrion,github.com/cespare/xxhash/v2,MIT,Copyright (c) 2016 Caleb Spare
orchestrion,github.com/charmbracelet/lipgloss,MIT,"Copyright (c) 2021-2023 Charmbracelet, Inc"
orchestrion,github.com/charmbracelet/x/ansi,MIT,"Copyright (c) 2023 Charmbracelet, Inc."
orchestrion,github.com/cpuguy83/go-md2man/v2/md2man,MIT,Copyright (c) 2014 Brian Goff
orchestrion,github.com/datadog/orchestrion,Apache-2.0,"Copyright 2023 Datadog, Inc. | Copyright [2023-Present] Datadog, Inc."
orchestrion,github.com/dave/dst,MIT,Copyright (c) 2018 David Brophy | Copyright (c) 2009 The Go Authors. All rights reserved.
orchestrion,github.com/dave/jennifer/jen,MIT,Copyright (c) 2017 David Brophy
orchestrion,github.com/dlclark/regexp2,MIT,unknown
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ In addition to this, Orchestrion only supports projects using [Go modules][go-mo

1. Install Orchestrion:
```console
$ go install github.com/datadog/orchestrion@latest
$ go install github.com/DataDog/orchestrion@latest
```

2. <details><summary>Optional: project <tt>go.mod</tt> registration</summary>
Expand All @@ -61,9 +61,9 @@ In addition to this, Orchestrion only supports projects using [Go modules][go-mo
>
> package tools
>
> import _ "github.com/datadog/orchestrion"
> import _ "github.com/DataDog/orchestrion"
> ```
> 2. Run `go get github.com/datadog/orchstrion@<current-release>` to make sure the project version corresponds to the
> 2. Run `go get github.com/DataDog/orchstrion@<current-release>` to make sure the project version corresponds to the
> one currently being used
> 3. Run `go mod tidy` to make sure your `go.mod` and `go.sum` files are up-to-date
>
Expand All @@ -82,13 +82,13 @@ In addition to this, Orchestrion only supports projects using [Go modules][go-mo
```
╭──────────────────────────────────────────────────────────────────────────────╮
│ │
│ Warning: github.com/datadog/orchestrion is not present in your go.mod │
│ Warning: github.com/DataDog/orchestrion is not present in your go.mod │
│ file. │
│ In order to ensure build reliability and reproductibility, orchestrion │
│ will now add itself in your go.mod file by: │
│ │
│ 1. creating a new file named orchestrion.tool.go │
│ 2. running go get github.com/datadog/[email protected]
│ 2. running go get github.com/DataDog/[email protected]
│ 3. running go mod tidy │
│ │
│ You should commit the resulting changes into your source control system. │
Expand All @@ -110,7 +110,7 @@ In addition to this, Orchestrion only supports projects using [Go modules][go-mo
> The version of `orchestrion` used to compile your project is ultimately tracked in the `go.mod` file. You can manage
> it in the same way you manage any other dependency, and updating to the latest release is as simple as doing:
> ```console
> $ go get github.com/datadog/orchestrion@latest
> $ go get github.com/DataDog/orchestrion@latest
> ```

## Supported libraries
Expand Down
6 changes: 3 additions & 3 deletions _integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ module orchestrion/integration

go 1.22.6

replace github.com/datadog/orchestrion => ../
replace github.com/DataDog/orchestrion => ../

require (
cloud.google.com/go/pubsub v1.42.0
github.com/DataDog/orchestrion v0.7.4
github.com/IBM/sarama v1.43.3
github.com/Shopify/sarama v1.38.1
github.com/aws/aws-sdk-go v1.55.5
github.com/aws/aws-sdk-go-v2 v1.30.4
github.com/aws/aws-sdk-go-v2/config v1.27.30
github.com/aws/aws-sdk-go-v2/credentials v1.17.29
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.6
github.com/datadog/orchestrion v0.7.4
github.com/dave/jennifer v1.7.0
github.com/docker/go-connections v0.5.0
github.com/gin-gonic/gin v1.10.0
Expand Down Expand Up @@ -43,7 +43,7 @@ require (
google.golang.org/api v0.194.0
google.golang.org/grpc v1.65.0
google.golang.org/grpc/examples v0.0.0-20240816220358-f8d98a477c22
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0-rc.2
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0
gorm.io/driver/sqlite v1.5.6
gorm.io/gorm v1.25.11
gotest.tools/v3 v3.5.1
Expand Down
4 changes: 2 additions & 2 deletions _integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2376,8 +2376,8 @@ google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0-rc.2 h1:EVPVNIE/pORPQ8i1lS1IzrvA9rWw3ZPoKAATqkLlAqE=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0-rc.2/go.mod h1:mkZpWVLO/ERW5NqlW+w5d8waQKNvMSTUQLJfoI0vlvw=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0 h1:8WPoOHJcMAtcxTVKM0DYnFweBjxxfNit3Sjo/rf+Hkw=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0/go.mod h1:mkZpWVLO/ERW5NqlW+w5d8waQKNvMSTUQLJfoI0vlvw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
2 changes: 1 addition & 1 deletion _integration-tests/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
package tools

import (
_ "github.com/datadog/orchestrion"
_ "github.com/DataDog/orchestrion"
)
2 changes: 1 addition & 1 deletion _integration-tests/utils/agent/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ frozenlist==1.4.1
idna==3.10
msgpack==1.1.0
multidict==6.1.0
protobuf==5.28.1
protobuf==5.28.2
requests==2.32.3
six==1.16.0
typing_extensions==4.12.2
Expand Down
1 change: 0 additions & 1 deletion _integration-tests/utils/testcontainers.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func StartDynamoDBTestContainer(t *testing.T) (testcontainers.Container, string,
Image: "amazon/dynamodb-local:latest",
ExposedPorts: []string{exposedPort},
WaitingFor: wait.ForHTTP("").WithStatusCodeMatcher(func(int) bool { return true }),
Name: "dynamodb-local",
WorkingDir: "/home/dynamodblocal",
Cmd: []string{
"-jar", "DynamoDBLocal.jar",
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This is achieved using the following steps:
### Step 1
Install Orchestrion in your environment:
```console
$ go install github.com/datadog/orchestrion@latest
$ go install github.com/DataDog/orchestrion@latest
```

If necessary, also add the `GOBIN` directory to your `PATH`:
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/datadog/orchestrion
module github.com/DataDog/orchestrion

go 1.22.6

Expand All @@ -19,10 +19,11 @@ require (
github.com/shirou/gopsutil/v3 v3.24.5
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.27.4
golang.org/x/mod v0.20.0
golang.org/x/sys v0.24.0
golang.org/x/term v0.23.0
golang.org/x/tools v0.24.0
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0-rc.2
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
k8s.io/client-go v0.31.0
Expand Down Expand Up @@ -283,7 +284,6 @@ require (
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
golang.org/x/image v0.19.0 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1268,8 +1268,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0-rc.2 h1:EVPVNIE/pORPQ8i1lS1IzrvA9rWw3ZPoKAATqkLlAqE=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0-rc.2/go.mod h1:mkZpWVLO/ERW5NqlW+w5d8waQKNvMSTUQLJfoI0vlvw=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0 h1:8WPoOHJcMAtcxTVKM0DYnFweBjxxfNit3Sjo/rf+Hkw=
gopkg.in/DataDog/dd-trace-go.v1 v1.68.0/go.mod h1:mkZpWVLO/ERW5NqlW+w5d8waQKNvMSTUQLJfoI0vlvw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
2 changes: 1 addition & 1 deletion instrument/instrument.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"context"
"fmt"

"github.com/datadog/orchestrion/instrument/event"
"github.com/DataDog/orchestrion/instrument/event"

"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
)
Expand Down
2 changes: 1 addition & 1 deletion instrument/instrument_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"context"
"testing"

"github.com/datadog/orchestrion/instrument/event"
"github.com/DataDog/orchestrion/instrument/event"

"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/go.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"errors"
"os/exec"

"github.com/datadog/orchestrion/internal/goproxy"
"github.com/datadog/orchestrion/internal/pin"
"github.com/DataDog/orchestrion/internal/goproxy"
"github.com/DataDog/orchestrion/internal/pin"
"github.com/urfave/cli/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package cmd

import (
"github.com/datadog/orchestrion/internal/pin"
"github.com/DataDog/orchestrion/internal/pin"
"github.com/urfave/cli/v2"
)

Expand Down
10 changes: 5 additions & 5 deletions internal/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"os/signal"
"time"

"github.com/datadog/orchestrion/internal/filelock"
"github.com/datadog/orchestrion/internal/jobserver"
"github.com/datadog/orchestrion/internal/jobserver/client"
"github.com/datadog/orchestrion/internal/log"
"github.com/DataDog/orchestrion/internal/filelock"
"github.com/DataDog/orchestrion/internal/jobserver"
"github.com/DataDog/orchestrion/internal/jobserver/client"
"github.com/DataDog/orchestrion/internal/log"
"github.com/fsnotify/fsnotify"

"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -49,7 +49,7 @@ var Server = &cli.Command{
Hidden: true,
Action: func(c *cli.Context) error {
opts := jobserver.Options{
ServerName: "github.com/datadog/orchestrion server",
ServerName: "github.com/DataDog/orchestrion server",
Port: c.Int("port"),
InactivityTimeout: c.Duration("inactivity-timeout"),
EnableLogging: c.Bool("nats-logging"),
Expand Down
12 changes: 6 additions & 6 deletions internal/cmd/toolexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"fmt"
"os"

"github.com/datadog/orchestrion/internal/log"
"github.com/datadog/orchestrion/internal/pin"
"github.com/datadog/orchestrion/internal/toolexec"
"github.com/datadog/orchestrion/internal/toolexec/aspect"
"github.com/datadog/orchestrion/internal/toolexec/proxy"
"github.com/DataDog/orchestrion/internal/log"
"github.com/DataDog/orchestrion/internal/pin"
"github.com/DataDog/orchestrion/internal/toolexec"
"github.com/DataDog/orchestrion/internal/toolexec/aspect"
"github.com/DataDog/orchestrion/internal/toolexec/proxy"
"github.com/urfave/cli/v2"
)

Expand Down Expand Up @@ -63,7 +63,7 @@ var Toolexec = &cli.Command{
return err
}

log.Tracef("Toolexec final command: %q/n", proxyCmd.Args())
log.Tracef("Toolexec final command: %q\n", proxyCmd.Args())
return proxy.RunCommand(proxyCmd)
},
}
4 changes: 2 additions & 2 deletions internal/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"fmt"
"runtime"

"github.com/datadog/orchestrion/internal/ensure"
"github.com/datadog/orchestrion/internal/version"
"github.com/DataDog/orchestrion/internal/ensure"
"github.com/DataDog/orchestrion/internal/version"
"github.com/urfave/cli/v2"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"runtime"
"testing"

"github.com/datadog/orchestrion/internal/cmd"
"github.com/datadog/orchestrion/internal/version"
"github.com/DataDog/orchestrion/internal/cmd"
"github.com/DataDog/orchestrion/internal/version"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/ensure/integration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"fmt"
"log"

"github.com/datadog/orchestrion/internal/ensure"
"github.com/DataDog/orchestrion/internal/ensure"
)

// main is the entry point of a command that is used by the `ensure` integration
Expand Down
18 changes: 13 additions & 5 deletions internal/ensure/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import (
"strings"
"testing"

"github.com/DataDog/orchestrion/internal/version"
"github.com/stretchr/testify/require"
"golang.org/x/mod/semver"
)

var ensureDir string
Expand Down Expand Up @@ -47,11 +49,17 @@ func Test(t *testing.T) {
fails bool
}
for name, test := range map[string]test{
"v0.6.0": {version: "v0.6.0", output: "v0.6.0"},
"replaced": {version: "v0.6.0", replaces: true, output: "This command has not respawned!"},
"v0.9.0": {version: "v0.9.0", output: "v0.9.0"},
"replaced": {version: "v0.9.0", replaces: true, output: "This command has not respawned!"},
"none": {fails: true},
} {
t.Run(name, func(t *testing.T) {
if !test.replaces && semver.Compare(test.version, version.Tag) >= 0 {
// Tests w/o replace can't run if the "happy" version has not been released yet. v0.9.0 includes a module path
// re-capitalization which forces us to skip temporarily at least until that is released.
t.Skipf("Skipping test because version %s is newer than the current version (%s)", test.version, version.Tag)
}

wd := filepath.Join(tmp, name)
require.NoError(t, os.Mkdir(wd, 0750), "failed to create test working directory")

Expand All @@ -63,21 +71,21 @@ func Test(t *testing.T) {
}

if test.version != "" {
goMod = append(goMod, fmt.Sprintf("require github.com/datadog/orchestrion %s", test.version), "")
goMod = append(goMod, fmt.Sprintf("require github.com/DataDog/orchestrion %s", test.version), "")

// So that "go mod tidy" does not remove the requirement...
require.NoError(t,
os.WriteFile(filepath.Join(wd, "tools.go"), []byte(strings.Join([]string{
"//go:build tools",
"package tools",
"",
"import _ \"github.com/datadog/orchestrion\"",
"import _ \"github.com/DataDog/orchestrion\"",
}, "\n")), 0o644),
"failed to write tools.go",
)
}
if test.replaces {
goMod = append(goMod, fmt.Sprintf("replace github.com/datadog/orchestrion => %s", filepath.Dir(filepath.Dir(ensureDir))), "")
goMod = append(goMod, fmt.Sprintf("replace github.com/DataDog/orchestrion => %s", filepath.Dir(filepath.Dir(ensureDir))), "")
}

require.NoError(t,
Expand Down
Loading

0 comments on commit 02ca2f3

Please sign in to comment.