Skip to content

Enable TCP keepalive and recycle idle connections in Logfire's HTTP sessions #216

Enable TCP keepalive and recycle idle connections in Logfire's HTTP sessions

Enable TCP keepalive and recycle idle connections in Logfire's HTTP sessions #216

Workflow file for this run

name: Deps Update CI Job
on:
schedule:
- cron: '0 12 1,15 * *' # 1st and 15th of every month, so roughly once every 2 weeks
# Can be triggered manually from the actions tab, if needed
workflow_dispatch:
# Run the full compatibility matrix on labeled PRs, including after later pushes.
pull_request:
types:
- opened # Run when the PR is created with the label already attached.
- labeled # Run when the label is added to an existing PR.
- synchronize # Rerun after a push while the label is present.
- reopened # Rerun when a labeled PR is reopened.
concurrency:
group: deps-test-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions: { }
env:
# https://github.com/samuelcolvin/pytest-pretty#usage-with-github-actions
COLUMNS: 180
jobs:
test:
if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'test:all-deps') }}
name: test on Python ${{ matrix.python-version }}, pydantic ${{ matrix.pydantic-version }}, otel ${{ matrix.otel-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
pydantic-version: [ 'main' ]
otel-version: [ '1' ] # i.e. the latest
include:
# Pydantic versions
- python-version: '3.12'
pydantic-version: '2.4'
otel-version: '1'
- python-version: '3.12'
pydantic-version: '2.5'
otel-version: '1'
- python-version: '3.12'
pydantic-version: '2.6'
otel-version: '1'
- python-version: '3.12'
pydantic-version: '2.7'
otel-version: '1'
- python-version: '3.13'
pydantic-version: '2.8'
otel-version: '1'
- python-version: '3.13'
pydantic-version: '2.9'
otel-version: '1'
- python-version: '3.13'
pydantic-version: '2.10'
otel-version: '1'
- python-version: '3.13'
pydantic-version: '2.11'
otel-version: '1'
- python-version: '3.14'
pydantic-version: '2.12'
otel-version: '1'
- python-version: '3.14'
pydantic-version: '2.13'
otel-version: '1'
# OpenTelemetry versions
- python-version: '3.14'
pydantic-version: 'main'
otel-version: '1.39'
- python-version: '3.14'
pydantic-version: 'main'
otel-version: '1.40'
- python-version: '3.14'
pydantic-version: 'main'
otel-version: '1.41'
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Ensure requests to production domains fail
if: runner.os == 'Linux'
run: |
echo "203.0.113.0 logfire.dev" | sudo tee -a /etc/hosts
echo "203.0.113.0 logfire-api.pydantic.dev" | sudo tee -a /etc/hosts
echo "203.0.113.0 logfire.pydantic.dev" | sudo tee -a /etc/hosts
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.1"
enable-cache: true
# upgrade deps to the latest versions for this test
- run: uv sync --python ${{ matrix.python-version }} --upgrade
- name: Install pydantic main
if: matrix.pydantic-version == 'main'
run: uv pip install git+https://github.com/pydantic/pydantic.git
- name: Install pydantic ${{ matrix.pydantic-version }}
if: matrix.pydantic-version != 'main'
# installs the most recent patch on the minor version's track, ex 2.6.0 -> 2.6.4
run: uv pip install 'pydantic==${{ matrix.pydantic-version }}.*'
- name: Install OTel SDK ${{ matrix.otel-version }}
# installs the most recent patch on the minor version's track, ex 2.6.* -> 2.6.4
run: |
uv pip install 'opentelemetry-sdk==${{ matrix.otel-version }}.*'
uv pip install 'opentelemetry-exporter-otlp-proto-http==${{ matrix.otel-version }}.*'
- run: uv run --no-sync pytest
notify-on-failure:
name: Notify maintainers on CI failure
runs-on: ubuntu-latest
needs: test
# only run if the test job failed
if: ${{ failure() && github.event_name != 'pull_request' }}
steps:
- name: Send slack message
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload: |
heading: Logfire CI deps test ${{github.repository}} failed!
body: See details at ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}