Skip to content

fix(apm): maintain ai-toolkit pin via Renovate + materialize workflow - #199

Merged
DevSecNinja merged 7 commits into
mainfrom
feat/apm-renovate-materialize
Jun 21, 2026
Merged

fix(apm): maintain ai-toolkit pin via Renovate + materialize workflow#199
DevSecNinja merged 7 commits into
mainfrom
feat/apm-renovate-materialize

Conversation

@DevSecNinja

Copy link
Copy Markdown
Owner

Why

Two problems surfaced when I test-dispatched the APM Sync workflow:

  1. apm update can't bump exact tag pins. Verified live against .github's apm.yml (ai-toolkit#v0.1.1): apm outdated says v0.1.1 → v0.2.0 outdated, but apm update re-resolves the same exact tag and leaves it at v0.1.1. So the scheduled apm-sync-via-apm update model is a no-op for tag-pinned deps — which is everything, since rangeStrategy: "pin" is the org default.
  2. The install step 404'd. The caller passed apm-version: "0.21.0", but microsoft/apm release tags are vX.Y.Z, so the aka.ms/apm-unix installer built …/download/0.21.0/… → 404. (This was the failing CI run.)

The fix: let Renovate maintain the tag (as you suggested)

  • .renovate/customManagers.json5 — new custom manager tracking owner/repo#vX.Y.Z tag pins under dependencies.apm in apm.yml against github-tags. Renovate now opens a normal v0.1.1 → v0.2.0 PR — version-aware, with the existing 14-day soak, grouping, and changelog links.
  • .github/workflows/apm-materialize.yml — new workflow: on any PR that touches apm.yml, run apm install to re-resolve apm.lock.yaml and redeploy the primitives, then commit the result back onto the PR branch (App token → CI re-runs). This completes Renovate's text-only bump. Installs apm via pip install apm-cli (clean on ubuntu-24.04, no v-prefix gotcha).
  • Removed apm-sync-caller.yml — the broken scheduled caller (feat(apm): activate apm-sync on the .github consumer #195), superseded by the above.
  • Rewrote docs/apm-sync-onboarding.md to the new model.

Why a workflow and not a Renovate postUpgradeTask: this org is Mend-hosted Renovate (confirmed by the MEND_DHI_* secrets), which doesn't run arbitrary postUpgrade commands.

Verified locally

  • apm install with the pin bumped to #v0.2.0 re-locks to v0.2.0 and deploys the new instruction primitive (.github/instructions/devsecninja-conventions.instructions.md). ✅
  • pip install apm-cli==0.21.0 → working apm. ✅
  • actionlint, yamllint, yamlfmt, dprint all pass on the new files (formatted to match). ✅

Notes

  • The apm-sync.ymlreusable (released in v1.8.0) still exists; it's now superseded by this model for tag-pinned consumers. Left in place to avoid churn — can be deprecated in a follow-up.
  • The materialize workflow is currently repo-local (it pushes to the PR branch, so it isn't a clean workflow_call reusable yet). If a second consumer adopts it, I'd extract a reusable + config-sync template.
  • ⚠️ The materialize step pushes to the Renovate PR branch with the RELEASE_PLEASE_APP_* identity — the naming-cleanup is already tracked in Rename the "Release Please" GitHub App to a generic automation identity #197.

Add a custom manager that tracks `owner/repo#vX.Y.Z` tag pins under
dependencies.apm in apm.yml against github-tags. Renovate now opens a PR
bumping e.g. DevSecNinja/ai-toolkit v0.1.1 -> v0.2.0, version-aware and
within the existing soak/grouping rules.
This is the correct bumper for exact-tag-pinned APM deps: `apm update`
only re-resolves the same exact tag, so it never advances a pin. The
companion apm-materialize.yml workflow runs `apm install` on the bump PR
to refresh apm.lock.yaml and redeploy the primitives.
The scheduled `apm update` caller is a no-op for exact-tag-pinned deps
(apm update never advances an exact pin) and additionally failed at the
install step (it passed a bare `0.21.0`; the microsoft/apm release tags are
`vX.Y.Z`, so the installer built a 404 URL). Replaced by Renovate
(maintains the pin) + apm-materialize.yml (runs apm install on the bump PR).
On any PR that changes apm.yml, run `apm install` to materialize the
pinned APM packages — re-resolving apm.lock.yaml and redeploying the
primitives into the harness directories — and commit the result back to
the PR branch. This completes Renovate's apm.yml tag bumps, which only
edit the manifest text.
- Installs the apm CLI from PyPI (apm-cli), pinned + Renovate-tracked.
- Pushes via the App token so required CI re-runs on the updated PR.
- Skips forks (can't push to their branches) and no-ops without apm.yml.
ubuntu-24.04 ships python3 + pip, so the extra setup-python step (with an
unverified action pin) is unnecessary. Install apm-cli directly with pip.
Rewrite the APM sync onboarding to describe the actual model: Renovate
maintains the apm.yml tag pin and apm-materialize.yml runs `apm install`
on the bump PR. Replaces the previous scheduled `apm update` description,
which is a no-op for exact-tag-pinned dependencies.
The custom-manager governance test requires every datasource a custom
manager emits to have label + semanticCommitScope rules. Add github-tags
coverage (mirroring github-releases): a renovate/github-tag label and a
github-tag commit scope, plus the label in the shared catalog.
@DevSecNinja
DevSecNinja merged commit 5f9bb48 into mainJun 21, 2026
@DevSecNinja
DevSecNinja deleted the feat/apm-renovate-materialize branch June 21, 2026 14:18
Sign up for freeto 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.

1 participant

@DevSecNinja