Skip to content

Add a dependency-upgrade agent skill - #864

Open
janhoy wants to merge 10 commits into
apache:mainfrom
janhoy:dependency-upgrade-skill
Open

janhoy wants to merge 10 commits into
apache:mainfrom
janhoy:dependency-upgrade-skill

Conversation

@janhoy

@janhoy janhoy commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Over in #855 I started on Dependabot setup for this repo. This PR is a fuller answer: not Dependabot or a skill, but a split by who can actually do the work.

Dependabot owns GitHub Actions. .github/dependabot.yml — monthly, grouped into one PR, 7-day cooldown. Cheap to review, no follow-up work. This overlaps #855, which can be closed or trimmed to its other ecosystems once this lands.

A skill owns the application dependencies. A Go module bump is not self-contained: it needs CRDs and RBAC regenerated, dependency_licenses.csv refreshed, the test fixtures a Kubernetes API bump invalidates repaired, and an artifacthub.io/changes entry written. Dependabot can do none of that, so those stay one reviewed sweep. The skill lives in .agents/skills/, the vendor-neutral location most assistants read directly; it is markdown only, no scripts, and a human can follow the same checklist.

make list-upgrades answers "what has moved?" New script hack/list-upgrades.sh: direct Go modules, new majors, the Makefile's pinned tools and the envtest assets, all read from the Go module proxy — then the image tags and version strings no tool can see, printed as a hand-check list. Read-only, always exits 0, deliberately not part of make lint.

Run against main today it finds 13 module updates, three stale tool pins, and two majors we are behind: Helm v4 and kustomize v5. Nothing would otherwise have reported those — go list -u cannot see a new major, because under semantic import versioning it is a different module path. Patch and minor bumps are always taken; a major gets a cost assessment and an explicit decision.

One thing worth a reviewer's eye: the note in dependabot.yml about the ASF allowlisting actions by commit SHA (apache/infrastructure-actions), which already bit us in #857.

Dependency upgrades are done as one sweeping pass rather than a stream of
single-dependency PRs, because each bump otherwise needs the same manual
follow-up: regenerating CRDs and RBAC, regenerating dependency_licenses.csv,
repairing test fixtures that a Kubernetes API bump invalidates, and writing the
artifacthub.io/changes entries that users actually read. The license list and the
chart changelogs are the parts that get forgotten.

The procedure is written up as an Agent Skill so an assistant can carry it out,
and so a human can follow the same checklist. It is markdown only and contains no
scripts: it names the make targets to run, in what order, and why, including the
traps that are not obvious from the Makefile (a stale untracked vendor/ breaks
hack/check_license.sh locally while CI stays green; the Go version gate rejects a
newer toolchain as hard as an older one; tool installs are skipped when a stale
binary exists in bin/; the license list must be generated with the Linux/amd64
prefix or CI's byte-exact diff fails; the lint sub-targets share a scratch
directory and cannot run under make -j).

The skill lives in .agents/skills/, the vendor-neutral location read directly by
most assistants. Claude Code only discovers skills under .claude/skills/ and has
no setting to register another directory, so it needs a local shim. That shim is
deliberately not kept in tree: it would mean a hand-maintained duplicate per
skill, each with a copy of the frontmatter to keep in sync. Instead .claude/ is
gitignored and dev-docs/dependency-upgrades.md describes the local options,
recommending a SessionStart hook that mirrors .agents/skills/ into .claude/skills/
on every session. A symlink is documented as the one option to avoid, since
Claude Code's skill discovery and validation do not resolve symlinks even though
execution does.

Also excludes .agents and .claude from the source release tarball, alongside the
existing .github and .run exclusions, so agent tooling does not ship in an ASF
source release.
Handle major version bumps special
Offer to push
Dependabot takes GitHub Actions, "make list-upgrades" detects what the
skill owns, and the pins no tool can see are listed for hand-checking.
Hardcoded line numbers go stale silently; patterns report when they stop
matching, and printing the matched text shows the current value.
Report failures per section instead of aborting silently, resolve package
paths to their module before probing majors, compare versions rather than
strings, and correct the Claude Code and -mod=readonly claims in the docs.
It is not a dependency: nothing links kubeVersion to the k8s.io/* libraries,
so a sweep must never move it. Report the gap between declared, built and
tested instead.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Failed version lookups can incorrectly report envtest assets as current or indicate that no newer major versions exist.

2 open issues
What changed in this PR

This PR splits dependency maintenance between Dependabot for GitHub Actions and a documented agent skill for coordinated application-dependency upgrades.

Changes:

  • Configures monthly grouped Actions updates with a seven-day cooldown and ASF approval guidance.
  • Adds make list-upgrades to report module, major-version, tool and envtest updates.
  • Documents the upgrade workflow and excludes agent configuration from source release bundles.
File Description
Makefile Adds the list-upgrades target.
hack/​release/​artifacts/​bundle_source.sh Excludes agent files from source bundles.
hack/​list-upgrades.sh Reports available upgrades and manual-check pins.
dev-docs/​dependency-upgrades.md Explains upgrade ownership, procedures and assistant setup.
AGENTS.md Points agents to the skill and discovery command.
.gitignore Ignores local Claude configuration.
.github/​dependabot.yml Schedules grouped GitHub Actions updates.
.agents/​skills/​dependency-upgrade/​SKILL.md Defines the coordinated dependency-upgrade procedure.

Review effort: Balanced

Comment thread hack/list-upgrades.sh Outdated
Comment thread hack/list-upgrades.sh Outdated
@janhoy
janhoy requested review from HoustonPutman and epugh October 24, 2026 20:56
@janhoy

janhoy commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

I have just tested the new SKILL on current main, and it will report some findings and put put the resulting dep upgrade PR. Here is an initial screenshot of how it works:
Skjermbilde 2026-10-24 kl  22 51 02

@janhoy

janhoy commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Important: this sweep crosses real advisories — five in golang.org/x/net fixed in 0.60.0 (we were on 0.56.0) and two in golang.org/x/text. Let me check reachability rather than guess, since that decides kind: security.

I'm pleased to see that the SKILL is intelligent when writing Changelog entries, and does a reachability analysis to decide correct change type.

@janhoy

janhoy commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Cross linking #865 which is the PR the SKILL produced

Annotate candidates needing a newer Go than go.mod pins, and report a failed
successor or envtest lookup as unchecked rather than as nothing-to-do.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants