Better support for remote recipes - DRAFT PR #870

Open
ineiti wants to merge 5 commits from ineiti/abra:type_remote into main

5 Commits

Author SHA1 Message Date
4578169f0a merge upstream
Some checks failed
continuous-integration/drone/pr Build is failing
2026-06-16 19:42:41 +00:00
f230f89dcb feat(app): support git-URL recipes in 'abra app new'
Allow `abra app new <git-url>` to use a recipe from outside the
catalogue. On clone, a `.abra-source` sidecar records the canonical
host/path name (the on-disk directory escapes "/" and "." lossily), and
IsClean ignores it. When templating the app's .env, a `RECIPE=<canonical
name>` line is injected so a later `abra app deploy`, possibly on another
machine, re-fetches the recipe from the same git source. `recipe ls` now
shows a source column listing these external recipes alongside catalogue
ones.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 22:40:10 +02:00
95220049e8 feat(recipe): normalize git URLs to canonical host/path names
Add NormalizeRecipeName to canonicalize the various ways a recipe can be
referenced - https/http/ssh URLs, SCP-style git@host:path, already-
canonical host/path, and short catalogue names - to a single stable
"host/path" form, preserving any ":version" suffix. Wire it into
recipe.Get and ValidateRecipe so every entry point accepts git URLs, and
add Recipe.ShortName to recover the bare recipe name from a prefixed one.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 22:39:53 +02:00
056a6be38d fix(recipe): reject branch names as :version with a clear error
Passing a branch as the ":version" suffix previously failed with an
opaque "unable to resolve" error from go-git. Detect when the requested
revision matches a branch on a configured remote and fail with a message
explaining that ":<version>" only supports tags or commit hashes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 22:39:36 +02:00
3c24ae8111 fix(formatter): guard ShortenID/SmallSHA against short input
ShortenID and SmallSHA sliced their input to a fixed length without
checking it was long enough, panicking on shorter strings. Return the
input unchanged when it is already shorter than the cut. Also replace the
blank Commit placeholder with an explicit "unknown-commit" sentinel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 22:39:16 +02:00