Skip to content

Latest commit

 

History

History
138 lines (110 loc) · 12.2 KB

dependency_maintenance.md

File metadata and controls

138 lines (110 loc) · 12.2 KB

Dependency Maintenance

KSON's multi-platform build and test architecture depends on a number of external dependencies, all of which must be pinned to deterministic versions for build stability and reproducibility.

These pinned dependencies must be periodically bumped and the resulting build verified for the new pins. This document describes that process.

When to perform this maintenance

We perform this maintenance at the opening of each development cycle, right after a release/X.Y.Z branch is cut and main moves on to the next snapshot version (see the release process).

We do it at the opening of a cycle because version bumps break things, sometimes in ways that are not immediately obvious. Bumping early gives us a whole cycle of development and internal usage to surface any issues.

1. Bump the pins meant to track upstream

These are the dependencies we will keep relatively current. We'd like to upgrade and build each dependency in its own commit so a later bisect has something precise/informative to land on.

2. Leave the pins that are deliberately behind

Some of our dependencies are deliberately not current: they represent our backwards compatibility commitments to the platforms they target, so they should only ever be bumped very intentionally, as part of a product decision to drop support for an old version.

  • The oldest IntelliJ Platform the plugin supports
    • declared in: pluginSinceBuild, platformVersion and javaVersion in tooling/jetbrains/gradle.properties
    • raising it: drops support for older IDEs
    • note: all three move together, since the platform version dictates the minimum JDK
  • The oldest JVM that can consume org.kson:kson
    • declared in: VERSION in KsonJvmTarget.kt
    • raising it: breaks consumers
    • note: this is the bytecode target we publish, deliberately well below the JDK we build with
  • The oldest Python that can install kson-lang
    • declared in: requires-python in lib-python/pyproject.toml, matched by the cimg/python image in .circleci/config.kson
    • note: CI installs the sdist on that floor on purpose, in the test-python-sdist job. Move both together, or the guarantee stops being tested. The sdist itself is built with the Python in lib-python/.python-version, not the image's
    • note: the image pins only the minor version, on purpose: the floor is a Python minor version, not a patch release

3. Sweep for new/missing unpinned dependencies

Audit for new or missed unpinned/floating dependencies that are not yet captured in this doc, and add them where appropriate. We would ideally catch these before they get in, but historically this type of thing has a way of creeping into a project.

Known floats, not yet resolved: none at the moment.

Dependabot

Dependabot keeps us on top of dependency updates that patch vulnerabilities between maintenance passes. When a vulnerability is discovered mid-cycle, Dependabot alerts maintainers and, when possible, opens a PR to bump the affected dependency.

Our target for resolving a vulnerability depends on its severity and whether the affected code ships. Critical, High, and Medium fixes to shipped code aren't complete until they've been released. All other fixes only need to be merged.

With the clock starting on the day an alert comes in, our targets are:

Severity Shipped Not shipped
Critical Released within 14 days Merged within 30 days
High Released within 30 days Merged by the next maintenance pass
Medium Included in the next regular release Merged by the next maintenance pass
Low Merged by the next maintenance pass Merged by the next maintenance pass
  • Shipped: is included in or used to build anything we publish or deploy.
  • Not shipped: only runs in local development or CI, such as test runners and local-only demos.

If you're unsure, treat the affected code as shipped.

Note: Dependabot doesn't cover our Gradle or Pixi dependencies, so for now the maintenance pass described above is our only check on those.

Reviewing Dependabot PRs

A Dependabot PR isn't necessarily safe for our project, so we should still perform our due diligence before merging. This includes:

  • Reviewing the changelog and/or commits associated with the version bump, looking for breaking changes
  • Evaluating the branch with a capable LLM
  • Checking that all copies of the dependency were updated - Dependabot occasionally only finds some of them. If this is the case, open a new, more complete PR and link back to the original, ensuring the original is closed once the new PR is merged

Alternatives to fixing an alert

Addressing a vulnerability typically means bumping a dependency version (as outlined in this document). However, there are times when that isn't possible or doesn't make sense:

  • Defer: if the vulnerability is in a transitive package that we can't easily override, and we expect an upstream fix, we can leave the alert open. Consider opening an issue if it's something that's worth tracking.
  • Dismiss: if we can clearly show a vulnerability doesn't apply to us, we can dismiss the alert. The dismissal needs to provide a clear explanation of why we're comfortable doing so and a link to a public PR or issue.