Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
38 changes: 17 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
name: CI

on:
push:
branches:
- main
pull_request:
jobs:

lint:
pre-commit:
if: startsWith(github.head_ref, 'dependabot/') != true
name: pre-commit
runs-on: ubuntu-latest
strategy:
matrix:
lint-command:
- "ruff format --check --diff ."
- "ruff check --output-format=github ."
outputs:
file-names: ${{ steps.diff.outputs.file-names }}
Comment on lines +12 to +13
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'file-names' output is defined but never used in any subsequent job. Consider removing the outputs section and the corresponding diff step (lines 12-13, 18-19) if this output is not needed, to simplify the workflow.

Copilot uses AI. Check for mistakes.
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.x"
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
- run: python -m pip install -e .[lint]
- run: ${{ matrix.lint-command }}

fetch-depth: 0
- run: echo "file-names=$(git diff --name-only ${{ github.event.pull_request.base.sha }} HEAD | grep '\.py$' | tr '\n' ' ' || true)" >> "$GITHUB_OUTPUT"
id: diff
Comment on lines +18 to +19
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git diff command is calculating file names but the output is never used anywhere in the workflow. Consider removing this step if the file-names output is not needed.

Copilot uses AI. Check for mistakes.
- uses: astral-sh/setup-uv@v7
- uses: actions/cache@v5
with:
path: ~/.cache/pre-commit/
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow uses 'yq' command to parse the pre-commit config file, but 'yq' is not installed in any of the preceding steps. This will cause the job to fail. Consider installing yq using a GitHub Action like 'mikefarah/yq@master' or using an alternative approach to skip hooks.

Suggested change
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install yq
run: |
YQ_VERSION=v4.44.3
wget -q "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" -O yq
chmod +x yq
sudo mv yq /usr/local/bin/yq

Copilot uses AI. Check for mistakes.
- run: SKIP=$(yq '.ci.skip' -o csv .pre-commit-config.yaml) uvx pre-commit run --all-files --show-diff-on-failure
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command "uvx run pre-commit" appears to have incorrect syntax. The correct usage should be either "uvx pre-commit run" or "uv run pre-commit run" depending on whether pre-commit is installed via uvx or uv. The "uvx run" syntax is not a valid uvx command.

Copilot uses AI. Check for mistakes.
dist:
runs-on: ubuntu-latest
needs: [lint]
needs: [pre-commit]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
Expand All @@ -37,11 +36,9 @@ jobs:
- run: python -m pip install --upgrade pip build twine
- run: python -m build --sdist --wheel
- run: python -m twine check dist/*


docs:
runs-on: ubuntu-latest
needs: [lint]
needs: [pre-commit]
steps:
- uses: actions/checkout@v6
- name: setup Python
Expand All @@ -52,10 +49,9 @@ jobs:
cache-dependency-path: '**/pyproject.toml'
- run: python -m pip install -e .[docs]
- run: python -m sphinx -b html -W docs docs/_build

PyTest:
runs-on: ubuntu-latest
needs: [lint]
needs: [pre-commit]
strategy:
matrix:
python-version:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
name: Release

on:
release:
types: [published]
workflow_dispatch:

permissions:
id-token: write

jobs:

release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
Expand All @@ -24,14 +19,12 @@ jobs:
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v7
with:
Expand Down
45 changes: 45 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
- id: check-ast
- id: check-toml
- id: check-yaml
- id: check-symlinks
- id: debug-statements
- id: end-of-file-fixer
- id: no-commit-to-branch
args: [--branch, main]
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.29.1
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The django-upgrade hook is using a tag format '1.29.1' without the 'v' prefix, which is inconsistent with the other hooks in this configuration file. The correct tag format should be 'v1.29.1' based on the django-upgrade repository's tagging convention.

Suggested change
rev: 1.29.1
rev: v1.29.1

Copilot uses AI. Check for mistakes.
hooks:
- id: django-upgrade
- repo: https://github.com/hukkin/mdformat
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
- mdformat-ruff
- mdformat-footnote
- mdformat-gfm
- mdformat-gfm-alerts
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.9
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/google/yamlfmt
rev: v0.20.0
hooks:
- id: yamlfmt
ci:
autoupdate_schedule: weekly
skip:
- no-commit-to-branch
5 changes: 0 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-20.04
tools:
python: "3.10"

sphinx:
configuration: docs/conf.py


python:
install:
- method: pip
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![djversion](https://img.shields.io/pypi/djversions/django-health-check.svg)](https://pypi.python.org/pypi/django-health-check/)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://pypi.python.org/pypi/django-health-check/)


This project checks for various conditions and provides reports when anomalous
behavior is detected.

Expand Down Expand Up @@ -104,6 +103,7 @@ threshold settings; otherwise below defaults are assumed.
```

To use Health Check Subsets, Specify a subset name and associate it with the relevant health check services to utilize Health Check Subsets. (New in version 3.18.0)

```python
HEALTH_CHECK = {
# .....
Expand All @@ -117,6 +117,7 @@ To use Health Check Subsets, Specify a subset name and associate it with the rel
```

To add checks on a specific database, it's possible to parameterize `DatabaseBackend` to use a specific database:

```python
HEALTH_CHECK = {
# .....
Expand All @@ -131,6 +132,7 @@ To add checks on a specific database, it's possible to parameterize `DatabaseBac
```

To only execute specific subset of health check

```shell
curl -X GET -H "Accept: application/json" http://www.example.com/ht/startup-probe/
```
Expand All @@ -149,7 +151,7 @@ rabbit server. For example:
BROKER_URL = "amqp://myuser:mypassword@localhost:5672/myvhost"
```

To use the Redis healthcheck, please make sure that there is a variable named ``REDIS_URL``
To use the Redis healthcheck, please make sure that there is a variable named `REDIS_URL`
on django.conf.settings with the required format to connect to your redis server. For example:

```python
Expand All @@ -163,7 +165,7 @@ It can be customized by setting `HEALTHCHECK_CACHE_KEY` to another value:
HEALTHCHECK_CACHE_KEY = "custom_healthcheck_key"
```

Additional connection options may be specified by defining a variable ``HEALTHCHECK_REDIS_URL_OPTIONS`` on the settings module.
Additional connection options may be specified by defining a variable `HEALTHCHECK_REDIS_URL_OPTIONS` on the settings module.

## Setting up monitoring

Expand Down Expand Up @@ -307,7 +309,6 @@ This should yield the following output:

Similar to the http version, a critical error will cause the command to quit with the exit code `1`.


## Other resources

- [django-watchman](https://github.com/mwarkentin/django-watchman) is a package that does some of the same things in a slightly different way.
1 change: 0 additions & 1 deletion health_check/contrib/mail/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ test = [
"boto3",
]
docs = ["sphinx"]
lint = [
"ruff==0.14.10",
]

[tool.flit.module]
name = "health_check"
Expand Down