diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2d6a7bff63e..0e437ab0320 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -22,9 +22,12 @@ updates: default-days: 1 # Tracks the digest-pinned `COPY --from` image (ghcr.io/astral-sh/uv) in - # docker/Dockerfile.base. Note: the python:3.12-slim base/builder images are - # passed via build args from docker/docker-bake.hcl and the `docker run` image - # strings in workflows are not parsed by Dependabot; bump those manually. + # docker/Dockerfile.base. Note: the python:3.12-slim base/builder digests are + # carried both as the build_image/base_image ARG defaults in Dockerfile.base + # and in docker/docker-bake.hcl (which overrides them at build time). + # Dependabot does NOT parse images that reach FROM via an ARG, nor the + # `docker run` image strings in workflows, so bump those by hand and keep the + # Dockerfile.base ARG defaults and docker-bake.hcl digests in sync. - package-ecosystem: 'docker' directory: '/docker' schedule: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000000..fabd9edb146 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,56 @@ +name: CodeQL + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +# Cancel a superseded run for the same ref (e.g. a force-push to a PR) so we +# don't burn CI minutes analyzing commits that are already stale. +concurrency: + group: codeql-${{ github.ref }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + timeout-minutes: 360 + permissions: + # Required to upload code-scanning results to the Security tab. + security-events: write + # Required by codeql-action to read the workflow/CI config. + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + # Haystack is a Python project; Python is interpreted, so no build is + # needed. Add `javascript-typescript` here if the docs-website JS code + # should also be scanned. + - language: python + build-mode: none + + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Initialize CodeQL + uses: github/codeql-action/init@dd903d2e4f5405488e5ef1422510ee31c8b32357 # v3.36.2 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@dd903d2e4f5405488e5ef1422510ee31c8b32357 # v3.36.2 + with: + category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/docs_search_sync.yml b/.github/workflows/docs_search_sync.yml index d34f32c750a..67511f34d0c 100644 --- a/.github/workflows/docs_search_sync.yml +++ b/.github/workflows/docs_search_sync.yml @@ -36,7 +36,7 @@ jobs: - name: Install Docusaurus and build docs-website working-directory: docs-website run: | - npm install --ignore-scripts + npm ci --ignore-scripts npm rebuild sharp npm run build diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f15945931d4..fd9761cae1a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -61,6 +61,6 @@ jobs: retention-days: 5 - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/upload-sarif@dd903d2e4f5405488e5ef1422510ee31c8b32357 # v3.36.2 with: sarif_file: results.sarif diff --git a/.github/workflows/workflows_linting.yml b/.github/workflows/workflows_linting.yml index 9801257050f..16bb61e0eca 100644 --- a/.github/workflows/workflows_linting.yml +++ b/.github/workflows/workflows_linting.yml @@ -22,7 +22,7 @@ jobs: go-version: ">=1.24.0" - name: Install actionlint - run: go install github.com/rhysd/actionlint/cmd/actionlint@latest + run: go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 - name: Run actionlint env: diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index e3de37c8a8f..c4cee03a765 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -1,7 +1,10 @@ -ARG build_image -ARG base_image +# Pinned digest defaults so the base images are resolvable by hash even when +# the args are not passed (e.g. by supply-chain scanners or a plain `docker build`). +# docker/docker-bake.hcl overrides these at build time; keep the digests in sync. +ARG build_image=python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203 +ARG base_image=python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203 -FROM $build_image AS build-image +FROM ${build_image} AS build-image ARG DEBIAN_FRONTEND=noninteractive ARG haystack_version @@ -25,7 +28,7 @@ ENV PATH="/opt/venv/bin:$PATH" RUN uv pip install --no-cache-dir -U setuptools && \ uv pip install --no-cache-dir . -FROM $base_image AS final +FROM ${base_image} AS final COPY --from=build-image /opt/venv /opt/venv