Skip to content
OpenAgentsbeta
text
1# Dependency Upgrader — Workflow
2
3Audits outdated dependencies, upgrades them in ascending risk order, runs the test
4suite after each upgrade, and opens one PR per major (potentially breaking) version
5bump — so a reviewer can accept or reject each risky upgrade independently, while
6patch/minor bumps land together in a single low-risk PR.
7
8Inputs: `package_manager` (auto-detected if omitted), `include_major` (default
9`true`), `max_prs` (default `5`).
10
11## Step 1 — Detect the package manager and list outdated deps
12
13Detect from lockfile/manifest presence if not given explicitly: `package-lock.json` →
14npm, `yarn.lock` → yarn, `pnpm-lock.yaml` → pnpm, `poetry.lock` → poetry,
15`requirements.txt` → pip, `Cargo.lock` → cargo, `go.sum` → go modules.
16
17Run the manager's outdated-listing command and capture, per dependency: current
18version, latest version, and version type of the jump (patch/minor/major per semver).
19
20| manager | outdated command |
21|---|---|
22| npm | `npm outdated --json` |
23| yarn | `yarn outdated --json` |
24| pnpm | `pnpm outdated --format json` |
25| pip/poetry | `poetry show --outdated` (or `pip list --outdated`) |
26| cargo | `cargo outdated --format json` (requires `cargo-outdated`) |
27| go | `go list -u -m -json all` |
28
29## Step 2 — Check for known vulnerabilities
30
31Run the manager's audit command (`npm audit --json`, `pip-audit`, `cargo audit`, etc.)
32if available. Any dependency with a known vulnerability gets upgraded regardless of
33`include_major`/risk ordering — security fixes jump the queue and get their own PR
34labeled accordingly, even if it's a major bump.
35
36## Step 3 — Order by risk
37
381. **Patch bumps** (x.y.Z) — lowest risk, bundle all of these into a single PR.
392. **Minor bumps** (x.Y.z) — should be backward compatible per semver; bundle into a
40 second PR, but read each package's release notes for the range being skipped and
41 flag anything that mentions deprecations.
423. **Major bumps** (X.y.z) — one PR **per package**, since these can be breaking and
43 need independent review/rollback. Skip this tier entirely if `include_major` is
44 `false`.
454. **Security fixes** (from Step 2) — their own PR(s), opened first regardless of
46 where they'd otherwise sort, clearly labeled as a security fix with the
47 CVE/advisory reference.
48
49Stop opening new PRs once `max_prs` is reached; report which upgrades were deferred
50and why (not silently dropped).
51
52## Step 4 — For each PR: upgrade, test, document
53
541. Create a branch: `build/upgrade-<package>-<new-version>` (or
55 `build/upgrade-deps-patch` for the bundled patch/minor PRs), per
56 `openagents/commit-conventions` naming if that package is present.
572. Apply the version bump via the package manager (not by hand-editing the lockfile).
583. Run the full test suite. If it fails:
59 - First, check whether the failure is caused by the upgrade itself (read the
60 failure, check the new package's changelog for a matching breaking change) vs.
61 unrelated/flaky.
62 - If caused by the upgrade and a straightforward fix is evident (e.g. a renamed
63 import, an updated config key documented in the changelog), apply it and re-run.
64 - If the fix isn't straightforward, do not force it — stop this specific upgrade,
65 note the failure and likely cause in the PR/report, and move to the next
66 dependency rather than shipping a red PR.
674. For major bumps: read the package's changelog/migration guide for the skipped
68 version range and summarize relevant breaking changes in the PR description, even
69 if tests pass — tests may not cover every affected code path.
705. Commit using the project's commit conventions if defined; otherwise
71 `build(deps): bump <package> from <old> to <new>`.
726. Open the PR with a description covering: what changed, why (patch/minor/major/
73 security), test result, and — for majors — the changelog summary and any manual
74 verification still recommended before merge.
75
76## Step 5 — Report
77
78At the end of the run, summarize: PRs opened (with links), upgrades deferred (and
79why — test failure, hit `max_prs`, needs `include_major`), and any dependency with a
80known vulnerability that could *not* be upgraded (e.g. because a fix isn't released
81yet) — flag these clearly since they need a different mitigation.
82
83## Stop conditions
84
85- No outdated dependencies found → report this and stop; don't open empty PRs.
86- Package manager can't be detected and wasn't given explicitly → ask rather than
87 guessing, since running the wrong manager's commands can corrupt the lockfile.
88- A major upgrade's test failures point to a large, cascading breaking change (e.g. a
89 framework's rewritten API) that would require substantial rework → stop that
90 specific upgrade, document the scope of what changed, and let a human decide whether
91 to invest in it, rather than attempting a large rewrite unprompted.
92

Keyboard shortcuts

Focus search
/
Go to Explore
ge
Go to Home
gh
Go to Tags
gt
Go to Collections
gc
Show this help
?
Close suggestions or this dialog
Esc