Repository navigation
feat(install): test unpublished SDK extensions with extensions = { path } - #485
Merged
Merged
Conversation
…th }
A registry program or stack dependency in arete.toml can name a local SDK
extension bundle, `extensions = { path = "<dir>" }`. `a4 install` stages it
the way `a4 sdk create --extensions` does, in place of the published
extension for the bundle's target, and records its content hash as the lock
entry's `local_extension`; every published pin stays.
The override is not resolution input, so adding or removing it leaves
arete.lock fresh. `a4 install --check`, `a4 protocol deploy` and
`a4 dev promote --check` (new `local-extension` item) fail while it is set;
`a4 install --locked` refuses while arete.toml has one, and once it is
removed restores the published extension and clears the marker.
`a4 dev up` watches each bundle directory and regenerates only that
dependency's SDK when it changes, without redeploying anything else.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The PR appears safe to merge; the protocol-only deploy failure is fixed. SummaryAdds local SDK extension overrides for registry program and stack dependencies.
|
…e on every bundle change A bundle may share a directory with the protocol or stack sources: a change counts as extension-only only for an existing file those watches don't cover. The dev regeneration reads only the selected bundles and always regenerates, since the content hash leaves out fields such as extensionApi.
A bundle directory may hold the generated SDK (path = "."); walking it made each regeneration trigger the next. Watch the bundle's extensions.json, the files it lists and the conventional entries instead.
# Conflicts: # cli/src/commands/dev/promote.rs # docs/src/content/docs/cli/local-development.mdx
…ml, not only one in the lock
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Test an SDK extension in your app before publishing it, without
a4 sdk create:a4 installstages the local bundle in place of the published extension for the bundle's target. It uses the same resolution asa4 sdk create --extensions: anextensions.json, or a singleindex.ts/extensions.rs/extensions.pyentry, with the target taken from the bundle'slanguage. The bundle's content hash goes on the lock entry aslocal_extension. Every published pin stays, as withlocal_build.resolution_hashignoresextensions, so adding or removing it leavesarete.lockfresh.a4 install --check: a problem for the manifest override or a leftover lock marker.a4 protocol deploy: refused before it builds.a4 dev promote --check: newlocal-extensionitem. The fix it prints is to publish the extension upstream, removeextensions, thena4 install --locked.a4 install --lockedrefuses whilearete.tomlstill has an override. Once the override is removed, it dropslocal_extensionalong withlocal_buildand restores the published extension.a4 dev upwatches each bundle directory. On a change it regenerates only that dependency's SDK and updates the marker, viainstall_local_extensions, which resolves just that dependency at the lock's pins. That way a protocol clienta4 devgenerated from a local build stays as it is. When only extension files changed, it redeploys nothing. Theup.rschange is a small block inwatch_pass; the rest is in the newdev/local_extensions.rs.cli/commands.mdx(Configuration File and the new "Testing an unpublished SDK extension" section) andcli/local-development.mdx(dev up watch and the promote table row).Tests
installer:a_local_sdk_extension_is_installed_regenerated_and_restored_by_lockedruns the whole roundtrip against the mock registry. It covers the published install, the override install with the marker and unchanged pins,--check,--lockedand the deploy refusal, a dev regeneration after an edit, an idempotent no-op, then removing the override and running--locked. That restores the published extension, and the lock entry equals the published one again.manifest: which dependencies may declareextensions, and that the resolution hash ignores it.lockfile: validation oflocal_extension.dev::local_extensions: the watcher snapshot and the changed-path selection.dev::promote: thelocal-extensionitem.Verification
The machine was overloaded, so I didn't build anything locally. I ran only
rustfmt --edition 2021on the changed files, plus prettier on the two docs pages. Compilation, clippy and every test ran only in CI.