From 9cf8ab7c89e40ac98bc5bae5ff88be421527d66d Mon Sep 17 00:00:00 2001 From: Ankit Karwa Date: Wed, 1 Apr 2026 11:08:24 +0530 Subject: [PATCH 01/14] Upgrading Go version from 1.24 to 1.26 --- .devcontainer/devcontainer.json | 102 ++++---- .github/workflows/adapter-code-coverage.yml | 222 +++++++++--------- .github/workflows/validate-merge.yml | 48 ++-- .github/workflows/validate.yml | 66 +++--- Dockerfile | 4 +- README.md | 2 +- adapters/adapterstest/adapter_test_util.go | 6 +- endpoints/openrtb2/amp_auction_test.go | 2 +- exchange/bidder.go | 5 +- exchange/bidder_test.go | 2 +- go.mod | 2 +- hooks/hookexecution/executor_test.go | 2 +- .../hook_raw_auction_request.go | 3 +- 13 files changed, 232 insertions(+), 234 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1e17a21f4ba..ccfed41d600 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,51 +1,51 @@ -// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.112.0/containers/go -{ - "name": "Go", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update the VARIANT arg to pick a version of Go - "VARIANT": "1.24", - // Options - "INSTALL_NODE": "false", - "NODE_VERSION": "lts/*" - } - }, - "containerEnv": { - "GOPRIVATE": "${localEnv:GOPRIVATE}", - "GOFLAGS": "-buildvcs=false", - "PBS_GDPR_DEFAULT_VALUE": "0" - }, - "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], - - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.profiles.linux": { - "bash": { - "path": "/usr/bin/bash" - } - }, - "terminal.integrated.defaultProfile.linux": "bash", - "go.toolsManagement.checkForUpdates": "off", - "go.gopath": "/go", - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "golang.Go", - "ms-azuretools.vscode-docker", - "redhat.vscode-xml", - "redhat.vscode-yaml", - "eamodio.gitlens", - ], - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [8000,8001,6060], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "mkdir ~/.ssh; ssh-keyscan github.com > ~/.ssh/known_hosts", - - // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode" -} +// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.112.0/containers/go +{ + "name": "Go", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update the VARIANT arg to pick a version of Go + "VARIANT": "1.26", + // Options + "INSTALL_NODE": "false", + "NODE_VERSION": "lts/*" + } + }, + "containerEnv": { + "GOPRIVATE": "${localEnv:GOPRIVATE}", + "GOFLAGS": "-buildvcs=false", + "PBS_GDPR_DEFAULT_VALUE": "0" + }, + "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/usr/bin/bash" + } + }, + "terminal.integrated.defaultProfile.linux": "bash", + "go.toolsManagement.checkForUpdates": "off", + "go.gopath": "/go", + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "golang.Go", + "ms-azuretools.vscode-docker", + "redhat.vscode-xml", + "redhat.vscode-yaml", + "eamodio.gitlens", + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [8000,8001,6060], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "mkdir ~/.ssh; ssh-keyscan github.com > ~/.ssh/known_hosts", + + // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" +} diff --git a/.github/workflows/adapter-code-coverage.yml b/.github/workflows/adapter-code-coverage.yml index 10dd9e89773..3917163d35e 100644 --- a/.github/workflows/adapter-code-coverage.yml +++ b/.github/workflows/adapter-code-coverage.yml @@ -1,111 +1,111 @@ -name: Adapter Code Coverage - -on: - pull_request_target: - paths: ["adapters/*/*.go"] - -permissions: - pull-requests: write - contents: write - -jobs: - run-coverage: - runs-on: ubuntu-latest - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.24.0 - - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Discover Adapter Directories - id: get_directories - uses: actions/github-script@v7 - with: - result-encoding: string - script: | - const utils = require('./.github/workflows/helpers/pull-request-utils.js') - function directoryExtractor(filepath, status) { - // extract directory name only if file is not removed and file is in adapters directory - if (status != "removed" && filepath.startsWith("adapters/") && filepath.split("/").length > 2) { - return filepath.split("/")[1] - } - return "" - } - const helper = utils.diffHelper({github, context}) - const directories = await helper.getDirectories(directoryExtractor) - // run coverage for maximum of 2 directories - return (directories.length == 0 || directories.length > 2) ? "" : JSON.stringify(directories) - - - name: Run Coverage Tests - id: run_coverage - if: steps.get_directories.outputs.result != '' - run: | - directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]') - go mod download - - # create a temporary directory to store the coverage output - temp_dir=$(mktemp -d) - touch ${temp_dir}/coverage_output.txt - - # generate coverage for adapter - cd ./adapters - for directory in $directories; do - cd $directory - coverage_profile_path="${PWD}/${directory}.out" - go test -coverprofile="${coverage_profile_path}" - go tool cover -html="${coverage_profile_path}" -o "${temp_dir}/${directory}.html" - go tool cover -func="${coverage_profile_path}" -o "${temp_dir}/${directory}.txt" - cd .. - done - echo "coverage_dir=${temp_dir}" >> $GITHUB_OUTPUT - - # remove pull request branch files - cd .. - rm -f -r ./* - - - name: Checkout Coverage Preview Branch - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: coverage-preview - repository: prebid/prebid-server - - - name: Upload Coverage Results - if: steps.run_coverage.outputs.coverage_dir != '' - id: commit_coverage - run: | - directory=.github/preview/${{ github.run_id }}_$(date +%s) - mkdir -p $directory - cp -r ${{ steps.run_coverage.outputs.coverage_dir }}/*.html ./$directory - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add $directory/* - git commit -m 'Add coverage files' - git push origin coverage-preview - echo "remote_coverage_preview_dir=${directory}" >> $GITHUB_OUTPUT - - - name: Checkout Master Branch - if: steps.get_directories.outputs.result != '' - run: git checkout master - - - name: Add Coverage Summary To Pull Request - if: steps.run_coverage.outputs.coverage_dir != '' && steps.commit_coverage.outputs.remote_coverage_preview_dir != '' - uses: actions/github-script@v7 - with: - script: | - const utils = require('./.github/workflows/helpers/pull-request-utils.js') - const helper = utils.coverageHelper({ - github, context, - headSha: '${{ github.event.pull_request.head.sha }}', - tmpCoverageDir: '${{ steps.run_coverage.outputs.coverage_dir }}', - remoteCoverageDir: '${{ steps.commit_coverage.outputs.remote_coverage_preview_dir }}' - }) - const adapterDirectories = JSON.parse('${{ steps.get_directories.outputs.result }}') - await helper.AddCoverageSummary(adapterDirectories) +name: Adapter Code Coverage + +on: + pull_request_target: + paths: ["adapters/*/*.go"] + +permissions: + pull-requests: write + contents: write + +jobs: + run-coverage: + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.26.0 + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + + - name: Discover Adapter Directories + id: get_directories + uses: actions/github-script@v7 + with: + result-encoding: string + script: | + const utils = require('./.github/workflows/helpers/pull-request-utils.js') + function directoryExtractor(filepath, status) { + // extract directory name only if file is not removed and file is in adapters directory + if (status != "removed" && filepath.startsWith("adapters/") && filepath.split("/").length > 2) { + return filepath.split("/")[1] + } + return "" + } + const helper = utils.diffHelper({github, context}) + const directories = await helper.getDirectories(directoryExtractor) + // run coverage for maximum of 2 directories + return (directories.length == 0 || directories.length > 2) ? "" : JSON.stringify(directories) + + - name: Run Coverage Tests + id: run_coverage + if: steps.get_directories.outputs.result != '' + run: | + directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]') + go mod download + + # create a temporary directory to store the coverage output + temp_dir=$(mktemp -d) + touch ${temp_dir}/coverage_output.txt + + # generate coverage for adapter + cd ./adapters + for directory in $directories; do + cd $directory + coverage_profile_path="${PWD}/${directory}.out" + go test -coverprofile="${coverage_profile_path}" + go tool cover -html="${coverage_profile_path}" -o "${temp_dir}/${directory}.html" + go tool cover -func="${coverage_profile_path}" -o "${temp_dir}/${directory}.txt" + cd .. + done + echo "coverage_dir=${temp_dir}" >> $GITHUB_OUTPUT + + # remove pull request branch files + cd .. + rm -f -r ./* + + - name: Checkout Coverage Preview Branch + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: coverage-preview + repository: prebid/prebid-server + + - name: Upload Coverage Results + if: steps.run_coverage.outputs.coverage_dir != '' + id: commit_coverage + run: | + directory=.github/preview/${{ github.run_id }}_$(date +%s) + mkdir -p $directory + cp -r ${{ steps.run_coverage.outputs.coverage_dir }}/*.html ./$directory + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add $directory/* + git commit -m 'Add coverage files' + git push origin coverage-preview + echo "remote_coverage_preview_dir=${directory}" >> $GITHUB_OUTPUT + + - name: Checkout Master Branch + if: steps.get_directories.outputs.result != '' + run: git checkout master + + - name: Add Coverage Summary To Pull Request + if: steps.run_coverage.outputs.coverage_dir != '' && steps.commit_coverage.outputs.remote_coverage_preview_dir != '' + uses: actions/github-script@v7 + with: + script: | + const utils = require('./.github/workflows/helpers/pull-request-utils.js') + const helper = utils.coverageHelper({ + github, context, + headSha: '${{ github.event.pull_request.head.sha }}', + tmpCoverageDir: '${{ steps.run_coverage.outputs.coverage_dir }}', + remoteCoverageDir: '${{ steps.commit_coverage.outputs.remote_coverage_preview_dir }}' + }) + const adapterDirectories = JSON.parse('${{ steps.get_directories.outputs.result }}') + await helper.AddCoverageSummary(adapterDirectories) diff --git a/.github/workflows/validate-merge.yml b/.github/workflows/validate-merge.yml index ca633d47465..c2a26169f14 100644 --- a/.github/workflows/validate-merge.yml +++ b/.github/workflows/validate-merge.yml @@ -1,24 +1,24 @@ -name: Validate Merge - -on: - pull_request: - branches: [master] - -jobs: - validate-merge: - runs-on: ubuntu-latest - - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.24.0 - - - name: Checkout Merged Branch - uses: actions/checkout@v4 - - - name: Validate - run: | - ./validate.sh --nofmt --cov --race 10 - env: - GO111MODULE: "on" +name: Validate Merge + +on: + pull_request: + branches: [master] + +jobs: + validate-merge: + runs-on: ubuntu-latest + + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.26.0 + + - name: Checkout Merged Branch + uses: actions/checkout@v4 + + - name: Validate + run: | + ./validate.sh --nofmt --cov --race 10 + env: + GO111MODULE: "on" diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index df71d61612a..118c6dbc521 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,33 +1,33 @@ -name: Validate - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - validate: - strategy: - matrix: - go-version: [1.23.x, 1.24.x] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} - - - name: Checkout Code - uses: actions/checkout@v4 - with: - # Resolves to empty string for push events and falls back to HEAD. - ref: ${{ github.event.pull_request.head.sha }} - - - name: Validate - run: | - ./validate.sh --nofmt --cov --race 10 - env: - GO111MODULE: "on" +name: Validate + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + validate: + strategy: + matrix: + go-version: [1.24.x, 1.26.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout Code + uses: actions/checkout@v4 + with: + # Resolves to empty string for push events and falls back to HEAD. + ref: ${{ github.event.pull_request.head.sha }} + + - name: Validate + run: | + ./validate.sh --nofmt --cov --race 10 + env: + GO111MODULE: "on" diff --git a/Dockerfile b/Dockerfile index 6c0295688bb..f6aeaf1918f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ RUN apt-get update && \ apt-get -y upgrade && \ apt-get install -y --no-install-recommends wget ca-certificates WORKDIR /tmp -RUN wget https://dl.google.com/go/go1.24.0.linux-amd64.tar.gz && \ - tar -xf go1.24.0.linux-amd64.tar.gz && \ +RUN wget https://dl.google.com/go/go1.26.0.linux-amd64.tar.gz && \ + tar -xf go1.26.0.linux-amd64.tar.gz && \ mv go /usr/local RUN mkdir -p /app/prebid-server/ WORKDIR /app/prebid-server/ diff --git a/README.md b/README.md index 0aa629ebc25..c353ffba4c2 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Ensure that you deploy the `/static` directory, as Prebid Server requires those ## Developing -Prebid Server requires [Go](https://go.dev) version 1.23 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. +Prebid Server requires [Go](https://go.dev) version 1.26 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. 1. Clone The Repository ``` bash diff --git a/adapters/adapterstest/adapter_test_util.go b/adapters/adapterstest/adapter_test_util.go index d58437b8fd8..7faecb8948f 100644 --- a/adapters/adapterstest/adapter_test_util.go +++ b/adapters/adapterstest/adapter_test_util.go @@ -45,21 +45,21 @@ func SampleBid(width *int64, height *int64, impId string, index int) openrtb2.Bi // VerifyStringValue Helper function to assert string equals. func VerifyStringValue(value string, expected string, t *testing.T) { if value != expected { - t.Fatalf(fmt.Sprintf("%s expected, got %s", expected, value)) + t.Fatalf("%s expected, got %s", expected, value) } } // VerifyIntValue Helper function to assert Int equals. func VerifyIntValue(value int, expected int, t *testing.T) { if value != expected { - t.Fatalf(fmt.Sprintf("%d expected, got %d", expected, value)) + t.Fatalf("%d expected, got %d", expected, value) } } // VerifyBoolValue Helper function to assert bool equals. func VerifyBoolValue(value bool, expected bool, t *testing.T) { if value != expected { - t.Fatalf(fmt.Sprintf("%v expected, got %v", expected, value)) + t.Fatalf("%v expected, got %v", expected, value) } } diff --git a/endpoints/openrtb2/amp_auction_test.go b/endpoints/openrtb2/amp_auction_test.go index 44aeb23da62..cb31a2b6ed6 100644 --- a/endpoints/openrtb2/amp_auction_test.go +++ b/endpoints/openrtb2/amp_auction_test.go @@ -2491,7 +2491,7 @@ func TestAmpAuctionDebugWarningsOnly(t *testing.T) { ) for _, test := range testCases { - httpReq := httptest.NewRequest("GET", fmt.Sprintf("/openrtb2/auction/amp"+test.requestURLArguments), nil) + httpReq := httptest.NewRequest("GET", "/openrtb2/auction/amp"+test.requestURLArguments, nil) test.addRequestHeaders(httpReq) recorder := httptest.NewRecorder() diff --git a/exchange/bidder.go b/exchange/bidder.go index e96fdc1a896..f5e0e9b56a0 100644 --- a/exchange/bidder.go +++ b/exchange/bidder.go @@ -616,8 +616,8 @@ func (bidder *BidderAdapter) doRequestImpl(ctx context.Context, req *adapters.Re httpResp, err := ctxhttp.Do(ctx, bidder.Client, httpReq) if err != nil { bidder.logHealthCheck(false) - if err == context.DeadlineExceeded { - err = &errortypes.Timeout{Message: err.Error()} + if errors.Is(err, context.DeadlineExceeded) { + err = &errortypes.Timeout{Message: context.DeadlineExceeded.Error()} var corebidder adapters.Bidder = bidder.Bidder // The bidder adapter normally stores an info-aware bidder (a bidder wrapper) // rather than the actual bidder. So we need to unpack that first. @@ -631,7 +631,6 @@ func (bidder *BidderAdapter) doRequestImpl(ctx context.Context, req *adapters.Re // a loop of trying to report timeouts to the timeout notifications. go bidder.doTimeoutNotification(tb, req, logger) } - } return &httpCallInfo{ request: req, diff --git a/exchange/bidder_test.go b/exchange/bidder_test.go index 3fd7f51300d..308403cdc77 100644 --- a/exchange/bidder_test.go +++ b/exchange/bidder_test.go @@ -2080,7 +2080,7 @@ func TestCallRecordAdapterConnections(t *testing.T) { // setup a mock mockMetricEngine engine and its expectation mockMetricEngine := &metrics.MetricsEngineMock{} expectedAdapterName := openrtb_ext.BidderAppnexus - compareConnWaitTime := func(dur time.Duration) bool { return dur.Nanoseconds() > 0 } + compareConnWaitTime := func(dur time.Duration) bool { return dur >= 0 } mockMetricEngine.On("RecordAdapterConnections", expectedAdapterName, false, mock.MatchedBy(compareConnWaitTime)).Once() mockMetricEngine.On("RecordOverheadTime", metrics.PreBidder, mock.Anything).Once() diff --git a/go.mod b/go.mod index ec92fd3eed3..555e095185b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/prebid/prebid-server/v4 -go 1.23.0 +go 1.26.0 require ( github.com/51Degrees/device-detection-go/v4 v4.4.35 diff --git a/hooks/hookexecution/executor_test.go b/hooks/hookexecution/executor_test.go index dd309dffa9a..e0c03df3882 100644 --- a/hooks/hookexecution/executor_test.go +++ b/hooks/hookexecution/executor_test.go @@ -391,7 +391,7 @@ func TestMetricsAreGatheredDuringHookExecution(t *testing.T) { Module: moduleReplacer.Replace(moduleName), Stage: "entrypoint", } - rTime := func(dur time.Duration) bool { return dur.Nanoseconds() > 0 } + rTime := func(dur time.Duration) bool { return dur >= 0 } plan := builder.PlanForEntrypointStage("") hooksCalledDuringStage := 0 for _, group := range plan { diff --git a/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go b/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go index 4f5580a5c75..9492b4cb089 100644 --- a/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go +++ b/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go @@ -3,7 +3,6 @@ package devicedetection import ( - "fmt" "math" "github.com/prebid/prebid-server/v4/hooks/hookexecution" @@ -37,7 +36,7 @@ func handleAuctionRequestHook(ctx hookstage.ModuleInvocationContext, deviceDetec result, err := hydrateFields(deviceInfo, rawPayload) if err != nil { - return rawPayload, hookexecution.NewFailure(fmt.Sprintf("error hydrating fields %s", err)) + return rawPayload, hookexecution.NewFailure("error hydrating fields %s", err) } return result, nil From c3da32502aef7c60f118ddc2593e2713d15831c9 Mon Sep 17 00:00:00 2001 From: Ankit Karwa Date: Wed, 1 Apr 2026 11:32:13 +0530 Subject: [PATCH 02/14] Removing 1.23.x --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 118c6dbc521..bca923db101 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,7 +10,7 @@ jobs: validate: strategy: matrix: - go-version: [1.24.x, 1.26.x] + go-version: [1.26.x] os: [ubuntu-latest] runs-on: ${{ matrix.os }} From 8869a542fd431b110ff737f4a69301ab18f6f950 Mon Sep 17 00:00:00 2001 From: Ankit Karwa Date: Wed, 1 Apr 2026 11:40:05 +0530 Subject: [PATCH 03/14] Adding explicit toolchain in go mod --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index 555e095185b..d480ff67df4 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/prebid/prebid-server/v4 go 1.26.0 +toolchain go1.26.0 + require ( github.com/51Degrees/device-detection-go/v4 v4.4.35 github.com/DATA-DOG/go-sqlmock v1.5.0 From 0e39f66feb8dab6f6330f6167f68c45dccf0a862 Mon Sep 17 00:00:00 2001 From: Ankit Karwa Date: Wed, 1 Apr 2026 11:48:13 +0530 Subject: [PATCH 04/14] Keeping min featureset version to 1.24 --- .github/workflows/validate.yml | 2 +- go.mod | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index bca923db101..118c6dbc521 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,7 +10,7 @@ jobs: validate: strategy: matrix: - go-version: [1.26.x] + go-version: [1.24.x, 1.26.x] os: [ubuntu-latest] runs-on: ${{ matrix.os }} diff --git a/go.mod b/go.mod index d480ff67df4..673a0519d15 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/prebid/prebid-server/v4 -go 1.26.0 - -toolchain go1.26.0 +go 1.24 require ( github.com/51Degrees/device-detection-go/v4 v4.4.35 From 068c6d3e25d09fe089073d4ddfde4d10c4ecd883 Mon Sep 17 00:00:00 2001 From: Ankit Karwa Date: Wed, 1 Apr 2026 11:50:10 +0530 Subject: [PATCH 05/14] Updating readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c353ffba4c2..b0285ef5d7c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Ensure that you deploy the `/static` directory, as Prebid Server requires those ## Developing -Prebid Server requires [Go](https://go.dev) version 1.26 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. +Prebid Server requires [Go](https://go.dev) version 1.24 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. 1. Clone The Repository ``` bash From f1aaf5e3c559b285e4c33fc6e6f1effb03abe7c6 Mon Sep 17 00:00:00 2001 From: Ankit Karwa Date: Wed, 1 Apr 2026 13:33:45 +0530 Subject: [PATCH 06/14] PR comments --- .github/workflows/adapter-code-coverage.yml | 2 +- .github/workflows/validate-merge.yml | 2 +- .github/workflows/validate.yml | 2 +- Dockerfile | 4 ++-- README.md | 2 +- exchange/bidder_test.go | 2 +- go.mod | 2 +- hooks/hookexecution/executor_test.go | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/adapter-code-coverage.yml b/.github/workflows/adapter-code-coverage.yml index 3917163d35e..8a5c32fd327 100644 --- a/.github/workflows/adapter-code-coverage.yml +++ b/.github/workflows/adapter-code-coverage.yml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.26.0 + go-version: 1.26.1 - name: Checkout Code uses: actions/checkout@v4 diff --git a/.github/workflows/validate-merge.yml b/.github/workflows/validate-merge.yml index c2a26169f14..1feedcbf681 100644 --- a/.github/workflows/validate-merge.yml +++ b/.github/workflows/validate-merge.yml @@ -12,7 +12,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.26.0 + go-version: 1.26.1 - name: Checkout Merged Branch uses: actions/checkout@v4 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 118c6dbc521..77a33372399 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,7 +10,7 @@ jobs: validate: strategy: matrix: - go-version: [1.24.x, 1.26.x] + go-version: [1.25.x, 1.26.x] os: [ubuntu-latest] runs-on: ${{ matrix.os }} diff --git a/Dockerfile b/Dockerfile index f6aeaf1918f..119992e5f34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ RUN apt-get update && \ apt-get -y upgrade && \ apt-get install -y --no-install-recommends wget ca-certificates WORKDIR /tmp -RUN wget https://dl.google.com/go/go1.26.0.linux-amd64.tar.gz && \ - tar -xf go1.26.0.linux-amd64.tar.gz && \ +RUN wget https://dl.google.com/go/go1.26.1.linux-amd64.tar.gz && \ + tar -xf go1.26.1.linux-amd64.tar.gz && \ mv go /usr/local RUN mkdir -p /app/prebid-server/ WORKDIR /app/prebid-server/ diff --git a/README.md b/README.md index b0285ef5d7c..06160fa7112 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Ensure that you deploy the `/static` directory, as Prebid Server requires those ## Developing -Prebid Server requires [Go](https://go.dev) version 1.24 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. +Prebid Server requires [Go](https://go.dev) version 1.25 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. 1. Clone The Repository ``` bash diff --git a/exchange/bidder_test.go b/exchange/bidder_test.go index 308403cdc77..3fd7f51300d 100644 --- a/exchange/bidder_test.go +++ b/exchange/bidder_test.go @@ -2080,7 +2080,7 @@ func TestCallRecordAdapterConnections(t *testing.T) { // setup a mock mockMetricEngine engine and its expectation mockMetricEngine := &metrics.MetricsEngineMock{} expectedAdapterName := openrtb_ext.BidderAppnexus - compareConnWaitTime := func(dur time.Duration) bool { return dur >= 0 } + compareConnWaitTime := func(dur time.Duration) bool { return dur.Nanoseconds() > 0 } mockMetricEngine.On("RecordAdapterConnections", expectedAdapterName, false, mock.MatchedBy(compareConnWaitTime)).Once() mockMetricEngine.On("RecordOverheadTime", metrics.PreBidder, mock.Anything).Once() diff --git a/go.mod b/go.mod index 673a0519d15..843178cd1f2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/prebid/prebid-server/v4 -go 1.24 +go 1.25 require ( github.com/51Degrees/device-detection-go/v4 v4.4.35 diff --git a/hooks/hookexecution/executor_test.go b/hooks/hookexecution/executor_test.go index e0c03df3882..dd309dffa9a 100644 --- a/hooks/hookexecution/executor_test.go +++ b/hooks/hookexecution/executor_test.go @@ -391,7 +391,7 @@ func TestMetricsAreGatheredDuringHookExecution(t *testing.T) { Module: moduleReplacer.Replace(moduleName), Stage: "entrypoint", } - rTime := func(dur time.Duration) bool { return dur >= 0 } + rTime := func(dur time.Duration) bool { return dur.Nanoseconds() > 0 } plan := builder.PlanForEntrypointStage("") hooksCalledDuringStage := 0 for _, group := range plan { From a91165757e35957f22dbb09a491bc6f98d60e909 Mon Sep 17 00:00:00 2001 From: Ankit Karwa Date: Tue, 7 Apr 2026 18:20:28 +0530 Subject: [PATCH 07/14] Fixing toolchain version --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index 843178cd1f2..27e6d027564 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/prebid/prebid-server/v4 go 1.25 +toolchain go1.25.0 + require ( github.com/51Degrees/device-detection-go/v4 v4.4.35 github.com/DATA-DOG/go-sqlmock v1.5.0 From b70c56b52103a5d9425cf3e5aac40144b02c1208 Mon Sep 17 00:00:00 2001 From: Ankit Karwa Date: Tue, 7 Apr 2026 20:10:27 +0530 Subject: [PATCH 08/14] Upgrading to correct version of toolchain --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 27e6d027564..ddfcdc91ad2 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/prebid/prebid-server/v4 go 1.25 -toolchain go1.25.0 +toolchain go1.25.3 require ( github.com/51Degrees/device-detection-go/v4 v4.4.35 From 8c457513388575a1712d8128c45e01b9abdc67fe Mon Sep 17 00:00:00 2001 From: Ankit Karwa Date: Tue, 7 Apr 2026 20:15:25 +0530 Subject: [PATCH 09/14] Updating files to use local go toolchain --- .github/workflows/adapter-code-coverage.yml | 2 ++ .github/workflows/validate.yml | 1 + go.mod | 2 -- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/adapter-code-coverage.yml b/.github/workflows/adapter-code-coverage.yml index 8a5c32fd327..8034aa08581 100644 --- a/.github/workflows/adapter-code-coverage.yml +++ b/.github/workflows/adapter-code-coverage.yml @@ -46,6 +46,8 @@ jobs: - name: Run Coverage Tests id: run_coverage if: steps.get_directories.outputs.result != '' + env: + GOTOOLCHAIN: local run: | directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]') go mod download diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 77a33372399..3fde95ef38b 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -31,3 +31,4 @@ jobs: ./validate.sh --nofmt --cov --race 10 env: GO111MODULE: "on" + GOTOOLCHAIN: local diff --git a/go.mod b/go.mod index ddfcdc91ad2..843178cd1f2 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/prebid/prebid-server/v4 go 1.25 -toolchain go1.25.3 - require ( github.com/51Degrees/device-detection-go/v4 v4.4.35 github.com/DATA-DOG/go-sqlmock v1.5.0 From e4b233f07d007f281027f3f76bf2599b34676e1c Mon Sep 17 00:00:00 2001 From: Anish B Date: Mon, 27 Apr 2026 10:42:41 +0530 Subject: [PATCH 10/14] Setting the env for GOTOOLCHAIN --- .github/workflows/adapter-code-coverage.yml | 2 +- .github/workflows/validate.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/adapter-code-coverage.yml b/.github/workflows/adapter-code-coverage.yml index 8034aa08581..10df833cc2e 100644 --- a/.github/workflows/adapter-code-coverage.yml +++ b/.github/workflows/adapter-code-coverage.yml @@ -47,7 +47,7 @@ jobs: id: run_coverage if: steps.get_directories.outputs.result != '' env: - GOTOOLCHAIN: local + GOTOOLCHAIN: go1.26.1+auto run: | directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]') go mod download diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 3fde95ef38b..feba04de44f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -31,4 +31,4 @@ jobs: ./validate.sh --nofmt --cov --race 10 env: GO111MODULE: "on" - GOTOOLCHAIN: local + GOTOOLCHAIN: go1.26.1+auto From 085ab2acf8db5edbad91eadcf5301c7e2192076b Mon Sep 17 00:00:00 2001 From: Anish B Date: Wed, 13 May 2026 18:04:46 +0530 Subject: [PATCH 11/14] Restore LF line endings --- .devcontainer/devcontainer.json | 102 ++++----- .github/workflows/adapter-code-coverage.yml | 226 ++++++++++---------- .github/workflows/validate-merge.yml | 48 ++--- .github/workflows/validate.yml | 68 +++--- 4 files changed, 222 insertions(+), 222 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ccfed41d600..92c421b98cf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,51 +1,51 @@ -// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.112.0/containers/go -{ - "name": "Go", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update the VARIANT arg to pick a version of Go - "VARIANT": "1.26", - // Options - "INSTALL_NODE": "false", - "NODE_VERSION": "lts/*" - } - }, - "containerEnv": { - "GOPRIVATE": "${localEnv:GOPRIVATE}", - "GOFLAGS": "-buildvcs=false", - "PBS_GDPR_DEFAULT_VALUE": "0" - }, - "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], - - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.profiles.linux": { - "bash": { - "path": "/usr/bin/bash" - } - }, - "terminal.integrated.defaultProfile.linux": "bash", - "go.toolsManagement.checkForUpdates": "off", - "go.gopath": "/go", - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "golang.Go", - "ms-azuretools.vscode-docker", - "redhat.vscode-xml", - "redhat.vscode-yaml", - "eamodio.gitlens", - ], - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [8000,8001,6060], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "mkdir ~/.ssh; ssh-keyscan github.com > ~/.ssh/known_hosts", - - // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode" -} +// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.112.0/containers/go +{ + "name": "Go", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update the VARIANT arg to pick a version of Go + "VARIANT": "1.26", + // Options + "INSTALL_NODE": "false", + "NODE_VERSION": "lts/*" + } + }, + "containerEnv": { + "GOPRIVATE": "${localEnv:GOPRIVATE}", + "GOFLAGS": "-buildvcs=false", + "PBS_GDPR_DEFAULT_VALUE": "0" + }, + "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/usr/bin/bash" + } + }, + "terminal.integrated.defaultProfile.linux": "bash", + "go.toolsManagement.checkForUpdates": "off", + "go.gopath": "/go", + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "golang.Go", + "ms-azuretools.vscode-docker", + "redhat.vscode-xml", + "redhat.vscode-yaml", + "eamodio.gitlens", + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [8000,8001,6060], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "mkdir ~/.ssh; ssh-keyscan github.com > ~/.ssh/known_hosts", + + // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" +} diff --git a/.github/workflows/adapter-code-coverage.yml b/.github/workflows/adapter-code-coverage.yml index 10df833cc2e..b268dbeafec 100644 --- a/.github/workflows/adapter-code-coverage.yml +++ b/.github/workflows/adapter-code-coverage.yml @@ -1,113 +1,113 @@ -name: Adapter Code Coverage - -on: - pull_request_target: - paths: ["adapters/*/*.go"] - -permissions: - pull-requests: write - contents: write - -jobs: - run-coverage: - runs-on: ubuntu-latest - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.26.1 - - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Discover Adapter Directories - id: get_directories - uses: actions/github-script@v7 - with: - result-encoding: string - script: | - const utils = require('./.github/workflows/helpers/pull-request-utils.js') - function directoryExtractor(filepath, status) { - // extract directory name only if file is not removed and file is in adapters directory - if (status != "removed" && filepath.startsWith("adapters/") && filepath.split("/").length > 2) { - return filepath.split("/")[1] - } - return "" - } - const helper = utils.diffHelper({github, context}) - const directories = await helper.getDirectories(directoryExtractor) - // run coverage for maximum of 2 directories - return (directories.length == 0 || directories.length > 2) ? "" : JSON.stringify(directories) - - - name: Run Coverage Tests - id: run_coverage - if: steps.get_directories.outputs.result != '' - env: - GOTOOLCHAIN: go1.26.1+auto - run: | - directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]') - go mod download - - # create a temporary directory to store the coverage output - temp_dir=$(mktemp -d) - touch ${temp_dir}/coverage_output.txt - - # generate coverage for adapter - cd ./adapters - for directory in $directories; do - cd $directory - coverage_profile_path="${PWD}/${directory}.out" - go test -coverprofile="${coverage_profile_path}" - go tool cover -html="${coverage_profile_path}" -o "${temp_dir}/${directory}.html" - go tool cover -func="${coverage_profile_path}" -o "${temp_dir}/${directory}.txt" - cd .. - done - echo "coverage_dir=${temp_dir}" >> $GITHUB_OUTPUT - - # remove pull request branch files - cd .. - rm -f -r ./* - - - name: Checkout Coverage Preview Branch - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: coverage-preview - repository: prebid/prebid-server - - - name: Upload Coverage Results - if: steps.run_coverage.outputs.coverage_dir != '' - id: commit_coverage - run: | - directory=.github/preview/${{ github.run_id }}_$(date +%s) - mkdir -p $directory - cp -r ${{ steps.run_coverage.outputs.coverage_dir }}/*.html ./$directory - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add $directory/* - git commit -m 'Add coverage files' - git push origin coverage-preview - echo "remote_coverage_preview_dir=${directory}" >> $GITHUB_OUTPUT - - - name: Checkout Master Branch - if: steps.get_directories.outputs.result != '' - run: git checkout master - - - name: Add Coverage Summary To Pull Request - if: steps.run_coverage.outputs.coverage_dir != '' && steps.commit_coverage.outputs.remote_coverage_preview_dir != '' - uses: actions/github-script@v7 - with: - script: | - const utils = require('./.github/workflows/helpers/pull-request-utils.js') - const helper = utils.coverageHelper({ - github, context, - headSha: '${{ github.event.pull_request.head.sha }}', - tmpCoverageDir: '${{ steps.run_coverage.outputs.coverage_dir }}', - remoteCoverageDir: '${{ steps.commit_coverage.outputs.remote_coverage_preview_dir }}' - }) - const adapterDirectories = JSON.parse('${{ steps.get_directories.outputs.result }}') - await helper.AddCoverageSummary(adapterDirectories) +name: Adapter Code Coverage + +on: + pull_request_target: + paths: ["adapters/*/*.go"] + +permissions: + pull-requests: write + contents: write + +jobs: + run-coverage: + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.26.1 + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + + - name: Discover Adapter Directories + id: get_directories + uses: actions/github-script@v7 + with: + result-encoding: string + script: | + const utils = require('./.github/workflows/helpers/pull-request-utils.js') + function directoryExtractor(filepath, status) { + // extract directory name only if file is not removed and file is in adapters directory + if (status != "removed" && filepath.startsWith("adapters/") && filepath.split("/").length > 2) { + return filepath.split("/")[1] + } + return "" + } + const helper = utils.diffHelper({github, context}) + const directories = await helper.getDirectories(directoryExtractor) + // run coverage for maximum of 2 directories + return (directories.length == 0 || directories.length > 2) ? "" : JSON.stringify(directories) + + - name: Run Coverage Tests + id: run_coverage + if: steps.get_directories.outputs.result != '' + env: + GOTOOLCHAIN: go1.26.1+auto + run: | + directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]') + go mod download + + # create a temporary directory to store the coverage output + temp_dir=$(mktemp -d) + touch ${temp_dir}/coverage_output.txt + + # generate coverage for adapter + cd ./adapters + for directory in $directories; do + cd $directory + coverage_profile_path="${PWD}/${directory}.out" + go test -coverprofile="${coverage_profile_path}" + go tool cover -html="${coverage_profile_path}" -o "${temp_dir}/${directory}.html" + go tool cover -func="${coverage_profile_path}" -o "${temp_dir}/${directory}.txt" + cd .. + done + echo "coverage_dir=${temp_dir}" >> $GITHUB_OUTPUT + + # remove pull request branch files + cd .. + rm -f -r ./* + + - name: Checkout Coverage Preview Branch + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: coverage-preview + repository: prebid/prebid-server + + - name: Upload Coverage Results + if: steps.run_coverage.outputs.coverage_dir != '' + id: commit_coverage + run: | + directory=.github/preview/${{ github.run_id }}_$(date +%s) + mkdir -p $directory + cp -r ${{ steps.run_coverage.outputs.coverage_dir }}/*.html ./$directory + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add $directory/* + git commit -m 'Add coverage files' + git push origin coverage-preview + echo "remote_coverage_preview_dir=${directory}" >> $GITHUB_OUTPUT + + - name: Checkout Master Branch + if: steps.get_directories.outputs.result != '' + run: git checkout master + + - name: Add Coverage Summary To Pull Request + if: steps.run_coverage.outputs.coverage_dir != '' && steps.commit_coverage.outputs.remote_coverage_preview_dir != '' + uses: actions/github-script@v7 + with: + script: | + const utils = require('./.github/workflows/helpers/pull-request-utils.js') + const helper = utils.coverageHelper({ + github, context, + headSha: '${{ github.event.pull_request.head.sha }}', + tmpCoverageDir: '${{ steps.run_coverage.outputs.coverage_dir }}', + remoteCoverageDir: '${{ steps.commit_coverage.outputs.remote_coverage_preview_dir }}' + }) + const adapterDirectories = JSON.parse('${{ steps.get_directories.outputs.result }}') + await helper.AddCoverageSummary(adapterDirectories) diff --git a/.github/workflows/validate-merge.yml b/.github/workflows/validate-merge.yml index 1feedcbf681..42be2d8e053 100644 --- a/.github/workflows/validate-merge.yml +++ b/.github/workflows/validate-merge.yml @@ -1,24 +1,24 @@ -name: Validate Merge - -on: - pull_request: - branches: [master] - -jobs: - validate-merge: - runs-on: ubuntu-latest - - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.26.1 - - - name: Checkout Merged Branch - uses: actions/checkout@v4 - - - name: Validate - run: | - ./validate.sh --nofmt --cov --race 10 - env: - GO111MODULE: "on" +name: Validate Merge + +on: + pull_request: + branches: [master] + +jobs: + validate-merge: + runs-on: ubuntu-latest + + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.26.1 + + - name: Checkout Merged Branch + uses: actions/checkout@v4 + + - name: Validate + run: | + ./validate.sh --nofmt --cov --race 10 + env: + GO111MODULE: "on" diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index feba04de44f..ba137b8b34e 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,34 +1,34 @@ -name: Validate - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - validate: - strategy: - matrix: - go-version: [1.25.x, 1.26.x] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} - - - name: Checkout Code - uses: actions/checkout@v4 - with: - # Resolves to empty string for push events and falls back to HEAD. - ref: ${{ github.event.pull_request.head.sha }} - - - name: Validate - run: | - ./validate.sh --nofmt --cov --race 10 - env: - GO111MODULE: "on" - GOTOOLCHAIN: go1.26.1+auto +name: Validate + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + validate: + strategy: + matrix: + go-version: [1.25.x, 1.26.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout Code + uses: actions/checkout@v4 + with: + # Resolves to empty string for push events and falls back to HEAD. + ref: ${{ github.event.pull_request.head.sha }} + + - name: Validate + run: | + ./validate.sh --nofmt --cov --race 10 + env: + GO111MODULE: "on" + GOTOOLCHAIN: go1.26.1+auto From e6449661053140b6f8087e9236694cae25560e3a Mon Sep 17 00:00:00 2001 From: Anish B Date: Wed, 13 May 2026 18:25:46 +0530 Subject: [PATCH 12/14] Updating GO version to 1.26.2 --- .github/workflows/adapter-code-coverage.yml | 4 ++-- .github/workflows/validate-merge.yml | 2 +- .github/workflows/validate.yml | 2 +- Dockerfile | 4 ++-- README.md | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/adapter-code-coverage.yml b/.github/workflows/adapter-code-coverage.yml index b268dbeafec..ed7aef14484 100644 --- a/.github/workflows/adapter-code-coverage.yml +++ b/.github/workflows/adapter-code-coverage.yml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.26.1 + go-version: 1.26.2 - name: Checkout Code uses: actions/checkout@v4 @@ -47,7 +47,7 @@ jobs: id: run_coverage if: steps.get_directories.outputs.result != '' env: - GOTOOLCHAIN: go1.26.1+auto + GOTOOLCHAIN: local run: | directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]') go mod download diff --git a/.github/workflows/validate-merge.yml b/.github/workflows/validate-merge.yml index 42be2d8e053..64a611f537c 100644 --- a/.github/workflows/validate-merge.yml +++ b/.github/workflows/validate-merge.yml @@ -12,7 +12,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.26.1 + go-version: 1.26.2 - name: Checkout Merged Branch uses: actions/checkout@v4 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ba137b8b34e..b8d5ea7a550 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -31,4 +31,4 @@ jobs: ./validate.sh --nofmt --cov --race 10 env: GO111MODULE: "on" - GOTOOLCHAIN: go1.26.1+auto + GOTOOLCHAIN: local diff --git a/Dockerfile b/Dockerfile index 119992e5f34..26396cdc9a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ RUN apt-get update && \ apt-get -y upgrade && \ apt-get install -y --no-install-recommends wget ca-certificates WORKDIR /tmp -RUN wget https://dl.google.com/go/go1.26.1.linux-amd64.tar.gz && \ - tar -xf go1.26.1.linux-amd64.tar.gz && \ +RUN wget https://dl.google.com/go/go1.26.2.linux-amd64.tar.gz && \ + tar -xf go1.26.2.linux-amd64.tar.gz && \ mv go /usr/local RUN mkdir -p /app/prebid-server/ WORKDIR /app/prebid-server/ diff --git a/README.md b/README.md index 06160fa7112..2323db2d09c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Ensure that you deploy the `/static` directory, as Prebid Server requires those ## Developing -Prebid Server requires [Go](https://go.dev) version 1.25 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. +Prebid Server requires [Go](https://go.dev) version 1.26.2 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. 1. Clone The Repository ``` bash From b250b86aad5267d2f1e33b0132e1b39e16149f06 Mon Sep 17 00:00:00 2001 From: Anish B Date: Wed, 13 May 2026 18:55:22 +0530 Subject: [PATCH 13/14] Revert DeadlineExceeded update --- exchange/bidder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exchange/bidder.go b/exchange/bidder.go index f5e0e9b56a0..87d3eaa719a 100644 --- a/exchange/bidder.go +++ b/exchange/bidder.go @@ -617,7 +617,7 @@ func (bidder *BidderAdapter) doRequestImpl(ctx context.Context, req *adapters.Re if err != nil { bidder.logHealthCheck(false) if errors.Is(err, context.DeadlineExceeded) { - err = &errortypes.Timeout{Message: context.DeadlineExceeded.Error()} + err = &errortypes.Timeout{Message: err.Error()} var corebidder adapters.Bidder = bidder.Bidder // The bidder adapter normally stores an info-aware bidder (a bidder wrapper) // rather than the actual bidder. So we need to unpack that first. From 454a8b2cce192ecff9fdf3a642dca37b3a8e4224 Mon Sep 17 00:00:00 2001 From: Anish B Date: Fri, 15 May 2026 18:42:19 +0530 Subject: [PATCH 14/14] Trigger CI with updated coverage workflow