fix(deps): update module golang.org/x/tools to v0.43.0 #10719
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build/Lint/Test | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - 'v*' | |
| paths-ignore: | |
| - 'README.md' | |
| - 'CHANGELOG.md' | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| paths-ignore: | |
| - 'README.md' | |
| - 'CHANGELOG.md' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| preflight: | |
| name: Preflight execution gate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| outputs: | |
| should_run: ${{ steps.decide.outputs.should_run }} | |
| steps: | |
| - id: decide | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 | |
| with: | |
| script: | | |
| if (context.eventName === 'pull_request' && context.payload.action === 'ready_for_review') { | |
| core.setOutput('should_run', 'false'); | |
| return; | |
| } | |
| if (context.eventName !== 'push') { | |
| core.setOutput('should_run', 'true'); | |
| return; | |
| } | |
| const copilotAuthorEmail = '198982749+Copilot@users.noreply.github.com'; | |
| const branch = context.ref.replace('refs/heads/', ''); | |
| const { data: pulls } = await github.rest.pulls.list({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', | |
| head: `${context.repo.owner}:${branch}`, | |
| per_page: 1, | |
| }); | |
| const commits = context.payload.commits || []; | |
| const noOpenPR = pulls.length === 0; | |
| const allCopilot = | |
| commits.length > 0 && | |
| commits.every((c) => (c.author && c.author.email) === copilotAuthorEmail); | |
| const shouldRun = noOpenPR || allCopilot; | |
| if (shouldRun) { | |
| core.info( | |
| noOpenPR | |
| ? `No open PR found for ${branch}; running workflow for push.` | |
| : `Open PR found for ${branch}, but all ${commits.length} pushed commit(s) are Copilot-authored; running workflow for push.` | |
| ); | |
| } else { | |
| core.info( | |
| `Open PR found for ${branch} and not all pushed commits are Copilot-authored; skipping push workflow execution.` | |
| ); | |
| } | |
| core.setOutput('should_run', shouldRun ? 'true' : 'false'); | |
| build: | |
| name: Build | |
| needs: preflight | |
| if: needs.preflight.outputs.should_run == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Get dependencies | |
| run: make vendor | |
| - name: Build | |
| run: make build-ci | |
| lint: | |
| name: Lint | |
| needs: preflight | |
| if: needs.preflight.outputs.should_run == 'true' | |
| runs-on: ubuntu-latest | |
| env: | |
| OPENSPEC_TELEMETRY: "0" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: "24" | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| cache-dependency-path: go.sum | |
| - uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0 | |
| with: | |
| terraform_wrapper: false | |
| - name: Lint | |
| run: make check-lint | |
| test: | |
| name: Matrix Acceptance Test | |
| needs: | |
| - preflight | |
| - build | |
| if: needs.preflight.outputs.should_run == 'true' | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| runs-on: ${{ matrix.runner == 'ubuntu-22.04' && 'ubuntu-22.04' || 'ubuntu-latest' }} | |
| env: | |
| ELASTIC_PASSWORD: password | |
| TF_ELASTICSTACK_INCLUDE_EXPERIMENTAL: true | |
| timeout-minutes: 35 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: | |
| - '8.5.3' | |
| - '8.6.2' | |
| - '8.7.1' | |
| - '8.8.2' | |
| - '8.9.2' | |
| - '8.10.3' | |
| - '8.11.4' | |
| - '8.12.2' | |
| - '8.13.4' | |
| - '8.14.3' | |
| - '8.15.5' | |
| - '8.16.6' | |
| - '8.17.1' | |
| - '8.18.8' | |
| - '8.19.9' | |
| - '9.0.8' | |
| - '9.1.9' | |
| - '9.2.3' | |
| - '9.3.0' | |
| - '9.4.0-SNAPSHOT' | |
| include: | |
| - version: '7.17.13' | |
| fleetImage: elastic/elastic-agent | |
| - version: '8.0.1' | |
| fleetImage: elastic/elastic-agent | |
| runner: 'ubuntu-22.04' | |
| - version: '8.1.3' | |
| fleetImage: elastic/elastic-agent | |
| runner: 'ubuntu-22.04' | |
| - version: '8.2.3' | |
| runner: 'ubuntu-22.04' | |
| - version: '8.3.3' | |
| runner: 'ubuntu-22.04' | |
| - version: '8.4.3' | |
| runner: 'ubuntu-22.04' | |
| steps: | |
| - name: Free up disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0 | |
| with: | |
| terraform_wrapper: false | |
| - name: Get dependencies | |
| run: make vendor | |
| - name: Start stack with docker compose | |
| run: make docker-fleet | |
| env: | |
| STACK_VERSION: ${{ matrix.version }} | |
| ELASTICSEARCH_PASSWORD: ${{ env.ELASTIC_PASSWORD }} | |
| KIBANA_PASSWORD: ${{ env.ELASTIC_PASSWORD }} | |
| FLEET_IMAGE: ${{ matrix.fleetImage || 'docker.elastic.co/elastic-agent/elastic-agent' }} | |
| - name: Wait for stack readiness | |
| run: | | |
| for i in {1..60}; do | |
| if curl -fsS -u "elastic:${ELASTIC_PASSWORD}" http://localhost:9200/_cluster/health > /dev/null; then | |
| break | |
| fi | |
| if [ "$i" -eq 60 ]; then | |
| echo "Elasticsearch did not become ready in time" | |
| exit 1 | |
| fi | |
| sleep 5 | |
| done | |
| for i in {1..60}; do | |
| if [ "$(curl -s -o /dev/null -w "%{http_code}" http://localhost:5601)" = "302" ]; then | |
| break | |
| fi | |
| if [ "$i" -eq 60 ]; then | |
| echo "Kibana did not become ready in time" | |
| exit 1 | |
| fi | |
| sleep 5 | |
| done | |
| - id: get-api-key | |
| name: Get ES API key | |
| run: |- | |
| echo "apikey=$(make create-es-api-key | jq -r .encoded)" >> "$GITHUB_OUTPUT" | |
| env: | |
| ELASTICSEARCH_PASSWORD: ${{ env.ELASTIC_PASSWORD }} | |
| - id: setup-fleet | |
| name: Setup Fleet | |
| if: matrix.version == '8.10.3' || matrix.version == '8.11.4' || matrix.version == '8.12.2' || matrix.version == '8.13.4' || matrix.version == '8.14.3' || matrix.version == '8.15.5' || matrix.version == '8.16.2' || matrix.version == '8.17.0' || matrix.version == '9.0.3' | |
| run: |- | |
| make setup-kibana-fleet | |
| env: | |
| ELASTICSEARCH_PASSWORD: ${{ env.ELASTIC_PASSWORD }} | |
| FLEET_NAME: "fleet" | |
| - id: force-install-synthetics | |
| name: Force install synthetics | |
| if: matrix.version == '8.14.3' || matrix.version == '8.15.5' || matrix.version == '8.16.2' || matrix.version == '8.17.0' | |
| run: |- | |
| for i in {1..5}; do curl -s -H "Authorization: ApiKey ${{ steps.get-api-key.outputs.apikey }}" --header "Content-Type: application/json" --header "kbn-xsrf: true" --request POST --data '{ "force": true }' http://localhost:5601/api/fleet/epm/packages/synthetics/1.2.2 && break || sleep 15; done | |
| - name: TF acceptance tests | |
| id: tf-acceptance | |
| timeout-minutes: 30 | |
| continue-on-error: ${{ endsWith(matrix.version, '-SNAPSHOT') }} | |
| run: make testacc | |
| env: | |
| TF_ACC: "1" | |
| STACK_VERSION: ${{ matrix.version }} | |
| ELASTICSEARCH_ENDPOINTS: "http://localhost:9200" | |
| ELASTICSEARCH_USERNAME: "elastic" | |
| ELASTICSEARCH_PASSWORD: ${{ env.ELASTIC_PASSWORD }} | |
| KIBANA_ENDPOINT: "http://localhost:5601" | |
| KIBANA_USERNAME: "elastic" | |
| KIBANA_PASSWORD: ${{ env.ELASTIC_PASSWORD }} | |
| - name: Warn PR for snapshot acceptance failure | |
| if: steps.tf-acceptance.outcome == 'failure' && endsWith(matrix.version, '-SNAPSHOT') && github.event_name == 'pull_request' | |
| continue-on-error: true | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 | |
| with: | |
| script: | | |
| const marker = '<!-- tf-acceptance-snapshot-warning:${{ matrix.version }} -->'; | |
| const body = [ | |
| marker, | |
| ':warning: Terraform acceptance tests failed for snapshot stack version `${{ matrix.version }}`.', | |
| 'This failure is non-blocking because snapshot builds are allowed to fail.', | |
| '', | |
| `Run: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, | |
| ].join('\n'); | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| per_page: 100, | |
| }); | |
| const existingComment = comments.find((comment) => | |
| comment.user?.type === 'Bot' && comment.body?.includes(marker) | |
| ); | |
| if (existingComment) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existingComment.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| body, | |
| }); | |
| } | |
| - name: Docker compose logs | |
| if: failure() || steps.tf-acceptance.outcome == 'failure' | |
| run: docker compose logs --no-color | |
| env: | |
| STACK_VERSION: ${{ matrix.version }} | |
| - name: Tear down docker compose stack | |
| if: always() | |
| run: make docker-clean | |
| env: | |
| STACK_VERSION: ${{ matrix.version }} | |
| auto-approve: | |
| name: Evaluate and auto-approve PR | |
| if: always() && github.event_name == 'pull_request' && (github.event.action == 'ready_for_review' || needs.test.result == 'success') | |
| needs: [preflight, test] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Evaluate auto-approval gates | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: go run ./scripts/auto-approve |