diff --git a/.github/workflows/docker-test.yaml b/.github/workflows/docker-test.yaml index 3a8b782cc..ff1fa1a31 100644 --- a/.github/workflows/docker-test.yaml +++ b/.github/workflows/docker-test.yaml @@ -21,7 +21,7 @@ jobs: - name: eth_clients tests: TestBesu|TestGeth|TestNethermind|TestErigon - name: other - tests: TestPostgres|TestMockServer|TestKillgrave + tests: TestPostgres|TestParrotServer|TestKillgrave steps: - name: Checkout the Repo uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 diff --git a/.github/workflows/framework-golden-tests.yml b/.github/workflows/framework-golden-tests.yml index 54feabf9a..77a61b81c 100644 --- a/.github/workflows/framework-golden-tests.yml +++ b/.github/workflows/framework-golden-tests.yml @@ -65,9 +65,9 @@ jobs: - 'framework/**' - '.github/workflows/framework-golden-tests.yml' - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.22.8 + go-version: 1.23 - name: Cache Go modules uses: actions/cache@v3 with: diff --git a/.github/workflows/framework.yml b/.github/workflows/framework.yml index cf5227020..97ea9ea85 100644 --- a/.github/workflows/framework.yml +++ b/.github/workflows/framework.yml @@ -36,9 +36,9 @@ jobs: src: - 'framework/**' - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.22.8 + go-version: 1.23 - name: Cache Go modules uses: actions/cache@v4 with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 829fa2793..a20faa1f9 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -56,6 +56,8 @@ jobs: path: ./tools/asciitable/ - name: workflowresultparser path: ./tools/workflowresultparser/ + - name: parrotserver + path: ./parrotserver/ steps: - name: Check out Code uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 diff --git a/.github/workflows/parrotserver-release.yaml b/.github/workflows/parrotserver-release.yaml new file mode 100644 index 000000000..088cd0913 --- /dev/null +++ b/.github/workflows/parrotserver-release.yaml @@ -0,0 +1,33 @@ +name: Parrotserver Release + +on: + push: + tags: + - parrotserver/v* + +jobs: + release: + name: Build and Release + runs-on: ubuntu-latest + environment: integration + steps: + - name: Checkout repo + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 + with: + aws-region: ${{ secrets.QA_AWS_REGION }} + role-to-assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + role-duration-seconds: 600 + - name: Login to Amazon ECR + uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 + with: + mask-password: 'true' + env: + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + - name: Build and release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + IMAGE_PREFIX: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/parrotserver + IMAGE_TAG: ${{ github.ref_name}} + run: goreleaser release --clean -f ./parrotserver/.goreleaser.yml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d595356b5..97ff662e3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -26,6 +26,8 @@ jobs: path: ./tools/flakeguard/ - name: workflowresultparser path: ./tools/workflowresultparser/ + - name: parrotserver + path: ./parrotserver/ runs-on: ubuntu-latest name: ${{ matrix.project.name }} unit tests steps: diff --git a/.github/workflows/update-internal-mirrors.yaml b/.github/workflows/update-internal-mirrors.yaml index 6abeecf63..e9c529466 100644 --- a/.github/workflows/update-internal-mirrors.yaml +++ b/.github/workflows/update-internal-mirrors.yaml @@ -85,3 +85,4 @@ jobs: aws_region: ${{ secrets.QA_AWS_REGION }} role_to_assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} aws_account_number: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + github_token: ${{ github.token }} diff --git a/.gitignore b/.gitignore index 4073b8808..f7d5b6c50 100644 --- a/.gitignore +++ b/.gitignore @@ -77,4 +77,8 @@ __debug* .tool-versions import_keys_test.go -tag.py \ No newline at end of file +tag.py + +# mockserver +mockserver/save.json +tag.py diff --git a/.golangci.yaml b/.golangci.yaml index cb0b39df7..01f2b0b67 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,9 +1,8 @@ run: - concurrency: 4 timeout: 5m + allow-parallel-runners: true linters: enable: - # defaults - errcheck - gosimple - govet @@ -24,12 +23,12 @@ linters-settings: exhaustive: default-signifies-exhaustive: true goimports: - local-prefixes: github.com/smartcontractkit/chainlink-testing-framework/lib + local-prefixes: github.com/smartcontractkit/chainlink-testing-framework gosec: exclude-generated: true govet: - # report about shadowed variables - check-shadowing: false + disable: + - shadow errorlint: # Allow formatting of errors without %w errorf: false diff --git a/framework/examples/myproject/go.mod b/framework/examples/myproject/go.mod index 2eb75fa25..6de55acf1 100644 --- a/framework/examples/myproject/go.mod +++ b/framework/examples/myproject/go.mod @@ -249,15 +249,15 @@ require ( go.uber.org/zap v1.27.0 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.11.0 // indirect - golang.org/x/crypto v0.29.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.24.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/term v0.26.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.7.0 // indirect golang.org/x/tools v0.26.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/framework/examples/myproject/go.sum b/framework/examples/myproject/go.sum index d8c1843d1..d5ba88e49 100644 --- a/framework/examples/myproject/go.sum +++ b/framework/examples/myproject/go.sum @@ -1002,8 +1002,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1103,8 +1103,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1173,14 +1173,14 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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= @@ -1192,8 +1192,8 @@ 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.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/framework/examples/myproject_cll/go.mod b/framework/examples/myproject_cll/go.mod index 6626810bf..a87cba612 100644 --- a/framework/examples/myproject_cll/go.mod +++ b/framework/examples/myproject_cll/go.mod @@ -111,12 +111,12 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect - golang.org/x/crypto v0.29.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.7.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/framework/examples/myproject_cll/go.sum b/framework/examples/myproject_cll/go.sum index 20e4b648e..c318b1be7 100644 --- a/framework/examples/myproject_cll/go.sum +++ b/framework/examples/myproject_cll/go.sum @@ -315,8 +315,8 @@ go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -330,8 +330,8 @@ golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -346,14 +346,14 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/framework/go.mod b/framework/go.mod index 3b5777443..648fdf35d 100644 --- a/framework/go.mod +++ b/framework/go.mod @@ -24,7 +24,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/testcontainers/testcontainers-go v0.34.0 github.com/urfave/cli/v2 v2.27.5 - golang.org/x/sync v0.8.0 + golang.org/x/sync v0.10.0 gopkg.in/guregu/null.v4 v4.0.0 ) @@ -141,11 +141,11 @@ require ( go.opentelemetry.io/otel/sdk v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect golang.org/x/arch v0.11.0 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/text v0.19.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/protobuf v1.35.1 // indirect diff --git a/framework/go.sum b/framework/go.sum index d731bf8be..0ed90e3bf 100644 --- a/framework/go.sum +++ b/framework/go.sum @@ -412,8 +412,8 @@ golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= @@ -439,8 +439,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -460,15 +460,15 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= -golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/k8s-test-runner/go.mod b/k8s-test-runner/go.mod index b0912a03f..211b1979c 100644 --- a/k8s-test-runner/go.mod +++ b/k8s-test-runner/go.mod @@ -60,11 +60,11 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/x448/float16 v0.8.4 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/term v0.25.0 // indirect - golang.org/x/text v0.19.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/k8s-test-runner/go.sum b/k8s-test-runner/go.sum index 423543550..ee88091fa 100644 --- a/k8s-test-runner/go.sum +++ b/k8s-test-runner/go.sum @@ -152,8 +152,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -173,14 +173,14 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= -golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/lib/docker/docker.go b/lib/docker/docker.go index bc728deaa..dc6381e21 100644 --- a/lib/docker/docker.go +++ b/lib/docker/docker.go @@ -1,53 +1,27 @@ package docker import ( - "fmt" + "context" "strings" - "github.com/google/uuid" "github.com/rs/zerolog" tc "github.com/testcontainers/testcontainers-go" + tc_network "github.com/testcontainers/testcontainers-go/network" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" ) const RetryAttempts = 3 -const defaultRyukImage = "testcontainers/ryuk:0.5.1" // CreateNetwork initializes a new Docker network with a unique name. // It ensures no duplicate networks exist and returns the created network or an error if the operation fails. func CreateNetwork(l zerolog.Logger) (*tc.DockerNetwork, error) { - uuidObj, _ := uuid.NewRandom() - var networkName = fmt.Sprintf("network-%s", uuidObj.String()) - ryukImage := mirror.AddMirrorToImageIfSet(defaultRyukImage) - // currently there's no way to use custom Ryuk image with testcontainers-go v0.28.0 :/ - // but we can go around it, by setting TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX env var to - // our custom registry and then using the default Ryuk image - //nolint:staticcheck - reaperCO := tc.WithImageName(ryukImage) - f := false - //nolint:staticcheck - network, err := tc.GenericNetwork(testcontext.Get(nil), tc.GenericNetworkRequest{ - //nolint:staticcheck - NetworkRequest: tc.NetworkRequest{ - Name: networkName, - CheckDuplicate: true, - EnableIPv6: &f, // disabling due to https://github.com/moby/moby/issues/42442 - ReaperOptions: []tc.ContainerOption{ - reaperCO, - }, - }, - }) + network, err := tc_network.New(context.Background()) if err != nil { return nil, err } - dockerNetwork, ok := network.(*tc.DockerNetwork) - if !ok { - return nil, fmt.Errorf("failed to cast network to *dockertest.Network") - } - l.Trace().Any("network", dockerNetwork).Msgf("created network") - return dockerNetwork, nil + l.Trace().Str("Name", network.Name).Msg("Created network") + return network, nil } type StartContainerRetrier func(l zerolog.Logger, startErr error, req tc.GenericContainerRequest) (tc.Container, error) diff --git a/lib/docker/test_env/besu_eth1.go b/lib/docker/test_env/besu_eth1.go index 7c4f4acdf..a90ec9b71 100644 --- a/lib/docker/test_env/besu_eth1.go +++ b/lib/docker/test_env/besu_eth1.go @@ -17,7 +17,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/templates" ) @@ -46,9 +45,6 @@ func NewBesuEth1(networks []string, chainConfig *config.EthereumChainConfig, opt g.EnvComponent.ContainerName = fmt.Sprintf("%s-%s-%s", "besu-eth1", strings.Replace(g.ContainerVersion, ".", "_", -1), uuid.NewString()[0:8]) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) - return g, nil } diff --git a/lib/docker/test_env/besu_eth2.go b/lib/docker/test_env/besu_eth2.go index 5338a29d1..4719dcc2f 100644 --- a/lib/docker/test_env/besu_eth2.go +++ b/lib/docker/test_env/besu_eth2.go @@ -20,7 +20,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" docker_utils "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/docker" ) @@ -50,8 +49,6 @@ func NewBesuEth2(networks []string, chainConfig *config.EthereumChainConfig, gen // set the container name again after applying functional options as version might have changed g.EnvComponent.ContainerName = fmt.Sprintf("%s-%s-%s", "besu-eth2", strings.Replace(g.ContainerVersion, ".", "_", -1), uuid.NewString()[0:8]) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/erigon_eth1.go b/lib/docker/test_env/erigon_eth1.go index 316aeaf3a..e0cc009bf 100644 --- a/lib/docker/test_env/erigon_eth1.go +++ b/lib/docker/test_env/erigon_eth1.go @@ -18,7 +18,6 @@ import ( config_types "github.com/smartcontractkit/chainlink-testing-framework/lib/config/types" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/templates" ) @@ -46,8 +45,6 @@ func NewErigonEth1(networks []string, chainConfig *config.EthereumChainConfig, o // set the container name again after applying functional options as version might have changed g.EnvComponent.ContainerName = fmt.Sprintf("%s-%s-%s", "erigon-eth1", strings.Replace(g.ContainerVersion, ".", "_", -1), uuid.NewString()[0:8]) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/erigon_eth2.go b/lib/docker/test_env/erigon_eth2.go index 1b34d86ec..9909a4b04 100644 --- a/lib/docker/test_env/erigon_eth2.go +++ b/lib/docker/test_env/erigon_eth2.go @@ -18,7 +18,6 @@ import ( config_types "github.com/smartcontractkit/chainlink-testing-framework/lib/config/types" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" ) // NewErigonEth2 starts a new Erigon Eth2 node running in Docker @@ -47,8 +46,6 @@ func NewErigonEth2(networks []string, chainConfig *config.EthereumChainConfig, g // set the container name again after applying functional options as version might have changed g.EnvComponent.ContainerName = fmt.Sprintf("%s-%s-%s", "erigon-eth2", strings.Replace(g.ContainerVersion, ".", "_", -1), uuid.NewString()[0:8]) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/genesis_generator.go b/lib/docker/test_env/genesis_generator.go index c0067451f..bec99fc7c 100644 --- a/lib/docker/test_env/genesis_generator.go +++ b/lib/docker/test_env/genesis_generator.go @@ -19,7 +19,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/docker" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" ) var generatorForkToImageMap = map[ethereum.Fork]string{ @@ -72,8 +71,6 @@ func NewEthGenesisGenerator(chainConfig config.EthereumChainConfig, generatedDat for _, opt := range opts { opt(&g.EnvComponent) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/geth_eth1.go b/lib/docker/test_env/geth_eth1.go index 8c3429f06..2b477bc6c 100644 --- a/lib/docker/test_env/geth_eth1.go +++ b/lib/docker/test_env/geth_eth1.go @@ -18,7 +18,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/templates" ) @@ -46,8 +45,6 @@ func NewGethEth1(networks []string, chainConfig *config.EthereumChainConfig, opt // set the container name again after applying functional options as version might have changed g.EnvComponent.ContainerName = fmt.Sprintf("%s-%s-%s", "geth-eth1", strings.Replace(g.ContainerVersion, ".", "_", -1), uuid.NewString()[0:8]) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g } diff --git a/lib/docker/test_env/geth_eth2.go b/lib/docker/test_env/geth_eth2.go index e818d2b50..32abc14d0 100644 --- a/lib/docker/test_env/geth_eth2.go +++ b/lib/docker/test_env/geth_eth2.go @@ -19,7 +19,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" ) // NewGethEth2 starts a new Geth Eth2 node running in Docker @@ -48,8 +47,6 @@ func NewGethEth2(networks []string, chainConfig *config.EthereumChainConfig, gen // set the container name again after applying functional options as version might have changed g.EnvComponent.ContainerName = fmt.Sprintf("%s-%s-%s", "geth-eth2", strings.Replace(g.ContainerVersion, ".", "_", -1), uuid.NewString()[0:8]) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/kafka.go b/lib/docker/test_env/kafka.go index f0014d274..a3912137b 100644 --- a/lib/docker/test_env/kafka.go +++ b/lib/docker/test_env/kafka.go @@ -17,7 +17,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/docker" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" ) @@ -182,10 +181,9 @@ func (k *Kafka) CreateLocalTopics() error { } func (k *Kafka) getContainerRequest() (tc.ContainerRequest, error) { - kafkaImage := mirror.AddMirrorToImageIfSet(defaultKafkaImage) return tc.ContainerRequest{ Name: k.ContainerName, - Image: kafkaImage, + Image: defaultKafkaImage, ExposedPorts: []string{"29092/tcp"}, Env: k.EnvVars, Networks: k.Networks, diff --git a/lib/docker/test_env/killgrave.go b/lib/docker/test_env/killgrave.go index 7dbbc620a..9c05d738d 100644 --- a/lib/docker/test_env/killgrave.go +++ b/lib/docker/test_env/killgrave.go @@ -154,7 +154,6 @@ func (k *Killgrave) StartContainer() error { } func (k *Killgrave) getContainerRequest() (tc.ContainerRequest, error) { - // TT-1290 Temporary work around using fork of killgrave, uncomment line below when fork is merged // killgraveImage := mirror.AddMirrorToImageIfSet(defaultKillgraveImage) // TT-1290 Temporary code to set image to the fork or the ecr mirror depending on the config killgraveImage := "tateexon/killgrave:v0.5.1-request-dump" diff --git a/lib/docker/test_env/mockserver.go b/lib/docker/test_env/mockserver.go index c498f8468..9b8b27277 100644 --- a/lib/docker/test_env/mockserver.go +++ b/lib/docker/test_env/mockserver.go @@ -16,7 +16,6 @@ import ( ctfClient "github.com/smartcontractkit/chainlink-testing-framework/lib/client" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" ) @@ -121,11 +120,9 @@ func (ms *MockServer) StartContainer() error { } func (ms *MockServer) getContainerRequest() (tc.ContainerRequest, error) { - msImage := mirror.AddMirrorToImageIfSet(defaultMockServerImage) - return tc.ContainerRequest{ Name: ms.ContainerName, - Image: msImage, + Image: defaultMockServerImage, ExposedPorts: []string{"1080/tcp"}, Env: map[string]string{ "SERVER_PORT": "1080", diff --git a/lib/docker/test_env/nethermind_eth1.go b/lib/docker/test_env/nethermind_eth1.go index 15c0d2d11..5dfee42ae 100644 --- a/lib/docker/test_env/nethermind_eth1.go +++ b/lib/docker/test_env/nethermind_eth1.go @@ -18,7 +18,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/templates" ) @@ -46,8 +45,6 @@ func NewNethermindEth1(networks []string, chainConfig *config.EthereumChainConfi // set the container name again after applying functional options as version might have changed g.EnvComponent.ContainerName = fmt.Sprintf("%s-%s-%s", "nethermind-eth1", strings.Replace(g.ContainerVersion, ".", "_", -1), uuid.NewString()[0:8]) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/nethermind_eth2.go b/lib/docker/test_env/nethermind_eth2.go index e943baa6d..d2e2f22ae 100644 --- a/lib/docker/test_env/nethermind_eth2.go +++ b/lib/docker/test_env/nethermind_eth2.go @@ -17,7 +17,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" ) // NewNethermindEth2 starts a new Nethermin Eth2 node running in Docker @@ -46,8 +45,6 @@ func NewNethermindEth2(networks []string, chainConfig *config.EthereumChainConfi // set the container name again after applying functional options as version might have changed g.EnvComponent.ContainerName = fmt.Sprintf("%s-%s-%s", "nethermind-eth2", strings.Replace(g.ContainerVersion, ".", "_", -1), uuid.NewString()[0:8]) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/postgres.go b/lib/docker/test_env/postgres.go index 7497cccdb..5a8297f54 100644 --- a/lib/docker/test_env/postgres.go +++ b/lib/docker/test_env/postgres.go @@ -21,7 +21,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/docker" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" ) @@ -116,9 +115,6 @@ func NewPostgresDb(networks []string, opts ...PostgresDbOption) (*PostgresDb, er opt(pg) } - // if the internal docker repo is set then add it to the version - pg.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(pg.EnvComponent.ContainerImage) - // Set default container envs pg.ContainerEnvs["POSTGRES_USER"] = pg.User pg.ContainerEnvs["POSTGRES_DB"] = pg.DbName diff --git a/lib/docker/test_env/prysm.go b/lib/docker/test_env/prysm.go index 2d7fd9686..a28f34902 100644 --- a/lib/docker/test_env/prysm.go +++ b/lib/docker/test_env/prysm.go @@ -17,7 +17,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/docker" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" ) @@ -74,8 +73,6 @@ func NewPrysmBeaconChain(networks []string, chainConfig *config.EthereumChainCon for _, opt := range opts { opt(&g.EnvComponent) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } @@ -219,8 +216,6 @@ func NewPrysmValidator(networks []string, chainConfig *config.EthereumChainConfi for _, opt := range opts { opt(&g.EnvComponent) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/reth_eth2.go b/lib/docker/test_env/reth_eth2.go index 2eac37f72..580dccff2 100644 --- a/lib/docker/test_env/reth_eth2.go +++ b/lib/docker/test_env/reth_eth2.go @@ -19,7 +19,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/ethereum" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" ) // NewRethEth2 starts a new Reth Eth2 node running in Docker @@ -49,8 +48,6 @@ func NewRethEth2(networks []string, chainConfig *config.EthereumChainConfig, gen // set the container name again after applying functional options as version might have changed g.EnvComponent.ContainerName = fmt.Sprintf("%s-%s-%s", "reth-eth2", strings.Replace(g.ContainerVersion, ".", "_", -1), uuid.NewString()[0:8]) } - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/schema_registry.go b/lib/docker/test_env/schema_registry.go index fd7e5ce1e..ee4f0cfef 100644 --- a/lib/docker/test_env/schema_registry.go +++ b/lib/docker/test_env/schema_registry.go @@ -12,7 +12,6 @@ import ( tcwait "github.com/testcontainers/testcontainers-go/wait" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" ) @@ -127,10 +126,9 @@ func (r *SchemaRegistry) StartContainer() error { } func (r *SchemaRegistry) getContainerRequest() (tc.ContainerRequest, error) { - schemaImage := mirror.AddMirrorToImageIfSet(defaultSchemaRegistryImage) return tc.ContainerRequest{ Name: r.ContainerName, - Image: schemaImage, + Image: defaultSchemaRegistryImage, ExposedPorts: []string{"8081/tcp"}, Env: r.EnvVars, Networks: r.Networks, diff --git a/lib/docker/test_env/validator_keys_generator.go b/lib/docker/test_env/validator_keys_generator.go index cfbbdc378..0c21141dc 100644 --- a/lib/docker/test_env/validator_keys_generator.go +++ b/lib/docker/test_env/validator_keys_generator.go @@ -16,7 +16,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/docker" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" ) const defaultEth2ValToolsImage = "protolambda/eth2-val-tools:latest" @@ -50,9 +49,6 @@ func NewValKeysGeneretor(chainConfig *config.EthereumChainConfig, valKeysHostDat for _, opt := range opts { opt(&g.EnvComponent) } - - // if the internal docker repo is set then add it to the version - g.EnvComponent.ContainerImage = mirror.AddMirrorToImageIfSet(g.EnvComponent.ContainerImage) return g, nil } diff --git a/lib/docker/test_env/zookeeper.go b/lib/docker/test_env/zookeeper.go index 353083803..ee30aa7e5 100644 --- a/lib/docker/test_env/zookeeper.go +++ b/lib/docker/test_env/zookeeper.go @@ -12,7 +12,6 @@ import ( tcwait "github.com/testcontainers/testcontainers-go/wait" "github.com/smartcontractkit/chainlink-testing-framework/lib/logging" - "github.com/smartcontractkit/chainlink-testing-framework/lib/mirror" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" ) @@ -91,10 +90,9 @@ func (z *Zookeeper) StartContainer() error { } func (z *Zookeeper) getContainerRequest() (tc.ContainerRequest, error) { - zookeeperImage := mirror.AddMirrorToImageIfSet(defaultZookeeperImage) return tc.ContainerRequest{ Name: z.ContainerName, - Image: zookeeperImage, + Image: defaultZookeeperImage, ExposedPorts: []string{"2181/tcp"}, Env: map[string]string{ "ZOOKEEPER_CLIENT_PORT": "2181", diff --git a/lib/go.mod b/lib/go.mod index 4396285ce..836861b2c 100644 --- a/lib/go.mod +++ b/lib/go.mod @@ -41,8 +41,8 @@ require ( go.uber.org/zap v1.27.0 golang.org/x/net v0.30.0 golang.org/x/oauth2 v0.23.0 - golang.org/x/sync v0.8.0 - golang.org/x/text v0.19.0 + golang.org/x/sync v0.10.0 + golang.org/x/text v0.21.0 k8s.io/api v0.31.2 k8s.io/apimachinery v0.31.2 k8s.io/cli-runtime v0.31.2 @@ -192,10 +192,10 @@ require ( go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/term v0.25.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect golang.org/x/time v0.6.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/lib/go.sum b/lib/go.sum index 5231cb070..27db6f9c6 100644 --- a/lib/go.sum +++ b/lib/go.sum @@ -545,8 +545,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= @@ -580,8 +580,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -611,20 +611,20 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= -golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/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.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/lib/k8s/config/overrides.go b/lib/k8s/config/overrides.go index c952cca63..f98e2fee0 100644 --- a/lib/k8s/config/overrides.go +++ b/lib/k8s/config/overrides.go @@ -98,7 +98,8 @@ const ( EnvVarRemoteRunnerMemUserDescription = "The mem limit and req for the remote runner" EnvVarRemoteRunnerMemExample = "1024Mi" - EnvVarInternalDockerRepo = "INTERNAL_DOCKER_REPO" + // https://golang.testcontainers.org/features/image_name_substitution/#automatically-modifying-docker-hub-image-names + EnvVarInternalDockerRepo = "TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX" EnvVarInternalDockerRepoDescription = "Use internal docker repository for some images" EnvVarInternalDockerRepoExample = "public.ecr.aws" diff --git a/lib/k8s/environment/runner.go b/lib/k8s/environment/runner.go index 8168ce93b..0cbb51c4a 100644 --- a/lib/k8s/environment/runner.go +++ b/lib/k8s/environment/runner.go @@ -431,9 +431,9 @@ func jobEnvVars(props *Props) *[]*k8s.EnvVar { config.EnvVarTeam, config.EnvVarNodeSelector, config.EnvVarDBURL, - config.EnvVarInternalDockerRepo, config.EnvVarLocalCharts, config.EnvBase64ConfigOverride, + "TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX", } for _, k := range lookups { v, success := os.LookupEnv(k) diff --git a/lib/mirror/mirror.go b/lib/mirror/mirror.go deleted file mode 100644 index 08c6aaa62..000000000 --- a/lib/mirror/mirror.go +++ /dev/null @@ -1,18 +0,0 @@ -package mirror - -import ( - "fmt" - "os" - "strings" - - "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config" -) - -// AddMirrorToImageIfSet adds the internal docker repo to the image name if it is not already present. -func AddMirrorToImageIfSet(name string) string { - ecr := os.Getenv(config.EnvVarInternalDockerRepo) - if ecr != "" && !strings.HasPrefix(name, ecr) { - name = fmt.Sprintf("%s/%s", ecr, name) - } - return name -} diff --git a/parrotserver/.dockerignore b/parrotserver/.dockerignore new file mode 100644 index 000000000..df880760e --- /dev/null +++ b/parrotserver/.dockerignore @@ -0,0 +1,13 @@ +Dockerfile +*.md +*.log +.gitignore +.golangci-lint.yml +.goreleaser.yml +.pre-commit-config.yaml +*_test.go +LICENSE +.vscode/ +dist/ +.github/ +save.json diff --git a/parrotserver/.goreleaser.yaml b/parrotserver/.goreleaser.yaml new file mode 100644 index 000000000..36e31d36d --- /dev/null +++ b/parrotserver/.goreleaser.yaml @@ -0,0 +1,58 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json +version: 1 +project_name: parrotserver + +monorepo: + tag_prefix: parrotserver/ + dir: parrotserver + +env: + - IMG_PRE={{ if index .Env "IMAGE_PREFIX" }}{{ .Env.IMAGE_PREFIX }}{{ else }}local{{ end }} + - TAG={{ if index .Env "IMAGE_TAG" }}{{ .Env.IMAGE_TAG }}{{ else }}latest{{ end }} + +# Build settings for binaries +builds: + - id: parrotserver + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + ldflags: + - '-s -w' + +archives: + - format: binary + +dockers: + - id: linux-amd64-parrotserver + goos: linux + goarch: amd64 + image_templates: + - '{{ .Env.IMG_PRE }}/parrotserver:{{ .Tag }}' + - '{{ .Env.IMG_PRE }}/parrotserver:latest' + build_flag_templates: + - --platform=linux/amd64 + - --pull + - --label=org.opencontainers.image.created={{.Date}} + - --label=org.opencontainers.image.title={{.ProjectName}} + - --label=org.opencontainers.image.revision={{.FullCommit}} + - --label=org.opencontainers.image.version={{.Version}} + - id: linux-arm64-parrotserver + goos: linux + goarch: arm64 + image_templates: + - '{{ .Env.IMG_PRE }}/parrotserver:{{ .Tag }}-arm64' + - '{{ .Env.IMG_PRE }}/parrotserver:latest-arm64' + build_flag_templates: + - --platform=linux/arm64 + - --pull + - --label=org.opencontainers.image.created={{.Date}} + - --label=org.opencontainers.image.title={{.ProjectName}} + - --label=org.opencontainers.image.revision={{.FullCommit}} + - --label=org.opencontainers.image.version={{.Version}} + +before: + hooks: + - cd parrotserver && go mod tidy diff --git a/parrotserver/Dockerfile b/parrotserver/Dockerfile new file mode 100644 index 000000000..291b4e171 --- /dev/null +++ b/parrotserver/Dockerfile @@ -0,0 +1,3 @@ +FROM scratch +COPY parrotserver /parrotserver +ENTRYPOINT [ "parrotserver" ] diff --git a/parrotserver/Makefile b/parrotserver/Makefile new file mode 100644 index 000000000..8a21b0571 --- /dev/null +++ b/parrotserver/Makefile @@ -0,0 +1,6 @@ +lint: + golangci-lint --color=always run ./... --fix -v + +.PHONY: test_unit +test_unit: + go test ./... \ No newline at end of file diff --git a/parrotserver/README.md b/parrotserver/README.md new file mode 100644 index 000000000..df1eba04f --- /dev/null +++ b/parrotserver/README.md @@ -0,0 +1,92 @@ +# Parrot Server + +A simple, high-performing mockserver that can dynamically build new routes with customized responses, parroting back whatever you tell it to. + +## Use + +Call the `/register` endpoint to define a route. + +### Curl + +```sh +curl -X POST http://localhost:8080/register -d '{ + "method": "GET", + "path": "/hello", + "response": "{\"message\": \"Hello, world!\"}", + "status_code": 200, + "content_type": "application/json" +}' -H "Content-Type: application/json" +``` + +### Go and [Resty](https://github.com/go-resty/resty) + +```go +client := resty.New() + +route := map[string]interface{}{ + "method": "GET", + "path": "/hello", + "response": "{\"message\":\"Hello, world!\"}", + "status_code": 200, + "content_type": "application/json", +} + +resp, _ := client.R(). + SetHeader("Content-Type", "application/json"). + SetBody(route). + Post("http://localhost:8080/register") +``` + +You can now call your endpoint and receive the JSON response back. + +```sh +curl -X GET http://localhost:8080/hello -H "Content-Type: application/json" +# {"message":"Hello, world!"} +``` + +## Configure + +Config is through environment variables. + +| **Environment Variable** | **Description** | **Default Value** | +| ------------------------ | -------------------------------------------------------------- | ----------------- | +| `LOG_LEVEL` | Controls the logging level (`debug`, `info`, `warn`, `error`). | `debug` | +| `SAVE_FILE` | Path to the file where routes are saved and loaded. | `save.json` | + +## Run + +```sh +go run . +``` + +## Test + +```sh +go test -cover -race ./... +``` + +## Benchmark + +```sh +LOG_LEVEL=disabled go test -bench=. -benchmem -run=^$ +``` + +Benchmark run on an Apple M3 Max. + +```sh +goos: darwin +goarch: arm64 +pkg: github.com/smartcontractkit/chainlink-testing-framework/parrotserver +BenchmarkRegisterRoute-14 604978 1967 ns/op 6263 B/op 29 allocs/op +BenchmarkRouteResponse-14 16561670 70.62 ns/op 80 B/op 1 allocs/op +BenchmarkSaveRoutes-14 1245 956784 ns/op 636042 B/op 2014 allocs/op +BenchmarkLoadRoutes-14 1020 1185990 ns/op 348919 B/op 9020 allocs/op +``` + +## Contribute + +[Pre-commit](https://pre-commit.com/) is recommended to run checks before committing or pushing. + +```sh +pre-commit install +``` diff --git a/parrotserver/config.go b/parrotserver/config.go new file mode 100644 index 000000000..ceec45464 --- /dev/null +++ b/parrotserver/config.go @@ -0,0 +1,31 @@ +package main + +import ( + "os" + + "github.com/rs/zerolog/log" +) + +type Config struct { + SaveFile string `json:"save_file"` + LogLevel string `json:"log_level"` +} + +func readConfig() *Config { + saveFile := os.Getenv("SAVE_FILE") + if saveFile == "" { + log.Warn().Msg("SAVE_FILE is not set. Using default file 'save.json'") + saveFile = "save.json" + } + + logLevel := os.Getenv("LOG_LEVEL") + if logLevel == "" { + log.Warn().Msg("LOG_LEVEL is not set. Using default level 'debug'") + logLevel = "debug" + } + log.Info().Str("SaveFile", saveFile).Str("LogLevel", logLevel).Msg("Loaded config") + return &Config{ + SaveFile: saveFile, + LogLevel: logLevel, + } +} diff --git a/parrotserver/config_test.go b/parrotserver/config_test.go new file mode 100644 index 000000000..716977584 --- /dev/null +++ b/parrotserver/config_test.go @@ -0,0 +1,22 @@ +package main + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestConfig(t *testing.T) { + t.Setenv("SAVE_FILE", "kendrick.json") + t.Setenv("LOG_LEVEL", "butterfly") + + config := readConfig() + assert.Equal(t, "kendrick.json", config.SaveFile) + assert.Equal(t, "butterfly", config.LogLevel) +} + +func TestConfigDefaults(t *testing.T) { + config := readConfig() + assert.Equal(t, "save.json", config.SaveFile) + assert.Equal(t, "debug", config.LogLevel) +} diff --git a/parrotserver/go.mod b/parrotserver/go.mod new file mode 100644 index 000000000..c7e08a806 --- /dev/null +++ b/parrotserver/go.mod @@ -0,0 +1,17 @@ +module github.com/smartcontractkit/parrotserver + +go 1.23.4 + +require ( + github.com/rs/zerolog v1.33.0 + github.com/stretchr/testify v1.9.0 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/sys v0.12.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/parrotserver/go.sum b/parrotserver/go.sum new file mode 100644 index 000000000..dc4f49555 --- /dev/null +++ b/parrotserver/go.sum @@ -0,0 +1,25 @@ +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/parrotserver/main.go b/parrotserver/main.go new file mode 100644 index 000000000..4c9648374 --- /dev/null +++ b/parrotserver/main.go @@ -0,0 +1,62 @@ +package main + +import ( + "fmt" + "net/http" + "os" + "time" + + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" +) + +var config *Config + +func init() { + zerolog.TimeFieldFormat = time.RFC3339Nano + log.Logger = log.Output(zerolog.ConsoleWriter{ + Out: os.Stderr, + TimeFormat: "15:04:05.00", // hh:mm:ss.ss format + }) + config = readConfig() + level := zerolog.DebugLevel + if config.LogLevel != "" { + l, err := zerolog.ParseLevel(config.LogLevel) + if err != nil { + fmt.Printf("Invalid log level '%s'\n", config.LogLevel) + os.Exit(1) + } + level = l + } + log.Logger = log.Logger.Level(level).With().Timestamp().Logger() +} + +func start() int { + defer func() { + if err := save(); err != nil { + log.Error().Err(err).Msg("Failed to save configuration") + } + }() + + http.HandleFunc("/register", registerRouteHandler) + http.HandleFunc("/", dynamicHandler) + + server := &http.Server{ + Addr: ":8080", + Handler: nil, + ReadTimeout: 5 * time.Second, + WriteTimeout: 10 * time.Second, + IdleTimeout: 15 * time.Second, + } + + log.Info().Int("port", 8080).Interface("config", config).Msg("Parrot server started") + if err := server.ListenAndServe(); err != nil { + log.Error().Err(err).Msg("Server stopped") + return 1 + } + return 0 +} + +func main() { + os.Exit(start()) +} diff --git a/parrotserver/router.go b/parrotserver/router.go new file mode 100644 index 000000000..a8d079331 --- /dev/null +++ b/parrotserver/router.go @@ -0,0 +1,143 @@ +package main + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "os" + "sync" + "time" + + "github.com/rs/zerolog/log" +) + +// Route holds information about the mock route configuration +type Route struct { + // Method is the HTTP method to match + Method string `json:"method"` + // Path is the URL path to match + Path string `json:"path"` + // Response is the JSON response to return when called + Response string `json:"response"` + // StatusCode is the HTTP status code to return when called + StatusCode int `json:"status_code"` + // ContentType is the Content-Type header to use when called + ContentType string `json:"content_type"` +} + +var ( + routes = make(map[string]Route) // Store routes based on "Method:Path" keys + routesMu sync.RWMutex // Protects access to the routes map +) + +// registerRouteHandler handles the dynamic route registration. +func registerRouteHandler(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + http.Error(w, "Only POST allowed", http.StatusMethodNotAllowed) + return + } + + var route Route + if err := json.NewDecoder(r.Body).Decode(&route); err != nil { + http.Error(w, "Invalid request body", http.StatusBadRequest) + return + } + defer r.Body.Close() + + if route.Method == "" || route.Path == "" { + http.Error(w, "Method and Path are required", http.StatusBadRequest) + return + } + + routesMu.Lock() + routes[route.Method+":"+route.Path] = route + routesMu.Unlock() + + w.WriteHeader(http.StatusCreated) + log.Info().Str("Path", route.Path).Str("Method", route.Method).Msg("Route registered") +} + +// dynamicHandler handles all incoming requests and responds based on the registered routes. +func dynamicHandler(w http.ResponseWriter, r *http.Request) { + routesMu.RLock() + route, exists := routes[r.Method+":"+r.URL.Path] + routesMu.RUnlock() + + if !exists { + http.NotFound(w, r) + return + } + + w.Header().Set("Content-Type", route.ContentType) + w.WriteHeader(route.StatusCode) + _, err := io.WriteString(w, route.Response) + if err != nil { + http.Error(w, "Failed to write response", http.StatusInternalServerError) + } +} + +// load loads all registered routes from a file. +func load() error { + if _, err := os.Stat(config.SaveFile); os.IsNotExist(err) { + log.Debug().Str("Save File", config.SaveFile).Msg("No routes to load") + return nil + } + + start := time.Now() + log.Debug().Str("Save File", config.SaveFile).Msg("Loading routes") + + routesMu.Lock() + defer routesMu.Unlock() + + data, err := os.ReadFile(config.SaveFile) + if err != nil { + return fmt.Errorf("failed to read routes from file: %w", err) + } + + if err = json.Unmarshal(data, &routes); err != nil { + return fmt.Errorf("failed to unmarshal routes: %w", err) + } + + log.Debug().Str("Save File", config.SaveFile).Int("Number", len(routes)).Str("Duration", time.Since(start).String()).Msg("Routes loaded") + return nil +} + +// save saves all registered routes to a file. +func save() error { + start := time.Now() + log.Debug().Str("Save File", config.SaveFile).Msg("Saving routes") + + routesMu.Lock() + defer routesMu.Unlock() + + jsonData, err := json.MarshalIndent(routes, "", " ") + if err != nil { + return fmt.Errorf("failed to marshal routes: %w", err) + } + + if err = os.WriteFile(config.SaveFile, jsonData, 0644); err != nil { //nolint:gosec + return fmt.Errorf("failed to write routes to file: %w", err) + } + + log.Debug().Str("Save File", config.SaveFile).Str("Duration", time.Since(start).String()).Msg("Routes saved") + return nil +} + +func RegisterRoute(route Route) { + routesMu.Lock() + routes[route.Method+":"+route.Path] = route + routesMu.Unlock() +} + +func CallRoute(method, path string) (int, string, string) { + routesMu.RLock() + route, exists := routes[method+":"+path] + routesMu.RUnlock() + + if !exists { + return http.StatusNotFound, "", "" + } + + return route.StatusCode, route.ContentType, route.Response +} diff --git a/parrotserver/router_test.go b/parrotserver/router_test.go new file mode 100644 index 000000000..63100c2fc --- /dev/null +++ b/parrotserver/router_test.go @@ -0,0 +1,239 @@ +package main + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// Helper function to register a new route +func registerRoute(tb testing.TB, route Route) { + tb.Helper() + + body, _ := json.Marshal(route) + req := httptest.NewRequest(http.MethodPost, "/register", bytes.NewReader(body)) + req.Header.Set("Content-Type", "application/json") + + rec := httptest.NewRecorder() + registerRouteHandler(rec, req) + + resp := rec.Result() + tb.Cleanup(func() { + resp.Body.Close() + }) + require.Equal(tb, http.StatusCreated, resp.StatusCode) +} + +func TestRegisterRoute(t *testing.T) { + t.Parallel() + + route := Route{ + Method: "GET", + Path: "/test", + Response: "{\"message\":\"Test successful\"}", + StatusCode: 200, + ContentType: "application/json", + } + + registerRoute(t, route) +} + +func TestRegisteredRoute(t *testing.T) { + t.Parallel() + + routes := []Route{ + { + Method: "GET", + Path: "/hello", + Response: "{\"message\":\"Hello, world!\"}", + StatusCode: 200, + ContentType: "application/json", + }, + { + Method: "Post", + Path: "/goodbye", + Response: "{\"message\":\"Goodbye, world!\"}", + StatusCode: 201, + ContentType: "application/json", + }, + } + for _, r := range routes { + route := r + t.Run(route.Method+":"+route.Path, func(t *testing.T) { + t.Parallel() + + registerRoute(t, route) + + req := httptest.NewRequest(route.Method, route.Path, nil) + rec := httptest.NewRecorder() + dynamicHandler(rec, req) + resp := rec.Result() + + assert.Equal(t, resp.StatusCode, route.StatusCode) + assert.Equal(t, resp.Header.Get("Content-Type"), route.ContentType) + body, _ := io.ReadAll(resp.Body) + assert.Equal(t, string(body), route.Response) + resp.Body.Close() + }) + } +} + +func TestUnregisteredRoute(t *testing.T) { + t.Parallel() + + req := httptest.NewRequest(http.MethodGet, "/unregistered", nil) + rec := httptest.NewRecorder() + + dynamicHandler(rec, req) + resp := rec.Result() + defer resp.Body.Close() + + if resp.StatusCode != http.StatusNotFound { + t.Fatalf("expected status %d but got %d", http.StatusNotFound, resp.StatusCode) + } +} + +func TestSaveLoad(t *testing.T) { + routes := []Route{ + { + Method: "GET", + Path: "/hello", + Response: "{\"message\":\"Hello, world!\"}", + StatusCode: 200, + ContentType: "application/json", + }, + { + Method: "Post", + Path: "/goodbye", + Response: "{\"message\":\"Goodbye, world!\"}", + StatusCode: 201, + ContentType: "application/json", + }, + } + + for _, route := range routes { + registerRoute(t, route) + } + + t.Cleanup(func() { + os.Remove("save.json") + }) + + err := save() + require.NoError(t, err) + require.FileExists(t, "save.json") + + err = load() + require.NoError(t, err) + + for _, route := range routes { + req := httptest.NewRequest(route.Method, route.Path, nil) + rec := httptest.NewRecorder() + + dynamicHandler(rec, req) + resp := rec.Result() + + assert.Equal(t, resp.StatusCode, route.StatusCode) + assert.Equal(t, resp.Header.Get("Content-Type"), route.ContentType) + body, _ := io.ReadAll(resp.Body) + assert.Equal(t, string(body), route.Response) + resp.Body.Close() + } +} + +func BenchmarkRegisterRoute(b *testing.B) { + route := Route{ + Method: "GET", + Path: "/bench", + Response: "Benchmark Response", + StatusCode: 200, + ContentType: "text/plain", + } + + for i := 0; i < b.N; i++ { + body, _ := json.Marshal(route) + req := httptest.NewRequest(http.MethodPost, "/register", bytes.NewReader(body)) + rec := httptest.NewRecorder() + registerRouteHandler(rec, req) + } +} + +func BenchmarkRouteResponse(b *testing.B) { + route := Route{ + Method: "GET", + Path: "/bench", + Response: "Benchmark Response", + StatusCode: 200, + ContentType: "text/plain", + } + registerRoute(b, route) + req := httptest.NewRequest(route.Method, route.Path, nil) + rec := httptest.NewRecorder() + b.ResetTimer() + for i := 0; i < b.N; i++ { + dynamicHandler(rec, req) + } +} + +func BenchmarkSaveRoutes(b *testing.B) { + for i := 0; i < 1000; i++ { + route := Route{ + Method: "GET", + Path: fmt.Sprintf("/bench%d", i), + Response: fmt.Sprintf("{\"message\":\"Response %d\"}", i), + StatusCode: 200, + ContentType: "text/plain", + } + routes[route.Method+":"+route.Path] = route + } + + filename := "bench_routes.json" + b.Cleanup(func() { + os.Remove(filename) + }) + + b.ResetTimer() // Start measuring time + for i := 0; i < b.N; i++ { + if err := save(); err != nil { + b.Fatalf("SaveRoutes failed: %v", err) + } + } +} + +func BenchmarkLoadRoutes(b *testing.B) { + filename := "bench_routes.json" + b.Cleanup(func() { + os.Remove(filename) + }) + + benchmarkRoutes := make(map[string]Route) + for i := 0; i < 1000; i++ { + route := Route{ + Method: "GET", + Path: fmt.Sprintf("/bench%d", i), + Response: fmt.Sprintf("{\"message\":\"Response %d\"}", i), + StatusCode: 200, + ContentType: "text/plain", + } + benchmarkRoutes[route.Method+":"+route.Path] = route + } + data, _ := json.MarshalIndent(benchmarkRoutes, "", " ") + if err := os.WriteFile(filename, data, 0644); err != nil { //nolint:gosec + b.Fatalf("Failed to write benchmark file: %v", err) + } + + b.ResetTimer() // Start measuring time + for i := 0; i < b.N; i++ { + if err := load(); err != nil { + b.Fatalf("Load failed: %v", err) + } + } +} diff --git a/sentinel/go.mod b/sentinel/go.mod index 6e199f7e0..cf18a1a30 100644 --- a/sentinel/go.mod +++ b/sentinel/go.mod @@ -78,10 +78,10 @@ require ( go.opentelemetry.io/otel/sdk v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.28.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect + golang.org/x/sys v0.29.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/sentinel/go.sum b/sentinel/go.sum index 2a4d4da95..f00cd0a81 100644 --- a/sentinel/go.sum +++ b/sentinel/go.sum @@ -269,8 +269,8 @@ go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v8 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -300,14 +300,14 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= -golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/seth/examples_wasp/go.mod b/seth/examples_wasp/go.mod index cde437ae6..9e661c65c 100644 --- a/seth/examples_wasp/go.mod +++ b/seth/examples_wasp/go.mod @@ -189,15 +189,15 @@ require ( go.uber.org/zap v1.26.0 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.4.0 // indirect - golang.org/x/crypto v0.25.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/term v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/appengine v1.6.8 // indirect diff --git a/seth/examples_wasp/go.sum b/seth/examples_wasp/go.sum index 987bb6cc4..6d82a5bf3 100644 --- a/seth/examples_wasp/go.sum +++ b/seth/examples_wasp/go.sum @@ -921,8 +921,9 @@ golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4 golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1034,8 +1035,8 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1104,8 +1105,9 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= 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= @@ -1116,8 +1118,9 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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= @@ -1133,8 +1136,9 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/seth/go.mod b/seth/go.mod index 95f7c2ccc..156b49dcd 100644 --- a/seth/go.mod +++ b/seth/go.mod @@ -48,9 +48,9 @@ require ( github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect - golang.org/x/crypto v0.25.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/sys v0.22.0 // indirect + golang.org/x/sys v0.29.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/seth/go.sum b/seth/go.sum index c09ebfb0e..cd30c686d 100644 --- a/seth/go.sum +++ b/seth/go.sum @@ -182,8 +182,8 @@ go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/ratelimit v0.3.1 h1:K4qVE+byfv/B3tC+4nYWP7v/6SimcO7HzHekoMNBma0= go.uber.org/ratelimit v0.3.1/go.mod h1:6euWsTB6U/Nb3X++xEUXA8ciPJvr19Q/0h1+oDcJhRk= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= @@ -196,10 +196,10 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= diff --git a/shell.nix b/shell.nix index 5fa432a00..647b4fa15 100644 --- a/shell.nix +++ b/shell.nix @@ -1,6 +1,7 @@ { pkgs, scriptDir }: with pkgs; let + go = pkgs.go_1_23; postgresql = postgresql_15; nodejs = nodejs-18_x; nodePackages = pkgs.nodePackages.override { inherit nodejs; }; diff --git a/wasp/examples/go.mod b/wasp/examples/go.mod index 34ebcee13..6833d1e15 100644 --- a/wasp/examples/go.mod +++ b/wasp/examples/go.mod @@ -254,15 +254,15 @@ require ( go.uber.org/zap v1.27.0 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/term v0.25.0 // indirect - golang.org/x/text v0.19.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.26.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect diff --git a/wasp/examples/go.sum b/wasp/examples/go.sum index 652a9e3d4..6a1652158 100644 --- a/wasp/examples/go.sum +++ b/wasp/examples/go.sum @@ -1013,8 +1013,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1114,8 +1114,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1185,15 +1185,15 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= -golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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= @@ -1205,8 +1205,8 @@ 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.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/wasp/go.mod b/wasp/go.mod index f95da897b..2f9386a77 100644 --- a/wasp/go.mod +++ b/wasp/go.mod @@ -262,15 +262,15 @@ require ( go.uber.org/zap v1.27.0 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sync v0.8.0 - golang.org/x/sys v0.26.0 // indirect - golang.org/x/term v0.25.0 // indirect - golang.org/x/text v0.19.0 // indirect + golang.org/x/sync v0.10.0 + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.26.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect diff --git a/wasp/go.sum b/wasp/go.sum index bf6c90ec2..9c38cfbc4 100644 --- a/wasp/go.sum +++ b/wasp/go.sum @@ -1015,8 +1015,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1120,8 +1120,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1191,15 +1191,15 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= -golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= 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= @@ -1211,8 +1211,8 @@ 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.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=