Stability and versioning policy#

pytest-queryguard follows Semantic Versioning. This page says what that covers, how deprecations work, and which tests enforce it.

What is public#

The public API is everything below. Changing it incompatibly needs a major release (see "Version numbers"); tests/test_public_api.py fails when it changes by accident.

What is not public#

Version numbers#

While the version is below 1.0, a minor release may also contain breaking changes. They are still deprecated first whenever that is possible, and are always listed under "Changed" or "Removed" in the changelog.

Pre-1.0 clause for new checks. While the version is 0.x, a minor release may change the defaults of newly added detectors: switch a new check on, or let it fail tests by default, instead of introducing it off or as a warning first. Every such change is named in the introduction at the top of the changelog entry and listed first under "Changed", in a "Behavior changes" group, with the option that turns it off. The 0.4.0rc1 changelog entry is an example: the column-load kind is on by default, the index advisor is on whenever the index check is on, and the index check fails tests on SQLite. From 1.0 on, the rules above apply strictly: a new check is off or only warns until a later minor release, and a change of default needs a major release.

Deprecation policy#

  1. The old name or behaviour keeps working and starts emitting a QueryGuardDeprecationWarning (a DeprecationWarning subclass, exported from pytest_queryguard) that names the replacement and the release in which it will be removed. It is not a QueryGuardWarning, so a filterwarnings entry that turns findings into errors, or ignores them, does not catch it; pytest shows DeprecationWarning in the warnings summary by default. Command-line flags and ini options print the same warning once per run.
  2. The deprecation is listed under "Deprecated" in the changelog, and the documentation points to the replacement.
  3. It stays for at least one minor release (two, from 1.0 on) and at least three months after the release that deprecated it, whichever is longer.
  4. It is removed in the next major release (before 1.0: in a minor release), listed under "Removed".

A security or data-loss fix may skip these steps; the changelog says so.

A new finding kind, or a stricter version of an existing check, first appears in a release where it can be turned off with an ini option, and the changelog says how. Before 1.0 it may be on by default (see the pre-1.0 clause above).

Experimental#

Options, finding kinds and markers listed here are public to use but exempt from the deprecation policy: a minor release may change their values, defaults, labels or messages, or remove them, with a changelog entry under "Changed" or "Removed" and no deprecation period. The ini option is marked EXPERIMENTAL in pytest --help.

Everything else listed under "What is public" follows the deprecation policy. tests/test_public_api.py still snapshots the experimental ini option and its default, so a change to it is deliberate and visible in review.

Failing open#

A bug inside pytest-queryguard must never change the outcome of a test whose result the plugin does not decide, error a test, or end the session with an INTERNALERROR:

tests/test_fault_injection.py makes each of these steps raise in turn and checks the outcome of every test of a small suite.

How this is enforced#

Edit this page on GitHub