From f88bbd4a778745ef9d7348fa7aba0e5489f654d9 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 19:58:15 +0000 Subject: [PATCH] Dependabot: one weekly pull request for every ecosystem One multi-ecosystem group, weekly on Monday; every entry joins it with patterns ["*"] and a 7-day cooldown. One npm entry covers /tools and /integrations/vscode. Kept: the @types/vscode ignore, and Cargo minor and patch only (now an ignore of semver-major). Valid against the schemastore dependabot-2.0 schema; .github/tests/test_dependabot.py in the lint job keeps it that way. Documented in docs/releasing.md. Closes #40 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Xj9ekYmyESdZUsW8uWkzgv --- .github/dependabot.yml | 56 +++++++++++++++++++------------- .github/tests/test_dependabot.py | 56 ++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 4 +++ CHANGELOG.md | 7 ++++ docs/releasing.md | 18 ++++++++++ 5 files changed, 118 insertions(+), 23 deletions(-) create mode 100644 .github/tests/test_dependabot.py diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3fbd830..3a21cd7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,27 +1,37 @@ version: 2 -# One grouped pull request per ecosystem per week, so updates land together and -# CI runs once per batch instead of once per package. +# One weekly pull request for every ecosystem (GitHub Actions, Cargo, npm), so CI runs +# once per week's batch and it merges once. Checked by .github/tests/test_dependabot.py. +multi-ecosystem-groups: + weekly: + schedule: + interval: "weekly" + day: "monday" + updates: - - package-ecosystem: github-actions - directory: / - schedule: { interval: weekly } - groups: - actions: { patterns: ["*"] } - - package-ecosystem: cargo - directory: / - schedule: { interval: weekly } - groups: - cargo: { patterns: ["*"], update-types: [minor, patch] } - - package-ecosystem: npm - directory: /tools - schedule: { interval: weekly } - groups: - site-tools: { patterns: ["*"] } - - package-ecosystem: npm - directory: /integrations/vscode - schedule: { interval: weekly } - groups: - vscode: { patterns: ["*"] } + - package-ecosystem: "github-actions" + directory: "/" + multi-ecosystem-group: "weekly" + patterns: ["*"] + # Wait before proposing a new version: a hijacked release is usually found and + # pulled within days. Security updates are not delayed. + cooldown: + default-days: 7 + - package-ecosystem: "cargo" + directory: "/" + multi-ecosystem-group: "weekly" + patterns: ["*"] + cooldown: + default-days: 7 ignore: - # The extension's minimum VS Code version; raise it deliberately. + # Minor and patch only, as before: Cargo majors are raised by hand. + - dependency-name: "*" + update-types: ["version-update:semver-major"] + - package-ecosystem: "npm" + directories: ["/tools", "/integrations/vscode"] + multi-ecosystem-group: "weekly" + patterns: ["*"] + cooldown: + default-days: 7 + ignore: + # The VS Code extension's minimum VS Code version; raise it deliberately. - dependency-name: "@types/vscode" diff --git a/.github/tests/test_dependabot.py b/.github/tests/test_dependabot.py new file mode 100644 index 0000000..422da2b --- /dev/null +++ b/.github/tests/test_dependabot.py @@ -0,0 +1,56 @@ +"""Dependabot sends one weekly pull request for every ecosystem (#40). + +Every `updates` entry must belong to the `weekly` multi-ecosystem group with +`patterns: ["*"]` and no schedule or groups of its own, keep a 7-day cooldown, and +keep the rules it had before the move: Cargo minor and patch only, and the +`@types/vscode` ignore. The file is also valid against +https://json.schemastore.org/dependabot-2.0.json (checked when it was written; CI +stays offline). +""" +import pathlib +import unittest + +import yaml + +CONFIG = pathlib.Path(__file__).resolve().parents[1] / "dependabot.yml" + + +class DependabotConfig(unittest.TestCase): + def setUp(self): + self.cfg = yaml.safe_load(CONFIG.read_text()) + + def test_one_weekly_group(self): + groups = self.cfg["multi-ecosystem-groups"] + self.assertEqual(list(groups), ["weekly"]) + self.assertEqual(groups["weekly"]["schedule"], {"interval": "weekly", "day": "monday"}) + + def test_every_entry_is_in_the_weekly_group(self): + for entry in self.cfg["updates"]: + with self.subTest(entry=entry["package-ecosystem"]): + self.assertEqual(entry.get("multi-ecosystem-group"), "weekly") + self.assertEqual(entry.get("patterns"), ["*"]) + self.assertNotIn("schedule", entry) + self.assertNotIn("groups", entry) + self.assertEqual(entry.get("cooldown", {}).get("default-days"), 7) + + def test_ecosystems_and_folders_are_unchanged(self): + seen = set() + for entry in self.cfg["updates"]: + dirs = entry.get("directories") or [entry["directory"]] + seen |= {(entry["package-ecosystem"], d) for d in dirs} + self.assertEqual( + seen, + {("github-actions", "/"), ("cargo", "/"), ("npm", "/tools"), ("npm", "/integrations/vscode")}, + ) + + def test_previous_rules_are_kept(self): + by = {e["package-ecosystem"]: e for e in self.cfg["updates"]} + self.assertIn( + {"dependency-name": "*", "update-types": ["version-update:semver-major"]}, + by["cargo"].get("ignore", []), + ) + self.assertIn({"dependency-name": "@types/vscode"}, by["npm"].get("ignore", [])) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2077f89..b80046e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -35,6 +35,10 @@ jobs: - run: cargo xtask schema --check - name: Action script tests run: python3 -m unittest discover -s packaging/action -v + - name: Dependabot configuration test + run: | + python3 -c "import yaml" 2>/dev/null || python3 -m pip install --user --break-system-packages pyyaml==6.0.2 + python3 -m unittest discover -s .github/tests -v test: strategy: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a5f04b..8a11a7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ the JSON schema is versioned separately (`schema_version` in round files). ## Unreleased +### Maintenance + +- Dependabot sends one weekly pull request for every ecosystem (GitHub Actions, + Cargo, npm) instead of up to four, waits 7 days before proposing a new version + (security updates are not delayed), and still updates Cargo by minor and patch only. + A test in CI keeps the configuration that way; `docs/releasing.md` describes it. + ### Interop with overfull - `docs/interop.md` ยง6 records that overfull 3.3.0 fixed its differences O1 and O2, diff --git a/docs/releasing.md b/docs/releasing.md index 08d7025..4f5821f 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -68,6 +68,24 @@ of release files with: python3 packaging/check-release-files.py ``` +## Dependency updates + +Dependabot opens one pull request a week, on Monday, for every ecosystem together: +GitHub Actions, Cargo, and npm in `tools/` and `integrations/vscode/` +(`.github/dependabot.yml`, one multi-ecosystem group named `weekly`). CI runs once on +the batch and it merges once. Nothing merges it automatically; review and merge it +like any other pull request. + +- New versions wait 7 days before Dependabot proposes them (`cooldown`), since a + hijacked release is usually found and pulled within days. Security updates are + not delayed. +- Cargo gets minor and patch updates only; raise a Cargo major by hand. +- `@types/vscode` is never updated automatically: it sets the extension's minimum + VS Code version, which is raised on purpose. + +`.github/tests/test_dependabot.py` (run by the lint job) keeps every entry in the +`weekly` group and keeps these rules. + ## Optional: Homebrew tap A tap is an ordinary repository on the same GitHub account, so no new account is