Skip to content

Environment dependencies policy

Purpose

This policy describes how comver maintainers consume third-party packages.

Scope

This policy applies to all comver maintainers and all third-party packages used in the comver project.

Policy

comver contributors must follow these guidelines when consuming third-party packages:

General

  • Only use third-party packages necessary for the functionality of comver.
  • Use maintained third-party packages with a reasonably good reputation.
  • Prefer small, single-purpose packages over large, complex ones.
  • Implement small functionalities within the project instead of using a third-party package (unless the third-party package is lightweight, well-maintained and has a good reputation).
  • Avoid using third-party packages with known security vulnerabilities.
  • Before sending changes with new dependencies, make sure all automated tests pass (prek checks and continuous integration pipelines)

Versioning

  • Use package manager to manage third-party dependencies.
  • Lock all of the dependencies (including developer tools) before merging the changes.
  • Specify only major versions for all stable third-party packages (version 1.x.y or above) unless minor or patch versions are required for compatibility or functionality.
  • Specify major, minor, and patch versions for all pre-release third-party packages (version 0.x.y).
  • Use the latest major version of all third-party packages whenever possible.
  • Tools outside of the lock file follow the same 7 day cooldown (GitHub Actions pinned to commit SHAs by Dependabot, the newest Trivy release at least 7 days old), while components of GitHub-hosted runners (e.g. the actions/setup-python interpreter, git, gh) follow the runner image updates. Python minor version is set by cog, uv version by uv.lock.

Procedure

When adding a new third-party package to comver, contributors must follow these steps:

  1. Is the package necessary for the functionality of comver?
  2. How stable is the package? Is it a pre-release version (0.x.y) or a stable version (1.x.y or above)?
  3. Research the package. Is it well-maintained? Does it have a good reputation?
  4. Choose a compatible version of the package. Use the latest version whenever possible.
  5. Update [project].dependencies in pyproject.toml, then run uv lock to lock the dependencies.

Vulnerabilities

uv.lock is the single source of dependency versions and it is updated only by Dependabot (or when pyproject.toml changes):

  • version updates wait 7 days after a release (cooldown), so freshly published (possibly malicious) releases are not used
  • security updates fix vulnerable packages without the cooldown, as soon as the advisory is published

uv audit (prek and CI) fails on known vulnerabilities, resolve them as follows:

Situation Action
Fix released Merge the Dependabot security update (or uv lock --upgrade-package)
Fix capped by a dependency Bump or replace the dependency
No fix released ignore-until-fixed in [tool.uv.audit] with a reason
Not applicable to comver ignore in [tool.uv.audit] with a reason

Archived or deprecated packages

When a third-party package is discontinued, the comver maintainers must ensure replacement of the package with a suitable alternative.

Enforcement

This policy is enforced by the comver maintainers. Maintainers are expected to review each other's code changes to ensure that they comply with this policy.

Exceptions

Exceptions to this policy may be granted by the comver maintainers/leaders on a case-by-case basis.

Credits

This policy was adapted from the Kubescape Community ⧉ and Project Capsule ⧉