You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: accept plain yaml/yml/json profiles in cloned repos and gists (#74)
* feat: fall back to plain yaml/yml/json when no *.raid.yaml at repo root
`raid profile add <git-url>` previously only picked up profile files
matching the *.raid.yaml convention (or profile.json). Single-file
gists and scratch repos that just contain `profile.yaml` or
`myprofile.yml` would clone successfully but then fail with
"No profile files found in repository".
When the primary patterns (profile.raid.yaml, *.raid.yaml/*.raid.yml,
profile.json) match nothing, fall back to any plain .yaml/.yml/.json
at the repo root. processProfileFiles validates each candidate against
the profile schema, so non-profile YAML in a repo root is still
rejected with a clear "Skipping … invalid profile" message rather
than misbehaving.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: exit 1 when no profile candidate validated successfully
Copilot review feedback on #74: the new plain-yaml fallback in
findProfileFilesInDir can now match arbitrary root yamls (e.g.
docker-compose.yaml from a gist or scratch repo). Those candidates fail
schema validation in processProfileFiles and the function previously
returned exit 0 with "No new profiles found" — the same code path used
when "all profiles already exist", which masks a real failure and means
`raid profile add <url>` would falsely report success.
Differentiate the two cases:
- queued empty AND existingNames non-empty → "all already exist", exit 0
(unchanged for the ergonomic re-run case).
- queued empty AND existingNames empty → "No valid profiles found",
exit 1.
Also adds a regression test exercising exactly the gist-style scenario
flagged in the review: a cloned repo containing only docker-compose.yaml,
which now correctly exits 1.
Existing tests that assumed schema-invalid input was a soft success
(httpURL_invalidProfile, httpURL_unmarshalError, invalidProfileName)
updated to assert the new — and more correct — exit-1 behavior.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test: cover the fallback loop's directory-skip branch
The plain-yaml fallback in findProfileFilesInDir skips subdirectories
(only files are profile candidates), but no existing test exercised
that branch — the codecov/patch check was flagging it as uncovered.
Real-world example: a scratch repo with docs/ and assets/ alongside a
profile.yaml at the root.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: site/docs/usage/profile.mdx
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,18 +36,20 @@ Add a profile from a local file:
36
36
raid profile add ./my-profile.yaml
37
37
```
38
38
39
-
Add a profile from a git repository — raid shallow-clones it and imports `*.raid.yaml`, `*.raid.yml`, and `profile.json` files found at the root:
39
+
Add a profile from a git repository — raid shallow-clones it and imports `*.raid.yaml`, `*.raid.yml`, and `profile.json` files found at the root. If none of those match, raid falls back to any plain `.yaml` / `.yml` / `.json` at the root, so a single-file gist (or scratch repo) with `profile.yaml` or `myprofile.yml` works without renaming:
raid profile add https://gist.github.com/<user>/<id># gist with profile.yaml
44
45
```
45
46
46
-
Add a profile from a raw file URL (HTTP/HTTPS URL ending in `.yaml`, `.yml`, or `.json`):
47
+
Add a profile from a raw file URL (HTTP/HTTPS URL ending in `.yaml`, `.yml`, or `.json`) — handy for the gist "Raw" link, where the filename inside the gist doesn't matter:
Copy file name to clipboardExpand all lines: site/docs/whats-new.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,10 @@ description: Feature-by-feature release notes for Raid.
9
9
10
10
User-visible changes per release, latest first. For full commit history see the [GitHub releases page](https://github.com/8bitalex/raid/releases).
11
11
12
+
## 0.10.1 — upcoming
13
+
14
+
**Plain-yaml profiles via `raid profile add <url>`.** When the URL points at a git repo (or a single-file gist) whose profile file isn't named with the `*.raid.yaml` convention — e.g. just `profile.yaml`, `myprofile.yml`, or `config.json` — raid now picks it up as a fallback after no `*.raid.yaml`/`profile.json` matches are found. Schema validation runs the same way, so non-profile YAML lying around in a repo root is still rejected with a clear "invalid profile" message. Makes ad-hoc gists usable without renaming the file.
15
+
12
16
## 0.10.0 — upcoming
13
17
14
18
**Local-only repositories.**`url` is now optional on profile repository entries. Omit it for projects that aren't backed by a git remote — raid skips cloning and runs install tasks against the existing path. The path must already exist on disk; if it doesn't, raid surfaces a clear error instead of trying to `git clone ""`. `raid doctor` no longer flags a missing `.git` directory as a warning for local-only repos. Closes [#71](https://github.com/8bitAlex/raid/issues/71).
0 commit comments