From 2bd4f5c6e8c24837951eb83300b39400322a6330 Mon Sep 17 00:00:00 2001 From: Hubert Deng Date: Fri, 10 Jan 2025 10:11:04 -0800 Subject: [PATCH] feat(devservices): Add devservices ci validation job (#6716) This validation job will only run if files are changed in the `devservices/` directory or the `.github/workflows/ci.yml` has been changed. It will ensure that the config files that live in the snuba devservices directory actually work, preventing potential breakages for devservices across repos that depend on snuba if invalid configs are merged. Composite action used: https://github.com/getsentry/action-validate-devservices-config --- .github/file-filters.yml | 4 ++++ .github/workflows/ci.yml | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 5c2ca56438..9b9acefaff 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -8,3 +8,7 @@ api_changes: - "snuba/cli/devserver.py" - "rust_snuba/src/processors/*" - "snuba/datasets/processors/*" + +devservices_changes: + - 'devservices/**' + - '.github/workflows/ci.yml' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc0929854e..e6a6f3fe33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ jobs: # Map a step output to a job output outputs: api_changes: ${{ steps.changes.outputs.api_changes }} + devservices_changes: ${{ steps.changes.outputs.devservices_changes }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v2 @@ -486,3 +487,15 @@ jobs: # finally, nightly docker tag ${IMAGE_URL} getsentry/snuba:nightly docker push getsentry/snuba:nightly + + validate-devservices-config: + runs-on: ubuntu-24.04 + needs: files-changed + if: ${{ needs.files-changed.outputs.devservices_changes == 'true' }} + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + name: Checkout repository + - uses: getsentry/action-validate-devservices-config@6477ef1e9c96e456bfad726006e731f89fcd81db + name: Validate devservices config + with: + requirements-file-path: requirements.txt