diff --git a/.github/workflows/approve-workflows.yml b/.github/workflows/approve-workflows.yml deleted file mode 100644 index f372012f2b7..00000000000 --- a/.github/workflows/approve-workflows.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -### -# This action is synced from https://github.com/prometheus/prometheus -### -name: Approve pending workflows - -on: - issue_comment: - types: [created] - -permissions: read-all - -jobs: - approve: - if: >- - github.event.issue.pull_request && - github.event.comment.body == '/workflow-approve' && - (github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community') - runs-on: ubuntu-latest - permissions: - actions: write - contents: read - pull-requests: write - steps: - - uses: prometheus/promci/approve_workflows@370e8c15dcec50043cbe66f2f34633d9efc0a190 # v0.9.0 - with: - github_token: ${{ github.token }} diff --git a/.github/workflows/automerge-dependabot.yml b/.github/workflows/automerge-dependabot.yml deleted file mode 100644 index c6f6fbbad61..00000000000 --- a/.github/workflows/automerge-dependabot.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: Dependabot auto-merge -on: pull_request - -concurrency: - group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - dependabot: - permissions: - contents: write - pull-requests: write - runs-on: ubuntu-latest - if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.repository_owner == 'prometheus' }} - steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Enable auto-merge for Dependabot PRs - if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}} - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/buf-lint.yml b/.github/workflows/buf-lint.yml deleted file mode 100644 index 43709bc8acf..00000000000 --- a/.github/workflows/buf-lint.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: buf.build -on: - pull_request: - paths: - - ".github/workflows/buf-lint.yml" - - "**.proto" -permissions: - contents: read - -jobs: - buf: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - - uses: bufbuild/buf-lint-action@06f9dd823d873146471cfaaf108a993fe00e5325 # v1.1.1 - with: - input: 'prompb' - - uses: bufbuild/buf-breaking-action@c57b3d842a5c3f3b454756ef65305a50a587c5ba # v1.1.4 - with: - input: 'prompb' - against: 'https://github.com/prometheus/prometheus.git#branch=main,ref=HEAD,subdir=prompb' diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml deleted file mode 100644 index 7fe8fe7bc5d..00000000000 --- a/.github/workflows/buf.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: buf.build -on: - push: - branches: - - main -permissions: - contents: read - -jobs: - buf: - name: lint and publish - runs-on: ubuntu-latest - if: github.repository_owner == 'prometheus' - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - - uses: bufbuild/buf-lint-action@06f9dd823d873146471cfaaf108a993fe00e5325 # v1.1.1 - with: - input: 'prompb' - - uses: bufbuild/buf-breaking-action@c57b3d842a5c3f3b454756ef65305a50a587c5ba # v1.1.4 - with: - input: 'prompb' - against: 'https://github.com/prometheus/prometheus.git#branch=main,ref=HEAD~1,subdir=prompb' - - uses: bufbuild/buf-push-action@a654ff18effe4641ebea4a4ce242c49800728459 # v1.2.0 - with: - input: 'prompb' - buf_token: ${{ secrets.BUF_TOKEN }} diff --git a/.github/workflows/check_release_notes.yml b/.github/workflows/check_release_notes.yml deleted file mode 100644 index 078785cae3b..00000000000 --- a/.github/workflows/check_release_notes.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: 'Check release notes' -on: - pull_request: - branches: [main, 'release-*'] - types: - - opened - - reopened - - edited - - synchronize -permissions: - contents: read - pull-requests: read - -jobs: - check_release_notes: - name: check - runs-on: ubuntu-latest - # Don't run this workflow on forks. - # Don't run it on dependabot PRs either as humans would take control in case a bump introduces a breaking change. - if: (github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community') && github.event.pull_request.user.login != 'dependabot[bot]' - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - env: - PR_DESCRIPTION: ${{ github.event.pull_request.body }} - run: | - echo "$PR_DESCRIPTION" | ./scripts/check_release_notes.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index d294b167860..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,453 +0,0 @@ ---- -name: CI -on: - pull_request: - push: - branches: [main, 'release-*'] - tags: ['v*'] - -permissions: - contents: read - -jobs: - test_go: - name: Go tests - runs-on: ubuntu-latest - container: - # Whenever the Go version is updated here, .promu.yml - # should also be updated. - image: quay.io/prometheus/golang-builder:1.26-base - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-setup@3e5cd31b34b8ae19efa8f071c5e3cdb44884a7f8 # v0.2.1 - with: - enable_npm: true - cache_key_suffix: race - - run: make GO_ONLY=1 SKIP_GOLANGCI_LINT=1 - - run: go test ./tsdb/ -test.tsdb-isolation=false - - run: make -C documentation/examples/remote_storage - - run: make -C documentation/examples - - test_go_more: - name: More Go tests - runs-on: ubuntu-latest - container: - image: quay.io/prometheus/golang-builder:1.26-base - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-setup@3e5cd31b34b8ae19efa8f071c5e3cdb44884a7f8 # v0.2.1 - with: - cache_key_suffix: more - - run: go test --tags=dedupelabels ./... - - run: go test --tags=slicelabels -race ./cmd/prometheus ./model/textparse ./prompb/... - - run: go test --tags=forcedirectio -race ./tsdb/ - - run: make protoc - - run: make proto - - run: git diff --exit-code - - test_go_386: - name: Go tests for 32-bit x86 - runs-on: ubuntu-latest - container: - image: quay.io/prometheus/golang-builder:1.26-base - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-setup@3e5cd31b34b8ae19efa8f071c5e3cdb44884a7f8 # v0.2.1 - with: - cache_key_suffix: "386" - # NOTE(bwplotka): We limit concurrency to avoid issues around too many concurrent mmaps - # caused by parallel tests. See context: https://github.com/prometheus/prometheus/pull/18709 - # Alternatively we could adjust each relevant test to have 386 aware parallelization setting. - - run: GOARCH=386 go test -parallel=1 ./... - - list_lts_releases: - name: List active LTS releases - runs-on: ubuntu-latest - outputs: - versions: ${{ steps.lts.outputs.versions }} - steps: - - id: lts - # Emit the active LTS versions as a JSON array consumed by the matrix below. - run: | - versions=$(curl -sSf https://prometheus.io/download.json \ - | jq -c '[.prometheus[] | select(.lts == true) | (.version | ltrimstr("v"))]') - echo "versions=$versions" >> "$GITHUB_OUTPUT" - - test_version_upgrade: - name: Go tests for Prometheus upgrades and downgrades - needs: list_lts_releases - runs-on: ubuntu-latest - strategy: - # Run every LTS release even if one fails. - fail-fast: false - matrix: - lts_version: ${{ fromJSON(needs.list_lts_releases.outputs.versions) }} - container: - image: quay.io/prometheus/golang-builder:1.26-base - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-setup@3e5cd31b34b8ae19efa8f071c5e3cdb44884a7f8 # v0.2.1 - with: - cache_key_suffix: upgrade - - run: go test -v --race ./cmd/prometheus/ --test.version-upgrade=true --test.lts-version=${{ matrix.lts_version }} -run TestVersionUpgrade - - test_go_oldest: - name: Go tests with previous Go version - runs-on: ubuntu-latest - env: - # Enforce the Go version. - GOTOOLCHAIN: local - container: - # The go version in this image should be N-1 wrt test_go. - image: quay.io/prometheus/golang-builder:1.25-base - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-setup@3e5cd31b34b8ae19efa8f071c5e3cdb44884a7f8 # v0.2.1 - with: - enable_npm: false - cache_key_suffix: oldest - - run: make build - # Don't run NPM build; don't run race-detector. - - run: make test GO_ONLY=1 test-flags="" - - test_ui: - name: UI tests - runs-on: ubuntu-latest - # Whenever the Go version is updated here, .promu.yml - # should also be updated. - container: - image: quay.io/prometheus/golang-builder:1.26-base - - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-setup@3e5cd31b34b8ae19efa8f071c5e3cdb44884a7f8 # v0.2.1 - with: - enable_go: false - enable_npm: true - - run: make assets-tarball - - run: make ui-lint - - run: make ui-test - - uses: prometheus/promci-artifacts/save@f9a587dbc0b2c78a0c54f8ad1cde71ea29a4b76f # v0.1.0 - with: - directory: .tarballs - - test_windows: - name: Go tests on Windows - runs-on: windows-latest - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 - with: - go-version: 1.26.x - - run: | - $TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"} - go test $TestTargets -vet=off -v - shell: powershell - - test_mixins: - name: Mixins tests - runs-on: ubuntu-latest - # Whenever the Go version is updated here, .promu.yml - # should also be updated. - container: - image: quay.io/prometheus/golang-builder:1.26-base - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - run: go install ./cmd/promtool/. - - run: go install github.com/google/go-jsonnet/cmd/jsonnet@latest - - run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest - - run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest - - run: make -C documentation/prometheus-mixin clean - - run: make -C documentation/prometheus-mixin jb_install - - run: make -C documentation/prometheus-mixin - - run: git diff --exit-code - - test-compliance: - name: Compliance testing - runs-on: ubuntu-latest - container: - # Whenever the Go version is updated here, .promu.yml - # should also be updated. - image: quay.io/prometheus/golang-builder:1.26-base - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-setup@3e5cd31b34b8ae19efa8f071c5e3cdb44884a7f8 # v0.2.1 - with: - enable_npm: false - cache_key_suffix: compliance - # NOTE: Those tests are based on https://github.com/prometheus/compliance and - # are executed against the ./cmd/prometheus main package. - - run: go test -v --tags=compliance ./compliance/... - - build: - name: Build Prometheus for common architectures - runs-on: ubuntu-latest - # Reuse the web UI built and tested by test_ui instead of rebuilding it in - # every crossbuild container. - needs: [test_ui] - if: | - !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v2.')) - && - !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v3.')) - && - !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-')) - && - !(github.event_name == 'push' && github.event.ref == 'refs/heads/main') - strategy: - matrix: - thread: [ 0, 1, 2 ] - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-artifacts/restore@f9a587dbc0b2c78a0c54f8ad1cde71ea29a4b76f # v0.1.0 - - name: Extract pre-built UI assets - run: | - mkdir -p .prebuilt-ui - tar -xzvf .tarballs/prometheus-web-ui-*.tar.gz -C .prebuilt-ui - - uses: prometheus/promci/build@13941414d409d227afd67544e5d306827db5a1a2 # v0.8.5 - with: - checkout: false - # Feed the restored UI assets into the crossbuild containers so make - # skips the UI build (see PREBUILT_ASSETS_STATIC_DIR in the Makefile). - promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386 --env PREBUILT_ASSETS_STATIC_DIR=.prebuilt-ui/static" - parallelism: 3 - thread: ${{ matrix.thread }} - build_all: - name: Build Prometheus for all architectures - runs-on: ubuntu-latest - # Reuse the web UI built and tested by test_ui instead of rebuilding it in - # every crossbuild container. - needs: [test_ui] - if: | - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v2.')) - || - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v3.')) - || - (github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-')) - || - (github.event_name == 'push' && github.event.ref == 'refs/heads/main') - strategy: - matrix: - thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ] - - # Whenever the Go version is updated here, .promu.yml - # should also be updated. - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-artifacts/restore@f9a587dbc0b2c78a0c54f8ad1cde71ea29a4b76f # v0.1.0 - - name: Extract pre-built UI assets - run: | - mkdir -p .prebuilt-ui - tar -xzvf .tarballs/prometheus-web-ui-*.tar.gz -C .prebuilt-ui - - uses: prometheus/promci/build@13941414d409d227afd67544e5d306827db5a1a2 # v0.8.5 - with: - checkout: false - parallelism: 12 - thread: ${{ matrix.thread }} - # Feed the restored UI assets into the crossbuild containers so make - # skips the UI build (see PREBUILT_ASSETS_STATIC_DIR in the Makefile). - promu_opts: --env PREBUILT_ASSETS_STATIC_DIR=.prebuilt-ui/static - build_all_status: - # This status check aggregates the individual matrix jobs of the "Build - # Prometheus for all architectures" step into a final status. Fails if a - # single matrix job fails, succeeds if all matrix jobs succeed. - # See https://github.com/orgs/community/discussions/4324 for why this is - # needed - name: Report status of build Prometheus for all architectures - runs-on: ubuntu-latest - needs: [build_all] - # The run condition needs to include always(). Otherwise actions - # behave unexpected: - # only "needs" will make the Status Report be skipped if one of the builds fails https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-jobs-in-a-workflow#defining-prerequisite-jobs - # And skipped is treated as success https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborat[…]n-repositories-with-code-quality-features/about-status-checks - # Adding always ensures that the status check is run independently of the - # results of Build All - if: always() && github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-') - steps: - - name: Successful build - if: ${{ !(contains(needs.*.result, 'failure')) && !(contains(needs.*.result, 'cancelled')) }} - run: exit 0 - - name: Failing or cancelled build - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} - run: exit 1 - check_generated_parser: - # Checks generated parser and UI functions list. Not renaming as it is a required check. - name: Check generated parser - runs-on: ubuntu-latest - container: - image: quay.io/prometheus/golang-builder:1.26-base - steps: - - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - uses: prometheus/promci-setup@3e5cd31b34b8ae19efa8f071c5e3cdb44884a7f8 # v0.2.1 - with: - enable_npm: true - cache_key_suffix: parser - - run: make install-goyacc check-generated-parser - - run: make check-generated-promql-functions - golangci: - name: golangci-lint - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - name: Install Go - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 - with: - go-version: 1.26.x - - name: Install snmp_exporter/generator dependencies - run: sudo apt-get update && sudo apt-get -y install libsnmp-dev - if: github.repository == 'prometheus/snmp_exporter' - - name: Get golangci-lint version - id: golangci-lint-version - run: echo "version=$(make print-golangci-lint-version)" >> $GITHUB_OUTPUT - - name: Lint - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - with: - args: --verbose - version: ${{ steps.golangci-lint-version.outputs.version }} - - name: Lint with slicelabels - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - with: - args: --verbose --build-tags=slicelabels - version: ${{ steps.golangci-lint-version.outputs.version }} - - name: Lint with dedupelabels - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - with: - args: --verbose --build-tags=dedupelabels - version: ${{ steps.golangci-lint-version.outputs.version }} - - name: Lint in compliance - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - with: - args: --verbose - working-directory: compliance - version: ${{ steps.golangci-lint-version.outputs.version }} - - name: Lint in documentation/examples/remote_storage - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - with: - args: --verbose - working-directory: documentation/examples/remote_storage - version: ${{ steps.golangci-lint-version.outputs.version }} - fuzzing: - uses: ./.github/workflows/fuzzing.yml - if: github.event_name == 'pull_request' - codeql: - uses: ./.github/workflows/codeql-analysis.yml - permissions: - contents: read - security-events: write - - publish_main: - name: Publish main branch artifacts - runs-on: ubuntu-latest - permissions: - packages: write - needs: [test_ui, test_go, test_go_more, test_go_oldest, test_windows, golangci, codeql, build_all] - if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' - steps: - - uses: prometheus/promci/publish_main@13941414d409d227afd67544e5d306827db5a1a2 # v0.8.5 - with: - docker_hub_login: ${{ secrets.docker_hub_login }} - docker_hub_password: ${{ secrets.docker_hub_password }} - ghcr_io_password: ${{ github.token }} - quay_io_login: ${{ secrets.quay_io_login }} - quay_io_password: ${{ secrets.quay_io_password }} - publish_release: - name: Publish release artefacts - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - needs: [test_ui, test_go, test_go_more, test_go_oldest, test_windows, golangci, codeql, build_all] - if: | - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v2.')) - || - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v3.')) - steps: - - uses: prometheus/promci/publish_release@13941414d409d227afd67544e5d306827db5a1a2 # v0.8.5 - with: - docker_hub_login: ${{ secrets.docker_hub_login }} - docker_hub_password: ${{ secrets.docker_hub_password }} - ghcr_io_password: ${{ github.token }} - quay_io_login: ${{ secrets.quay_io_login }} - quay_io_password: ${{ secrets.quay_io_password }} - github_token: ${{ github.token }} - publish_ui_release: - name: Publish UI on npm Registry - runs-on: ubuntu-latest - needs: [test_ui, codeql] - permissions: - contents: read - # Required for npm trusted publishing via OIDC. - id-token: write - steps: - - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - name: Install nodejs - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version-file: "web/ui/.nvmrc" - registry-url: "https://registry.npmjs.org" - - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - with: - # Exclude the broken pnpm 11.12.0 (self-installer crash, see - # https://github.com/pnpm/action-setup/issues/276) while still - # picking up future 11.x releases that fix it. - version: ">=11.0.0 <11.12.0 || >11.12.0 <12.0.0" - - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ~/.local/share/pnpm/store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - name: Check libraries version - if: | - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v2.')) - || - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v3.')) - run: ./scripts/ui_release.sh --check-package "$(./scripts/get_module_version.sh ${GH_REF_NAME})" - env: - GH_REF_NAME: ${{ github.ref_name }} - - name: build - run: make assets - - name: Copy files before publishing libs - run: ./scripts/ui_release.sh --copy - - name: Publish dry-run libraries - if: | - !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v2.')) - && - !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v3.')) - run: ./scripts/ui_release.sh --publish dry-run - - name: Publish libraries - if: | - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v2.')) - || - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v3.')) - run: ./scripts/ui_release.sh --publish diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 4c29af3645e..00000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -name: "CodeQL" - -on: - workflow_call: - schedule: - - cron: "26 14 * * 1" - -permissions: {} - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ["javascript"] - - steps: - - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: Initialize CodeQL - uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 diff --git a/.github/workflows/container_description.yml b/.github/workflows/container_description.yml deleted file mode 100644 index 591a4d687f0..00000000000 --- a/.github/workflows/container_description.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- -### -# This action is synced from https://github.com/prometheus/prometheus -### -name: Push README to Docker Hub -on: - push: - paths: - - "README.md" - - "README-containers.md" - - ".github/workflows/container_description.yml" - branches: [ main, master ] - -permissions: - contents: read - -jobs: - PushDockerHubReadme: - runs-on: ubuntu-latest - name: Push README to Docker Hub - if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks. - steps: - - name: git checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - name: Set docker hub repo name - run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV - - name: Push README to Dockerhub - uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1 - env: - DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }} - DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }} - with: - destination_container_repo: ${{ env.DOCKER_REPO_NAME }} - provider: dockerhub - short_description: ${{ env.DOCKER_REPO_NAME }} - # Empty string results in README-containers.md being pushed if it - # exists. Otherwise, README.md is pushed. - readme_file: '' - - PushQuayIoReadme: - runs-on: ubuntu-latest - name: Push README to quay.io - if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks. - steps: - - name: git checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - name: Set quay.io org name - run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV - - name: Set quay.io repo name - run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV - - name: Push README to quay.io - uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1 - env: - DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }} - with: - destination_container_repo: ${{ env.DOCKER_REPO_NAME }} - provider: quay - # Empty string results in README-containers.md being pushed if it - # exists. Otherwise, README.md is pushed. - readme_file: '' diff --git a/.github/workflows/fuzzing.yml b/.github/workflows/fuzzing.yml deleted file mode 100644 index d89e07bf5e0..00000000000 --- a/.github/workflows/fuzzing.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: fuzzing -on: - workflow_call: -permissions: - contents: read - -jobs: - fuzzing: - name: Run Go Fuzz Tests - runs-on: ubuntu-latest - strategy: - matrix: - fuzz_test: [[FuzzParseMetricText, FuzzParseOpenMetric], [FuzzParseMetricSelector, FuzzParseExpr], [FuzzXORChunk, FuzzXOR2Chunk], [FuzzParseProtobuf]] - steps: - - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - name: Install Go - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 - with: - go-version: 1.26.x - - name: Run Fuzzing - run: | - for fuzz_test in ${{ join(matrix.fuzz_test, ' ') }}; do - go test -fuzz="${fuzz_test}$" -fuzztime=4m ./util/fuzzing - done - id: fuzz - - name: Upload Crash Artifacts - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - if: failure() - with: - name: fuzz-artifacts-${{ join(matrix.fuzz_test, '-') }} - path: util/fuzzing/testdata/fuzz/ - fuzzing_status: - # This status check aggregates the individual matrix jobs of the fuzzing - # step into a final status. Fails if a single matrix job fails, succeeds if - # all matrix jobs succeed. - name: Fuzzing - runs-on: ubuntu-latest - needs: [fuzzing] - if: always() - steps: - - name: Successful fuzzing - if: ${{ !(contains(needs.*.result, 'failure')) && !(contains(needs.*.result, 'cancelled')) }} - run: exit 0 - - name: Failing or cancelled fuzzing - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} - run: exit 1 diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml deleted file mode 100644 index 374df32baf8..00000000000 --- a/.github/workflows/govulncheck.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -### -# This action is synced from https://github.com/prometheus/prometheus -### -name: govulncheck -on: - pull_request: - paths: - - VERSION - - .github/workflows/govulncheck.yml - push: - branches: - - main - - master - schedule: - - cron: '33 2 * * *' - -permissions: - contents: read - -jobs: - govulncheck: - runs-on: ubuntu-latest - name: Run govulncheck - steps: - - name: Install snmp_exporter/generator dependencies - id: snmp-deps - run: sudo apt-get update && sudo apt-get -y install libsnmp-dev - if: github.repository == 'prometheus/snmp_exporter' - - id: govulncheck - uses: golang/govulncheck-action@3fa7bd9cee2cfdf3499a8803b226e43de7b7cdb4 # master - env: - GOOS: ${{ contains(github.repository, 'windows_exporter') && 'windows' || '' }} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index de630953056..00000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: 'Lock Threads' - -on: - schedule: - - cron: '13 23 * * *' - workflow_dispatch: - -permissions: - issues: write - -concurrency: - group: lock - -jobs: - action: - runs-on: ubuntu-latest - if: github.repository_owner == 'prometheus' - steps: - - uses: dessant/lock-threads@89ae32b08ed1a541efecbab17912962a5e38981c # v6.0.2 - with: - process-only: 'issues' - issue-inactive-days: '180' - github-token: ${{ secrets.PROMBOT_LOCKTHREADS_TOKEN }} diff --git a/.github/workflows/prombench.yml b/.github/workflows/prombench.yml deleted file mode 100644 index 34bea41d546..00000000000 --- a/.github/workflows/prombench.yml +++ /dev/null @@ -1,136 +0,0 @@ -on: - repository_dispatch: - types: [prombench_start, prombench_restart, prombench_stop] -name: Prombench Workflow -permissions: - contents: read -env: - AUTH_FILE: ${{ secrets.TEST_INFRA_PROVIDER_AUTH }} - CLUSTER_NAME: test-infra - DOMAIN_NAME: prombench.prometheus.io - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_ORG: prometheus - GITHUB_REPO: prometheus - GITHUB_STATUS_TARGET_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - LAST_COMMIT_SHA: ${{ github.event.client_payload.LAST_COMMIT_SHA }} - GKE_PROJECT_ID: macro-mile-203600 - PR_NUMBER: ${{ github.event.client_payload.PR_NUMBER }} - PROVIDER: gke - RELEASE: ${{ github.event.client_payload.RELEASE }} - BENCHMARK_VERSION: ${{ github.event.client_payload.BENCHMARK_VERSION }} - BENCHMARK_DIRECTORY: ${{ github.event.client_payload.BENCHMARK_DIRECTORY }} - ZONE: europe-west3-a -jobs: - benchmark_start: - name: Benchmark Start - if: github.event.action == 'prombench_start' - permissions: - statuses: write - runs-on: ubuntu-latest - steps: - - name: Update status to pending - run: >- - curl -i -X POST - -H "Authorization: Bearer $GITHUB_TOKEN" - -H "Content-Type: application/json" - --data '{"state":"pending", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}' - "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA" - - name: Run make deploy to start test - id: make_deploy - uses: docker://prominfra/prombench:master - with: - args: >- - make deploy; - until make all_nodes_running; do echo "waiting for nodepools to be created"; sleep 10; done; - - name: Update status to failure - if: failure() - run: >- - curl -i -X POST - -H "Authorization: Bearer $GITHUB_TOKEN" - -H "Content-Type: application/json" - --data '{"state":"failure", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}' - "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA" - - name: Update status to success - if: success() - run: >- - curl -i -X POST - -H "Authorization: Bearer $GITHUB_TOKEN" - -H "Content-Type: application/json" - --data '{"state":"success", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}' - "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA" - benchmark_cancel: - name: Benchmark Cancel - if: github.event.action == 'prombench_stop' - permissions: - statuses: write - runs-on: ubuntu-latest - steps: - - name: Update status to pending - run: >- - curl -i -X POST - -H "Authorization: Bearer $GITHUB_TOKEN" - -H "Content-Type: application/json" - --data '{"state":"pending", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}' - "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA" - - name: Run make clean to stop test - id: make_clean - uses: docker://prominfra/prombench:master - with: - args: >- - make clean; - until make all_nodes_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done; - - name: Update status to failure - if: failure() - run: >- - curl -i -X POST - -H "Authorization: Bearer $GITHUB_TOKEN" - -H "Content-Type: application/json" - --data '{"state":"failure", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}' - "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA" - - name: Update status to success - if: success() - run: >- - curl -i -X POST - -H "Authorization: Bearer $GITHUB_TOKEN" - -H "Content-Type: application/json" - --data '{"state":"success", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}' - "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA" - benchmark_restart: - name: Benchmark Restart - if: github.event.action == 'prombench_restart' - permissions: - statuses: write - runs-on: ubuntu-latest - steps: - - name: Update status to pending - run: >- - curl -i -X POST - -H "Authorization: Bearer $GITHUB_TOKEN" - -H "Content-Type: application/json" - --data '{"state":"pending", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}' - "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA" - - name: Run make clean then make deploy to restart test - id: make_restart - uses: docker://prominfra/prombench:master - with: - args: >- - make clean; - until make all_nodes_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done; - make deploy; - until make all_nodes_running; do echo "waiting for nodepools to be created"; sleep 10; done; - - name: Update status to failure - if: failure() - run: >- - curl -i -X POST - -H "Authorization: Bearer $GITHUB_TOKEN" - -H "Content-Type: application/json" - --data '{"state":"failure", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}' - "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA" - - name: Update status to success - if: success() - run: >- - curl -i -X POST - -H "Authorization: Bearer $GITHUB_TOKEN" - -H "Content-Type: application/json" - --data '{"state":"success", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}' - "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA" diff --git a/.github/workflows/repo_sync.yml b/.github/workflows/repo_sync.yml deleted file mode 100644 index 3669ca04914..00000000000 --- a/.github/workflows/repo_sync.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Sync repo files -on: - schedule: - - cron: '44 17 * * *' - workflow_dispatch: {} -permissions: - contents: read - -jobs: - repo_sync: - runs-on: ubuntu-latest - if: github.repository_owner == 'prometheus' - container: - image: quay.io/prometheus/golang-builder - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - run: ./scripts/sync_repo_files.sh - env: - GITHUB_TOKEN: ${{ secrets.PROMBOT_REPOSYNC_TOKEN }} - GITHUB_TOKEN_PROMETHEUS: ${{ secrets.PROMBOT_REPOSYNC_TOKEN_PROMETHEUS }} - GITHUB_TOKEN_PROMETHEUS_COMMUNITY: ${{ secrets.PROMBOT_REPOSYNC_TOKEN_PROMETHEUS_COMMUNITY }} diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml deleted file mode 100644 index 0e114c93b94..00000000000 --- a/.github/workflows/scorecards.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2022 Google LLC - -name: Scorecards supply-chain security -on: - pull_request: - push: - branches: [ "main" ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecards analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - # Used to receive a badge. - id-token: write - - steps: - - name: "Checkout code" - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # tag=v2.4.3 - with: - results_file: results.sarif - results_format: sarif - # Publish the results for public repositories to enable scorecard badges. For more details, see - # https://github.com/ossf/scorecard-action#publishing-results. - publish_results: ${{ github.event_name != 'pull_request' }} - - # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF - # format to the repository Actions tab. - - name: "Upload artifact" - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard. - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 - with: - sarif_file: results.sarif diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 5df426b0967..00000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,34 +0,0 @@ -### -# This action is synced from https://github.com/prometheus/prometheus -### -name: Stale Check -on: - workflow_dispatch: {} - schedule: - - cron: '16 22 * * *' -permissions: - issues: write - pull-requests: write -jobs: - stale: - if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks. - runs-on: ubuntu-latest - steps: - - uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - # opt out of defaults to avoid marking issues as stale and closing them - # https://github.com/actions/stale#days-before-close - # https://github.com/actions/stale#days-before-stale - days-before-stale: -1 - days-before-close: -1 - # Setting it to empty string to skip comments. - # https://github.com/actions/stale#stale-pr-message - # https://github.com/actions/stale#stale-issue-message - stale-pr-message: '' - stale-issue-message: '' - operations-per-run: 30 - # override days-before-stale, for only marking the pull requests as stale - days-before-pr-stale: 60 - stale-pr-label: stale - exempt-pr-labels: keepalive diff --git a/rh-manifest.txt b/rh-manifest.txt index d43b1c8cc48..e69de29bb2d 100644 --- a/rh-manifest.txt +++ b/rh-manifest.txt @@ -1,9 +0,0 @@ -colors@0.5.1 -discontinuous-range@1.0.0 -lodash.flattendeep@4.4.0 -nearley@2.7.10 -nomnom@1.6.2 -railroad-diagrams@1.0.0 -randexp@0.4.6 -ret@0.1.15 -underscore@1.4.4