How to handle package version migrations? #2352
Replies: 1 comment
|
There is a lifecycle hook you can use, but there is an important scope/security distinction:
So a package's v2 release cannot currently silently run a migration against files that its v1 skill previously generated. That is a useful security boundary. For a project you control, the supported shape is an idempotent root-project hook, for example: # consuming project's apm.yml
lifecycle:
post-update:
- type: command
description: "Migrate my-skill output from schema v1 to v2"
command: "python tools/migrate_my_skill_v2.py"
timeoutSec: 60Then validate and explicitly enable it: apm lifecycle validate
apm lifecycle trust
apm updateThe migration should be deterministic and idempotent: detect a v1 marker/filename, write the v2 form atomically, preserve or back up ambiguous input, and record a schema-version marker so a second Also note that lifecycle failures are deliberately non-fatal, so
The current lifecycle documentation and implementation describe the events, discovery locations, trust gate, and non-fatal behavior: If the desired feature is specifically “a dependency package can declare a version-scoped migration that APM runs once,” that would need a new package-level migration contract (including trust, from/to version matching, ownership, rollback, and failure semantics); it is not the current root-project lifecycle mechanism. |
Uh oh!
There was an error while loading. Please reload this page.
If I have created a package version 1.0.0 with a skill that creates files and now I updated this package to 2.0.0 that updates the naming scheme of the generated files, how could I add an "auto-migration" that migrates existing files to the new schema for 2.0.0 (a determistic action)?
All reactions