Skip to content

Commit ce61c8d

Browse files
authored
Fix 2191 (#2192)
* add dev branch audit file * Add version-controlled Dependabot config and document update policy Closes #2191. - Add .github/dependabot.yml managing the uv (Python) and github-actions ecosystems: weekly schedule, grouped patch/minor bumps, and ignore rules for major-version updates of the deliberately major-capped dependencies (urllib3, h2, hyperframe, priority). Docker is intentionally not managed in this repo (production images are built outside it). - Expand docs/uvlock.rst with a "Dependabot and Automated Updates" section codifying the review policy: uv.lock-only PRs are the fast lane (merge on green CI), pyproject.toml-touching PRs are the manual lane (review the rewritten constraint), with just update-uvlock remaining canonical. Note: This work was completed with AI assistance (Claude Code).
1 parent d885fe7 commit ce61c8d

3 files changed

Lines changed: 191 additions & 0 deletions

File tree

.audit/oberstet_fix_2191.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- [ ] I did **not** use any AI-assistance tools to help create this pull request.
2+
- [x] I **did** use AI-assistance tools to *help* create this pull request.
3+
- [x] I have read, understood and followed the project's AI_POLICY.md when creating code, documentation etc. for this pull request.
4+
5+
Submitted by: @oberstet
6+
Date: 2026-06-13
7+
Related issue(s): #2191
8+
Branch: oberstet:fix_2191

.github/dependabot.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Dependabot configuration for Crossbar.io
2+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
3+
#
4+
# Policy (see docs/uvlock.rst, section "Dependabot and Automated Updates"):
5+
# - PR touching ONLY uv.lock -> low risk, merge on green CI (fast lane)
6+
# - PR also touching pyproject.toml -> a declared constraint was rewritten,
7+
# review the changelog before merging (manual lane)
8+
#
9+
# `just update-uvlock` remains the canonical way we refresh the lockfile;
10+
# Dependabot is the notifier + CI gate, not the source of truth for resolution.
11+
12+
version: 2
13+
14+
updates:
15+
# ---------------------------------------------------------------------------
16+
# Python dependencies (uv / uv.lock + pyproject.toml)
17+
#
18+
# NOTE: `package-ecosystem: "uv"` requires Dependabot's native uv support.
19+
# Verify against current Dependabot docs if no PRs are generated.
20+
# ---------------------------------------------------------------------------
21+
- package-ecosystem: "uv"
22+
directory: "/"
23+
schedule:
24+
interval: "weekly"
25+
day: "monday"
26+
time: "06:00"
27+
timezone: "Europe/Berlin"
28+
open-pull-requests-limit: 10
29+
labels:
30+
- "dependencies"
31+
- "python"
32+
commit-message:
33+
prefix: "deps"
34+
include: "scope"
35+
36+
# Group low-risk patch + minor bumps into a single PR to cut noise.
37+
# A grouped PR that ends up touching pyproject.toml goes to the manual
38+
# review lane as a whole (see docs/uvlock.rst).
39+
groups:
40+
python-minor-patch:
41+
applies-to: version-updates
42+
update-types:
43+
- "minor"
44+
- "patch"
45+
46+
ignore:
47+
# Deliberately MAJOR-capped deps in pyproject.toml: never auto-cross a
48+
# major boundary we set on purpose. These must be bumped by hand after
49+
# reviewing the upstream migration guide (e.g. urllib3 1.x -> 2.x changes
50+
# TLS/pyOpenSSL behavior, directly relevant to a TLS-terminating router).
51+
# Security advisories still come through regardless of these ignores.
52+
- dependency-name: "urllib3" # pyproject: >=1.26.14,<1.27
53+
update-types: ["version-update:semver-major"]
54+
- dependency-name: "h2" # pyproject: >=3.2.0,<4.0.0
55+
update-types: ["version-update:semver-major"]
56+
- dependency-name: "hyperframe" # pyproject: >=5.2.0,<6.0.0
57+
update-types: ["version-update:semver-major"]
58+
- dependency-name: "priority" # pyproject: >=1.3.0,<2.0
59+
update-types: ["version-update:semver-major"]
60+
# The following are MINOR-capped on purpose. We do NOT hard-ignore them
61+
# here (a bump still surfaces as a PR), but because any such bump must
62+
# rewrite the pyproject.toml cap, it lands in the manual review lane:
63+
# idna >=2.5,<2.6
64+
# eth-abi >=5.1.0,<5.2.0
65+
# parsimonious >=0.9.0,<0.11.0
66+
67+
# ---------------------------------------------------------------------------
68+
# GitHub Actions workflows (.github/workflows/*.yml)
69+
# ---------------------------------------------------------------------------
70+
- package-ecosystem: "github-actions"
71+
directory: "/"
72+
schedule:
73+
interval: "weekly"
74+
day: "monday"
75+
time: "06:00"
76+
timezone: "Europe/Berlin"
77+
open-pull-requests-limit: 5
78+
labels:
79+
- "dependencies"
80+
- "ci"
81+
commit-message:
82+
prefix: "ci"
83+
include: "scope"
84+
groups:
85+
github-actions:
86+
patterns:
87+
- "*"
88+
89+
# ---------------------------------------------------------------------------
90+
# Docker base images -- DEFERRED.
91+
# There is currently no production Dockerfile committed in this repo (only
92+
# test/ and docs-cfx/ scaffolding). Enable this block, pointed at the right
93+
# directory, once a production Dockerfile lands in the tree.
94+
# ---------------------------------------------------------------------------
95+
# - package-ecosystem: "docker"
96+
# directory: "/"
97+
# schedule:
98+
# interval: "weekly"
99+
# day: "monday"
100+
# time: "06:00"
101+
# timezone: "Europe/Berlin"
102+
# open-pull-requests-limit: 5
103+
# labels:
104+
# - "dependencies"
105+
# - "docker"
106+
# commit-message:
107+
# prefix: "docker"
108+
# include: "scope"

docs/uvlock.rst

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,81 @@ For production Docker images, use the frozen lock file:
186186
This ensures the production container has exactly the same dependencies that were
187187
tested in CI and verified during development.
188188

189+
Dependabot and Automated Updates
190+
--------------------------------
191+
192+
Crossbar.io uses `Dependabot <https://docs.github.com/en/code-security/dependabot>`_
193+
to track upstream dependency releases. The configuration is version-controlled in
194+
``.github/dependabot.yml`` (not just GitHub UI settings), so the bot's behavior is
195+
explicit, reviewable, and reproducible.
196+
197+
Because we maintain a two-tier dependency model — abstract ``>=`` floors (with
198+
deliberate caps) in ``pyproject.toml``, and exact pins in ``uv.lock`` — Dependabot
199+
PRs are reviewed using a simple rule based on **which files the PR touches**.
200+
201+
The two-lane review policy
202+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203+
204+
**Fast lane — PR touches** ``uv.lock`` **only:**
205+
206+
The new version fits *within* our existing ``pyproject.toml`` constraints. This is
207+
almost always a transitive dependency, or a direct one with headroom under its cap.
208+
Our declared compatibility contract is unchanged.
209+
210+
- **Action:** merge once CI is green.
211+
212+
**Manual lane — PR touches** ``pyproject.toml`` **as well:**
213+
214+
Dependabot had to **rewrite a declared constraint** to let the new version in —
215+
usually to cross an upper cap we set on purpose. This is a change to our
216+
compatibility contract, not just a re-pin.
217+
218+
- **Action:** review before merging. Read the upstream changelog/migration guide,
219+
check *how* the constraint was rewritten (did it keep a sane cap?), and apply
220+
extra scrutiny to major-version bumps of TLS/crypto-adjacent dependencies
221+
(e.g. ``urllib3``, ``pyopenssl``, ``cryptography``) — green CI is necessary but
222+
not sufficient for those, since CI may not exercise every TLS, proxy, or retry
223+
code path.
224+
225+
.. note::
226+
227+
Patch and minor bumps are **grouped** into a single PR to reduce noise. If a
228+
grouped PR happens to touch ``pyproject.toml``, the whole PR is treated as the
229+
manual lane.
230+
231+
Ignored and capped dependencies
232+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
233+
234+
``.github/dependabot.yml`` **ignores major-version updates** for dependencies that
235+
carry a deliberate major cap in ``pyproject.toml`` (``urllib3``, ``h2``,
236+
``hyperframe``, ``priority``). We never want to be auto-nudged across a major
237+
boundary we pinned on purpose; those bumps are done by hand after reviewing the
238+
upstream migration guide.
239+
240+
A few dependencies are capped at the **minor** level instead (``idna``,
241+
``eth-abi``, ``parsimonious``). These are not hard-ignored, but any bump rewrites
242+
their ``pyproject.toml`` cap and therefore lands in the manual review lane anyway.
243+
244+
.. note::
245+
246+
These ignore rules only suppress *routine version updates*. Dependabot
247+
**security advisories** still raise PRs for vulnerable versions regardless of
248+
the caps above — security fixes are never silently held back.
249+
250+
Relationship to ``just update-uvlock``
251+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
252+
253+
Dependabot is the **notifier and CI gate**, not the source of truth for how the
254+
lockfile is resolved. The canonical way we refresh ``uv.lock`` remains:
255+
256+
.. code-block:: bash
257+
258+
just update-uvlock
259+
260+
which pins resolution to the lowest supported Python (3.11) for widest
261+
compatibility. When in doubt — for example, to reconcile several Dependabot PRs at
262+
once — re-run ``just update-uvlock`` locally and commit the result.
263+
189264
References
190265
----------
191266

0 commit comments

Comments
 (0)