WIP: Better support for remote recipes #870

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

This PR allows to directly add remote recipes with abra:

abra app new <git-url>

The following syntaxes are supported:

  • git@domain/path
  • https://domain/path
  • domain/path

It adds a line

RECIPE=<git-url>

to the .env file of the app, and also uses that line to fetch the remote repo, so you can use the same configuration on multiple computers. Our use-case is to have a configuration for our servers, put that configuration in git, and use it on several developers machines.

This is a first draft PR - "it works on my machine". But if somebody else can test it and tell me if it's useful to them, and it works, I would be very happy!

This PR allows to directly add remote recipes with abra: ``` abra app new <git-url> ``` The following syntaxes are supported: - `git@domain/path` - `https://domain/path` - `domain/path` It adds a line ``` RECIPE=<git-url> ``` to the `.env` file of the app, and also uses that line to fetch the remote repo, so you can use the same configuration on multiple computers. Our use-case is to have a configuration for our servers, put that configuration in git, and use it on several developers machines. This is a first draft PR - "it works on my machine". But if somebody else can test it and tell me if it's useful to them, and it works, I would be very happy!
Owner

Ah, given toolshed/organising#678 (comment) @ineiti, can you confirm if the changes you're submitting are llm generated? Was that also the case for #855 and #869?

Ah, given https://git.coopcloud.tech/toolshed/organising/issues/678#issuecomment-35636 @ineiti, can you confirm if the changes you're submitting are llm generated? Was that also the case for https://git.coopcloud.tech/toolshed/abra/pulls/855 and https://git.coopcloud.tech/toolshed/abra/pulls/869?
Author
Contributor

Yes, with the following caveats:

  • I did review all the changes manually and made sure I understand what's happening
  • I am happy with the PRs #855 and #869 and tested them on my deployment, too
  • for this PR I'm not sure it's the best approach, this is why I added DRAFT to the title, and am asking other people to chime in
Yes, with the following caveats: - I did review all the changes manually and made sure I understand what's happening - I am happy with the PRs #855 and #869 and tested them on my deployment, too - for this PR I'm not sure it's the best approach, this is why I added DRAFT to the title, and am asking other people to chime in
Owner

OK, thanks for letting me know. I will wait to see what becomes of toolshed/organising#678 before taking an action here.

OK, thanks for letting me know. I will wait to see what becomes of https://git.coopcloud.tech/toolshed/organising/issues/678 before taking an action here.
ineiti force-pushed type_remote from 4578169f0a to 64da46f211 2026-07-17 13:24:54 +00:00 Compare
ineiti added 4 commits 2026-07-21 06:14:04 +00:00
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.
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.
Add NormalizeRecipeName to unify 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.
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.
ineiti force-pushed type_remote from 64da46f211 to 0397443de3 2026-07-21 06:14:04 +00:00 Compare
Author
Contributor

Just a heads-up that I'm using this on at least two installations to keep my own version of nextcloud up-to-date, and it works nice so far.

Just a heads-up that I'm using this on at least two installations to keep my own version of nextcloud up-to-date, and it works nice so far.
ineiti added 1 commit 2026-07-24 16:32:32 +00:00
Store the deployed version on TYPE (or the legacy RECIPE key when TYPE is
absent) instead of duplicating it across both. For git-URL recipes RECIPE
now stays a bare source pointer, so the two can never drift apart. Drops
the dead dirtyVersion branch and the fragile substring skip in
WriteRecipeVersion.

Also stamp the coop-cloud.<stack>.version label ourselves on upgrade and
rollback rather than trusting the value baked into the recipe's
compose.yml: git-URL/WIP recipes carry a stale or missing label, which
otherwise left the live deployment reporting the wrong version. Stop
getReleaseNotes and the [version] arg validation from fataling when the
deployed version is "unknown".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
decentral1se changed title from Better support for remote recipes - DRAFT PR to WIP: Better support for remote recipes 2026-07-25 11:45:26 +00:00
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u https://git.coopcloud.tech/ineiti/abra type_remote:ineiti-type_remote
git checkout ineiti-type_remote
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#870