@sous-io/sous 1.1.13 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sous.js +181 -164
- package/docs/markdown/_sidebar.md +1 -0
- package/docs/markdown/commands.md +20 -8
- package/docs/markdown/configuration.md +17 -0
- package/docs/markdown/repositories-authoring.md +30 -0
- package/docs/markdown/repositories-consuming.md +59 -4
- package/docs/markdown/repositories-file-formats.md +106 -8
- package/docs/markdown/repositories-providers.md +35 -13
- package/docs/markdown/repositories-quickstart.md +1 -1
- package/docs/markdown/repositories-troubleshooting.md +22 -2
- package/docs/markdown/repositories.md +16 -1
- package/package.json +38 -38
- package/recipes/core/sous-skills/skills/about-sous/SKILL.tpl.md +7 -1
- package/recipes/core/sous-skills/skills/about-sous-recipes/SKILL.tpl.md +28 -6
- package/recipes/core/sous-skills/skills/about-sous-repos/SKILL.tpl.md +15 -4
- package/recipes/core/sous-skills/sous.recipe.yaml +1 -1
- package/sous.config.schema.json +9 -0
|
@@ -86,3 +86,4 @@
|
|
|
86
86
|
- [0041: A target one harness's build holds reaches that harness](adrs/0041-harness-only-targets.md)
|
|
87
87
|
- [0042: Retired recipes stay in the index and name their replacements](adrs/0042-retired-recipes.md)
|
|
88
88
|
- [0043: Every command runs the waiting migrations first](adrs/0043-migrations-before-every-command.md)
|
|
89
|
+
- [0044: A recipe can recommend other recipes, and sous asks before subscribing to them](adrs/0044-recipe-recommendations.md)
|
|
@@ -23,7 +23,11 @@ finds by walking up from the working directory.
|
|
|
23
23
|
|
|
24
24
|
- `-y, --yes` answers yes to every confirmation the command would ask, and runs any
|
|
25
25
|
[waiting migrations](#sous-migrate) without asking, taking each question's default. Every command takes it.
|
|
26
|
-
`-f`, `--force` and, on the commands that trust a repository, `--trust` are the same flag.
|
|
26
|
+
`-f`, `--force` and, on the commands that trust a repository, `--trust` are the same flag. It does not accept a
|
|
27
|
+
recipe's [recommendations](repositories-consuming.md#recommended-recipes); `--accept-recommendations` does.
|
|
28
|
+
- `--accept-recommendations` and `--decline-recommendations`, on `subscription add` and `update`, subscribe to
|
|
29
|
+
or decline every recipe a subscribed recipe recommends, without asking. Without a terminal and without
|
|
30
|
+
either, a recommendation stays pending and the output lists it; the command does not fail.
|
|
27
31
|
- `--skip-failed-migrations` skips a waiting migration that fails, or asks a question nothing answers, and runs
|
|
28
32
|
the command anyway. The skipped migration is not recorded as run: the next command tries it again. Every
|
|
29
33
|
command takes it.
|
|
@@ -422,8 +426,8 @@ sous launch claude-code -- -c
|
|
|
422
426
|
|
|
423
427
|
### `sous search TEXT`
|
|
424
428
|
|
|
425
|
-
Searches the recipes every trusted repository publishes, by name or description.
|
|
426
|
-
`sous repo search`.
|
|
429
|
+
Searches the recipes every trusted repository publishes, by name or description. A result lists the recipes
|
|
430
|
+
it recommends. Also spelled `sous repo search`.
|
|
427
431
|
|
|
428
432
|
```bash
|
|
429
433
|
sous search task
|
|
@@ -434,7 +438,10 @@ sous search task
|
|
|
434
438
|
Moves the lockfile's pins to the newest versions their ranges allow, then rebuilds: every subscription, or only
|
|
435
439
|
the repository, namespace or recipe `REF` names. `--dry-run` prints the plan and changes nothing. It asks before
|
|
436
440
|
it changes anything and before trusting a repository a newer version needs; `--yes` answers yes, and
|
|
437
|
-
`--answer <name>=<value>` or `--answers-file <path>` answer a new version's questions ahead of time.
|
|
441
|
+
`--answer <name>=<value>` or `--answers-file <path>` answer a new version's questions ahead of time. Every
|
|
442
|
+
recommendation the project has not answered yet is offered, whether a newer version brings it or an earlier run left
|
|
443
|
+
it pending, and the plan lists them; `--accept-recommendations` or `--decline-recommendations` answers them ahead of
|
|
444
|
+
time, and `--yes` does not.
|
|
438
445
|
`sous subscription update` and `sous recipe update` are other spellings of it. See
|
|
439
446
|
[Moving to newer versions](repositories-consuming.md#moving-to-newer-versions).
|
|
440
447
|
|
|
@@ -674,7 +681,9 @@ Publishes new versions of the repository's recipes: raises their versions, regen
|
|
|
674
681
|
tags. It plans first and asks once, and it needs a git commit identity (`user.name` and `user.email`) in the
|
|
675
682
|
repository. `--check` only validates, and `--ci` is the setting for a merge job. A recipe the repository no
|
|
676
683
|
longer lists keeps its published versions in the index, marked retired, with any replacements `sous.repo.yaml`
|
|
677
|
-
names (see [Retire or move a recipe](repositories-authoring.md#retire-or-move-a-recipe)).
|
|
684
|
+
names (see [Retire or move a recipe](repositories-authoring.md#retire-or-move-a-recipe)). It warns about every
|
|
685
|
+
recipe that uses `recommends`, which needs sous 1.2.0 or later in every subscribing project (see
|
|
686
|
+
[Recommend other recipes](repositories-authoring.md#recommend-other-recipes)).
|
|
678
687
|
|
|
679
688
|
```bash
|
|
680
689
|
sous repo release --recipe workflow/task-files --bump minor --push
|
|
@@ -704,7 +713,10 @@ Manages which recipes the project subscribes to. `REF` is `namespace` or `namesp
|
|
|
704
713
|
trust, the subscription, the lockfile and the answers written, so a failed subscription, a declined question
|
|
705
714
|
or Ctrl-C leaves the project as it was. Without `@<range>` the subscription accepts any version,
|
|
706
715
|
so an update may move it to a new major version; the plan shown before the question, and the result, name
|
|
707
|
-
the range recorded.
|
|
716
|
+
the range recorded. A recipe it installs may recommend others; each is offered, with its reason, and
|
|
717
|
+
`--accept-recommendations` or `--decline-recommendations` answers every one ahead of time (see
|
|
718
|
+
[Recommended recipes](repositories-consuming.md#recommended-recipes)). A declined one is recorded under
|
|
719
|
+
`declinedRecommendations`, and adding it later with `subscription add` removes it from there.
|
|
708
720
|
- `subscription remove` (or `sous unsubscribe`) removes a subscription and everything only it brought in. The
|
|
709
721
|
built-in `core` subscription is switched off instead, keeping its pin.
|
|
710
722
|
- `subscription update [REF]` is [`sous update`](#sous-update-ref).
|
|
@@ -730,8 +742,8 @@ explaining the repository `project`.
|
|
|
730
742
|
- `namespace show REF` lists one namespace's recipes, with their latest and pinned versions.
|
|
731
743
|
- `recipe list` lists every recipe, across every namespace. A description takes at most three lines, the
|
|
732
744
|
third ending in `...` when more is left out; `recipe show` prints it whole.
|
|
733
|
-
- `recipe show REF` describes one recipe completely: its versions, dependencies, the questions it
|
|
734
|
-
its files go, even before anything installs it.
|
|
745
|
+
- `recipe show REF` describes one recipe completely: its versions, dependencies, recommendations, the questions it
|
|
746
|
+
asks and where its files go, even before anything installs it.
|
|
735
747
|
|
|
736
748
|
```bash
|
|
737
749
|
sous namespace show sous-recipes:core
|
|
@@ -456,6 +456,23 @@ Two more keys settle what plugins do:
|
|
|
456
456
|
`sous plugins show` lists every plugin and what it adds. Recipes may ship plugins too; see
|
|
457
457
|
[where plugins come from](architecture/specifications/S1-engine.md#where-plugins-come-from).
|
|
458
458
|
|
|
459
|
+
## Declined recommendations
|
|
460
|
+
|
|
461
|
+
`declinedRecommendations` (`string[]`, default `[]`) lists the recipes this project said no to when a
|
|
462
|
+
subscribed recipe [recommended](repositories-consuming.md#recommended-recipes) them, so sous does not offer
|
|
463
|
+
them again. Each entry is a recipe (`namespace/recipe`) or a whole namespace (`namespace`), in canonical form.
|
|
464
|
+
|
|
465
|
+
Sous writes it to `.sous/conf.d/510-subscriptions.jsonc` when you decline a recommendation, or pass
|
|
466
|
+
`--decline-recommendations` to `sous subscription add` or `sous update`. `sous subscription add` with a
|
|
467
|
+
declined ref removes that entry. You may edit the list by hand too; once an entry is deleted, sous offers
|
|
468
|
+
that recommendation again the next time a subscription or an update brings it.
|
|
469
|
+
|
|
470
|
+
```jsonc
|
|
471
|
+
{
|
|
472
|
+
"declinedRecommendations": ["quality/lint-rules", "workflow"]
|
|
473
|
+
}
|
|
474
|
+
```
|
|
475
|
+
|
|
459
476
|
## Outputs, the state file and backups
|
|
460
477
|
|
|
461
478
|
Sous records every file it writes in the state file, `.sous/sous.state.json` by default
|
|
@@ -316,6 +316,36 @@ short names are refused: a local repository is a consumer's convenience, and a s
|
|
|
316
316
|
private label. See [Dependencies named by location](repositories-file-formats.md#dependencies-named-by-location)
|
|
317
317
|
and every accepted spelling in [Ref forms](repositories-file-formats.md#ref-forms).
|
|
318
318
|
|
|
319
|
+
### Recommend other recipes
|
|
320
|
+
|
|
321
|
+
`recommends` names recipes that make yours work better but that it does not need. Sous offers each one to the
|
|
322
|
+
subscriber, showing your `reason`, and subscribes to it only when the subscriber says yes; a subscriber who says
|
|
323
|
+
no is not asked again. Use it for anything a subscriber could reasonably do without, and keep `subscribes` for
|
|
324
|
+
what your recipe cannot work without.
|
|
325
|
+
|
|
326
|
+
```yaml
|
|
327
|
+
recommends:
|
|
328
|
+
- quality/lint-rules
|
|
329
|
+
- ref: quality/test-coverage
|
|
330
|
+
reason: >-
|
|
331
|
+
/review flags untested changes much more precisely when the coverage skill is present. Skip it if your
|
|
332
|
+
project has no test suite.
|
|
333
|
+
- ref: github://sous-io/sous-recipes/workflow/task-files@^1.2
|
|
334
|
+
reason: Lets /review attach its findings to the current task file.
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
An entry is a ref, written exactly as a `subscribes` entry is, or `{ ref, reason }`. Write the `reason` for
|
|
338
|
+
someone deciding whether to say yes: what the other recipe adds to yours, and when to skip it. It is shown
|
|
339
|
+
shortened when it is long, so put the point in its first sentence.
|
|
340
|
+
|
|
341
|
+
!> A sous older than 1.2.0 refuses a manifest that holds `recommends`, so every subscriber needs sous 1.2.0 or
|
|
342
|
+
later once your recipe uses it. `sous repo release` warns about each recipe that does.
|
|
343
|
+
|
|
344
|
+
A recommended recipe may be missing, because the subscriber declined it, so a recommendation gives your
|
|
345
|
+
templates nothing: an include line resolves only against your recipe and what it lists under `depends` or
|
|
346
|
+
`subscribes`, and a recommended recipe's questions are asked only when the subscriber accepts it. Write your
|
|
347
|
+
instructions so they still read correctly without it ("if the task-files skill is present, ...").
|
|
348
|
+
|
|
319
349
|
## Cut a release
|
|
320
350
|
|
|
321
351
|
`sous repo release` publishes new versions: one run raises versions, regenerates `sous.index.json`, commits both,
|
|
@@ -6,12 +6,13 @@ and [Repository file formats](repositories-file-formats.md) holds every schema.
|
|
|
6
6
|
## Add a repository
|
|
7
7
|
|
|
8
8
|
Adding a repository is how you trust it, so it is the one step that asks a question, and what that
|
|
9
|
-
decision covers is [Trust](repositories.md#trust).
|
|
10
|
-
`sous.
|
|
9
|
+
decision covers is [Trust](repositories.md#trust). Only what the repository publishes is read: its
|
|
10
|
+
`sous.repo.yaml`, then the index it leads to, which is all sous needs to resolve refs and list versions
|
|
11
|
+
([How a project reads a repository](repositories-file-formats.md#how-a-project-reads-a-repository)):
|
|
11
12
|
|
|
12
13
|
```term
|
|
13
14
|
$ sous repo add https://github.com/sous-io/sous-recipes
|
|
14
|
-
// the trust question, then
|
|
15
|
+
// the trust question, then a small download
|
|
15
16
|
▶ Adding a repository:
|
|
16
17
|
Repository: sous-recipes
|
|
17
18
|
Location : https://github.com/sous-io/sous-recipes
|
|
@@ -122,7 +123,8 @@ major version; with one, it stays in that range. The plan shown before the quest
|
|
|
122
123
|
both name the range recorded (`any version`, or `^1.2.0`).
|
|
123
124
|
|
|
124
125
|
A few flags change how it runs: `--yes` answers yes to the subscribe confirmation and the trust
|
|
125
|
-
question
|
|
126
|
+
question (but not to [recommendations](#recommended-recipes)), `--accept-recommendations` and
|
|
127
|
+
`--decline-recommendations` answer every recommendation, `--answer <name>=<value>` answers a recipe's question ahead of time, `--dry-run` prints what
|
|
126
128
|
would be installed without writing or downloading anything, and `--non-interactive` fails instead of
|
|
127
129
|
asking, naming the flag that would have answered. `sous subscription add --help` lists every flag.
|
|
128
130
|
|
|
@@ -186,6 +188,50 @@ like `workflow/qa-helper` above, is fetched and pinned but stays out of your out
|
|
|
186
188
|
lists have their questions asked. See
|
|
187
189
|
[Dependencies](repositories.md#dependencies).
|
|
188
190
|
|
|
191
|
+
### Recommended recipes
|
|
192
|
+
|
|
193
|
+
A recipe may recommend other recipes: ones that make it work better but that it does not need. Sous asks
|
|
194
|
+
about each one, showing the recipe author's reason, and subscribes to it only when you say yes. It asks:
|
|
195
|
+
|
|
196
|
+
- when `sous subscription add` subscribes to a recipe that recommends others;
|
|
197
|
+
- when `sous update` runs, for every recommendation not answered yet: one a newer version brings, and one an
|
|
198
|
+
earlier run left pending ([Moving to newer versions](#moving-to-newer-versions)).
|
|
199
|
+
|
|
200
|
+
It never asks during `sous build`. The recommendations of a recipe you subscribe to, or that one of your
|
|
201
|
+
recipes lists under `subscribes`, are offered; those of a recipe held only through `depends` are not. A recipe
|
|
202
|
+
your project already subscribes to or holds is not offered. This
|
|
203
|
+
shows the flow; the exact wording is the command's own:
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
'quality/code-review' recommends 'quality/test-coverage':
|
|
207
|
+
/review flags untested changes much more precisely when the coverage skill is present. Skip it
|
|
208
|
+
if your project has no test suite.
|
|
209
|
+
? Subscribe to 'quality/test-coverage' too? (y/N)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
What each answer does:
|
|
213
|
+
|
|
214
|
+
- **Yes** makes the recommended recipe a subscription of your project's own, exactly as if you had run
|
|
215
|
+
`sous subscription add` with it: removing the recipe that recommended it later leaves it in place. Its own
|
|
216
|
+
recommendations are offered in turn.
|
|
217
|
+
- **No** declines it. The ref is added to `declinedRecommendations` in `.sous/conf.d/510-subscriptions.jsonc`,
|
|
218
|
+
so sous does not ask about it again, whichever recipe recommends it.
|
|
219
|
+
|
|
220
|
+
Two switches answer every recommendation ahead of time: `--accept-recommendations` subscribes to each one,
|
|
221
|
+
and `--decline-recommendations` declines each one. `--yes` does neither, so a scripted run never subscribes
|
|
222
|
+
to something you did not name. With `--yes` (or `--trust`), `--accept-recommendations` also trusts a
|
|
223
|
+
repository a recommended recipe lives in that the project has not added. With `--accept-recommendations`, an
|
|
224
|
+
`--answer` may also answer a question of a recipe it subscribes to; one that names nothing any subscribed
|
|
225
|
+
recipe asks is reported as unused.
|
|
226
|
+
|
|
227
|
+
Without a terminal and without either switch, sous neither accepts nor declines: each recommendation stays
|
|
228
|
+
**pending**, the command finishes, and its output lists every pending one with the recipe that recommends it.
|
|
229
|
+
Nothing is recorded for a pending recommendation; to take one, run `sous subscription add` with its ref.
|
|
230
|
+
|
|
231
|
+
To change your mind about a declined one, run `sous subscription add` with its ref: that subscribes to it and
|
|
232
|
+
removes it from `declinedRecommendations`. To be asked again instead, delete its entry from
|
|
233
|
+
`declinedRecommendations` in `.sous/conf.d/510-subscriptions.jsonc` by hand.
|
|
234
|
+
|
|
189
235
|
## Choose where the files land
|
|
190
236
|
|
|
191
237
|
Recipe files compile under the [`.tpl.` convention](configuration.md#templates-and-the-tpl-convention): a file
|
|
@@ -345,6 +391,11 @@ What it will and will not do:
|
|
|
345
391
|
fails naming the flag. With nothing to update it says so and asks nothing.
|
|
346
392
|
- A repository a newer version needs that the project does not trust goes through the usual trust
|
|
347
393
|
question, and new questions the newer versions ask are asked the way subscribing asks them.
|
|
394
|
+
- Every recommendation the project has not answered yet is offered, as subscribing offers it
|
|
395
|
+
([Recommended recipes](#recommended-recipes)): one a newer version brings, and one an earlier run
|
|
396
|
+
left pending. A declined one is not. The plan lists them, marking the ones a new version brings.
|
|
397
|
+
`--yes` accepts the plan but not the recommendations; `--accept-recommendations` and
|
|
398
|
+
`--decline-recommendations` answer them.
|
|
348
399
|
- A repository whose index cannot be fetched is skipped and named, and its pins stay put.
|
|
349
400
|
- A linked repository's pins move too, and the plan notes that builds keep reading the checkout
|
|
350
401
|
until it is unlinked.
|
|
@@ -580,6 +631,10 @@ So a pipeline or an agent needs three things and nothing else: `--yes` for the c
|
|
|
580
631
|
`--accept-first` for an ambiguous one-word ref, and either `--answer` or those environment
|
|
581
632
|
variables. The command's help prints under the error, on stderr, and the error itself on stdout.
|
|
582
633
|
|
|
634
|
+
A [recommendation](#recommended-recipes) does not fail such a run. It is an offer, not something the command
|
|
635
|
+
needs, so it stays pending and the output lists it. Pass `--accept-recommendations` or
|
|
636
|
+
`--decline-recommendations` to answer every recommendation instead.
|
|
637
|
+
|
|
583
638
|
## Where to go next
|
|
584
639
|
|
|
585
640
|
- [Troubleshooting](repositories-troubleshooting.md): what a failed add, subscribe or build is
|
|
@@ -9,7 +9,10 @@ change raises that number, so an older sous refuses a file it would otherwise mi
|
|
|
9
9
|
|
|
10
10
|
?> Both hand-written manifests are YAML or JSON, never JavaScript: `.yaml`, `.yml`, `.json` or `.jsonc`
|
|
11
11
|
(both JSON forms allow comments and trailing commas). Two in one directory is an error, not a first-match
|
|
12
|
-
win.
|
|
12
|
+
win. In the recipe manifest, a key sous does not know is skipped with a warning naming the key and the file,
|
|
13
|
+
so a manifest written for a later sous still loads (a sous older than 1.2.0 refuses it instead); the
|
|
14
|
+
repository manifest refuses one. Extension keys starting with `x-` are carried through untouched in both,
|
|
15
|
+
with no warning; [the one
|
|
13
16
|
sous reads](repositories-authoring.md#declare-the-variables-a-recipe-needs) is `x-intentional`. Every path
|
|
14
17
|
in a manifest is checked: absolute paths, backslashes, `.` or `..` segments, empty segments and trailing
|
|
15
18
|
slashes are refused.
|
|
@@ -65,7 +68,7 @@ recipe's namespace under `namespaces`.
|
|
|
65
68
|
| `name` | to release | A suggestion only; `sous repo add --name` decides what a project calls it |
|
|
66
69
|
| `namespaces` | to release | Keyed by namespace name; each entry takes an optional `description`. A release refuses a recipe whose namespace is not listed here |
|
|
67
70
|
| `description`, `contribute` | no | A summary for anyone reading the repository, and where to send a contribution when a provider cannot support `sous repo submit` |
|
|
68
|
-
| `index`, `published` | no | Where the published data lives: `index` is `embedded`, `tags`, or the path of a `.json` file relative to the repository root, and `published` holds the same data as `sous.index.json` apart from `formatVersion` and `name`. A `published` block beside an `index` of `tags` or a path is an error.
|
|
71
|
+
| `index`, `published` | no | Where the published data lives: `index` is `embedded`, `tags`, or the path of a `.json` file relative to the repository root, and `published` holds the same data as `sous.index.json` apart from `formatVersion` and `name`. A `published` block beside an `index` of `tags` or a path is an error. A project reads every form; see [How a project reads a repository](#how-a-project-reads-a-repository). `sous repo release` writes only `sous.index.json`, at the repository root |
|
|
69
72
|
| `submissions` | no | Whether the repository's recipes take proposed changes; see [The submissions block](#the-submissions-block) |
|
|
70
73
|
| `retired` | no | Keyed `namespace/recipe`; see [Retired recipes](#retired-recipes) |
|
|
71
74
|
|
|
@@ -98,6 +101,14 @@ version: 0.1.0
|
|
|
98
101
|
depends: # 'subscribes' takes the same two spellings
|
|
99
102
|
- workflow/qa-helper
|
|
100
103
|
- github://sous-io/sous-recipes/workflow/sub-agent-delegation@^1.0
|
|
104
|
+
recommends: # offered to the subscriber, who decides
|
|
105
|
+
- quality/lint-rules
|
|
106
|
+
- ref: quality/test-coverage
|
|
107
|
+
reason: >-
|
|
108
|
+
/review flags untested changes much more precisely when the coverage skill is present. Skip it if
|
|
109
|
+
your project has no test suite.
|
|
110
|
+
- ref: github://sous-io/sous-recipes/workflow/task-files@^1.2
|
|
111
|
+
reason: Lets /review attach its findings to the current task file.
|
|
101
112
|
contents: # what a subscriber actually receives
|
|
102
113
|
- kind: skills
|
|
103
114
|
include: [skills/**/*.md] # 'exclude' is the optional counterpart
|
|
@@ -110,6 +121,7 @@ contents: # what a subscriber actually receives
|
|
|
110
121
|
| `version` | to release | An exact semantic version; the manifest is the source of truth and the git tag follows it. `sous repo release` refuses a recipe that names none |
|
|
111
122
|
| `description` | no | Copied into the index at release time; shown by `sous recipe list` and `sous repo search` |
|
|
112
123
|
| `depends`, `subscribes` | no | Build dependencies and co-subscriptions; within either list, no entry may repeat |
|
|
124
|
+
| `recommends` | no | Recipes or namespaces the subscriber is offered, and may decline; each entry is a ref, or `{ ref, reason }` with an optional `reason` shown when sous asks. Needs sous 1.2.0 or later; see [Recommendations](#recommendations) |
|
|
113
125
|
| `contents`, `variables` | no | Contents default to an empty list, which is what a curated bundle publishes; a duplicated variable name, or two definitions claiming one `env`, is an error. Any value in `contents` may be an expression; see [Contents are config](#contents-are-config) |
|
|
114
126
|
| `edits` | no | Changes to document files the recipe does not own; see [Edits](#edits) |
|
|
115
127
|
| `submissions` | no | Whether this recipe takes proposed changes, winning over the repository's block; see [The submissions block](#the-submissions-block) |
|
|
@@ -254,9 +266,28 @@ proposes it if the contributor carries on. `sous repo release --check` fails a p
|
|
|
254
266
|
because a pull request can be opened without `submit`, and the check is the one gate every change passes. A
|
|
255
267
|
release itself is never restricted, so whatever publishes the recipe still releases it.
|
|
256
268
|
|
|
269
|
+
### Recommendations
|
|
270
|
+
|
|
271
|
+
`recommends` names recipes that work well beside this one but that it does not need. Unlike a `subscribes`
|
|
272
|
+
entry, a recommendation lands nothing on its own: sous asks the subscriber about each one, showing its
|
|
273
|
+
`reason`, and only a yes subscribes to it. What the subscriber sees is in
|
|
274
|
+
[Recommended recipes](repositories-consuming.md#recommended-recipes).
|
|
275
|
+
|
|
276
|
+
An entry is either a ref, written as a `subscribes` entry is ([Dependencies named by location](#dependencies-named-by-location)),
|
|
277
|
+
or an object:
|
|
278
|
+
|
|
279
|
+
| Field | Required | Notes |
|
|
280
|
+
|-------|----------|-------|
|
|
281
|
+
| `ref` | yes | The recommended recipe or namespace, in any form a `subscribes` entry accepts |
|
|
282
|
+
| `reason` | no | Why the subscriber may want it, in plain sentences. Sous shows it when it asks, shortened when it is long and with control characters and terminal escape sequences removed; `sous repo release` warns about a long one or one holding such characters, and publishes it as written |
|
|
283
|
+
|
|
284
|
+
The object form is spelled `ref:` because an entry may name a whole namespace as well as a recipe. No ref may
|
|
285
|
+
repeat within the list. `sous repo release` warns about every recipe that uses `recommends`, because a sous
|
|
286
|
+
older than 1.2.0 refuses a manifest holding it.
|
|
287
|
+
|
|
257
288
|
### Dependencies named by location
|
|
258
289
|
|
|
259
|
-
`depends` and `
|
|
290
|
+
`depends`, `subscribes` and `recommends` name their targets by where they live: `workflow/qa-helper` is a sibling in this
|
|
260
291
|
same repository, and `github://sous-io/sous-recipes/workflow/sub-agent-delegation@^1.0` is a recipe in
|
|
261
292
|
another one. Every spelling in [Ref forms](#ref-forms) that names a namespace or a recipe is accepted here,
|
|
262
293
|
except a `repo:` qualifier (one project's private name for a repository), a local path or `local://`
|
|
@@ -303,7 +334,7 @@ end of the project path with `/-/`, so it reads one way.
|
|
|
303
334
|
| --- | --- |
|
|
304
335
|
| The command line | every form; names in any case |
|
|
305
336
|
| A config file's subscription keys | `namespace` or `namespace/recipe`, lowercase; the repository is recorded in the lockfile and a range in the entry's `range` field |
|
|
306
|
-
| A recipe manifest's `depends` and `
|
|
337
|
+
| A recipe manifest's `depends`, `subscribes` and `recommends` | every form naming a namespace or a recipe, except `repo:` and a local location |
|
|
307
338
|
| A key sous stores (the lockfile, the index, the store) | `namespace` or `namespace/recipe`, lowercase |
|
|
308
339
|
| An include line, after its `~` | `namespace/recipe/path`, any part a glob, optionally starting with a `repo:` qualifier; see [Include syntax](configuration.md#include-syntax) |
|
|
309
340
|
|
|
@@ -356,7 +387,9 @@ description: Helpers for the team's own tools. # optional; shown by sous names
|
|
|
356
387
|
## `sous.index.json`
|
|
357
388
|
|
|
358
389
|
Machine-written by `sous repo release` and committed beside the recipes it describes. Adding a repository
|
|
359
|
-
|
|
390
|
+
reads only the repository manifest and this file; nothing more is downloaded until a project subscribes.
|
|
391
|
+
The same data may instead be embedded in the manifest, kept at another path, or built from the release
|
|
392
|
+
tags; see [How a project reads a repository](#how-a-project-reads-a-repository).
|
|
360
393
|
|
|
361
394
|
```json
|
|
362
395
|
{
|
|
@@ -372,6 +405,10 @@ fetches only this file; nothing more is downloaded until a project subscribes.
|
|
|
372
405
|
"kind": "depends" } },
|
|
373
406
|
"depends": [ "github://sous-io/sous-recipes/workflow/sub-agent-delegation@^1.0" ],
|
|
374
407
|
"subscribes": [ "workflow" ],
|
|
408
|
+
"recommends": [
|
|
409
|
+
{ "key": "quality/lint-rules", "range": "^0.3.0", "declared": "quality/lint-rules" },
|
|
410
|
+
{ "key": "quality/test-coverage", "range": "^1.4.0", "declared": "quality/test-coverage",
|
|
411
|
+
"reason": "/review flags untested changes much more precisely when the coverage skill is present." } ],
|
|
375
412
|
"variables": [ { "name": "qaNotesDir", "type": "path", "prompt": "Where should notes go?",
|
|
376
413
|
"description": "The directory QA notes are written to.", "example": "docs/qa",
|
|
377
414
|
"default": ".sous/qa-notes", "required": true, "secret": false, "scope": "shared" } ],
|
|
@@ -391,6 +428,7 @@ fetches only this file; nothing more is downloaded until a project subscribes.
|
|
|
391
428
|
| `dependencies` | per version | The range each dependency may take, keyed `namespace/recipe`; see below |
|
|
392
429
|
| `variables` | per version | The version's variable definitions, exactly as its manifest publishes them (see [Variable definitions](#variable-definitions)), with `required`, `secret` and `scope` filled in; `[]` when it asks nothing |
|
|
393
430
|
| `depends`, `subscribes` | per version | The version's manifest lists, exactly as written; `[]` when empty |
|
|
431
|
+
| `recommends` | per version | The version's recommendations, settled at release, in the manifest's order; `[]` when it has none, and absent on a version released before sous recorded recommendations. Each carries `key` (`namespace/recipe`, or `namespace` for a whole namespace), `range` (worked out as a dependency's is; absent for a namespace), `repo` (the identity of another repository; absent for this one), `declared` (the entry's ref exactly as written) and `reason` when the entry has one. Recommendations are not dependencies and never appear under `dependencies` |
|
|
394
432
|
| `retired` | top level | Recipes the repository published and no longer lists, keyed `namespace/recipe`; absent when there are none. Each entry carries `path`, `description` and `versions` as a recipe under `recipes` does, plus `replacements`; see below |
|
|
395
433
|
| `replacements` | per retired recipe | The recipes offered in its place, in order. Each carries `key` (`namespace/recipe`), `repo` (the identity of another repository; absent for this one) and `declared` (the entry exactly as `sous.repo.yaml` wrote it) |
|
|
396
434
|
|
|
@@ -428,7 +466,7 @@ that the list lacks, a recipe in the list the manifest does not declare, a recor
|
|
|
428
466
|
declared one (for a sibling named with no range, not a `^<version>` range or `*`), an older entry's `version`
|
|
429
467
|
outside its declared range, or another repository's entry with a different repository is an error naming the
|
|
430
468
|
recipe, the version and each difference; restore the entry if the index was edited, or bump the version to publish
|
|
431
|
-
different dependencies. A version rebuilt from its tag, when the index lost it, has its dependencies recorded
|
|
469
|
+
different dependencies. Its recorded `recommends` is checked against the manifest the same way. A version rebuilt from its tag, when the index lost it, has its dependencies recorded
|
|
432
470
|
from the repository as it stood at that tag, then frozen the same way. An entry written before sous
|
|
433
471
|
recorded dependencies carries none, stays that way, and installs by resolving its manifest's ranges.
|
|
434
472
|
|
|
@@ -459,6 +497,57 @@ any other, marked `seeded: true`; if the repository already publishes it, the pu
|
|
|
459
497
|
never writes `seeded` onto a fetched index, and when it writes the placeholder into the index cache it
|
|
460
498
|
stamps a fixed `$comment`, so a later run can tell its own placeholder from a real index and replace it.
|
|
461
499
|
|
|
500
|
+
## How a project reads a repository
|
|
501
|
+
|
|
502
|
+
A project that adds a repository (the built-in ones included) reads what it publishes, the manifest
|
|
503
|
+
first. Sous looks for `sous.repo.yaml` at the repository root, then in `.sous/`, trying `.yaml`, `.yml`,
|
|
504
|
+
`.json` and `.jsonc` in each, and the first file found is the manifest. What it says decides what is
|
|
505
|
+
read next:
|
|
506
|
+
|
|
507
|
+
| The manifest has | Sous reads |
|
|
508
|
+
|------------------|------------|
|
|
509
|
+
| a `published` block, or `index: embedded` | nothing more: the index is in the manifest |
|
|
510
|
+
| `index: <path>.json` | the index file at that path, relative to the repository root. A missing file is an error naming the setting, for the repository's maintainers to fix |
|
|
511
|
+
| `index: tags` | the repository's tags, from which it builds the index; see [A repository that publishes through its tags](#a-repository-that-publishes-through-its-tags) |
|
|
512
|
+
| none of these | a `sous.index.json` beside the manifest; with none there, the repository has published nothing yet, and its index is empty |
|
|
513
|
+
|
|
514
|
+
Only when neither place holds a manifest is a `sous.index.json` at the repository root read. With none
|
|
515
|
+
there either, the read fails:
|
|
516
|
+
|
|
517
|
+
```text
|
|
518
|
+
Error: https://github.com/acme/recipes has no 'sous.repo.yaml' (at its root or in '.sous/') and no
|
|
519
|
+
'sous.index.json', so it is not a sous recipe repository, or nothing in it has been released yet.
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
A [linked working copy](repositories-authoring.md#edit-a-repository-in-place) is read the same way, from
|
|
523
|
+
disk; a linked repository that publishes through its tags is read from upstream, like any other. How each
|
|
524
|
+
file travels from a host is in [Private repositories](repositories-providers.md#private-repositories).
|
|
525
|
+
|
|
526
|
+
### A repository that publishes through its tags
|
|
527
|
+
|
|
528
|
+
With `index: tags`, a repository commits no index: a project builds it from the release tags
|
|
529
|
+
(`namespace/recipe@version`) with the same code `sous repo release` uses, so it gets the index a release
|
|
530
|
+
would write for the same repository.
|
|
531
|
+
|
|
532
|
+
- One `git ls-remote` lists the tags and `HEAD`.
|
|
533
|
+
- Only the commits and trees of tags not seen before are fetched, one commit deep and with no file
|
|
534
|
+
contents, then the repository manifests at them and then the recipe manifests, one fetch each. They
|
|
535
|
+
are kept in a bare repository under `$SOUS_HOME/cache/_tags/<repository identity>.git`.
|
|
536
|
+
- Each tag's entry is kept for good in `$SOUS_HOME/cache/_tags/<repository identity>.json`, checked against
|
|
537
|
+
the object the tag points at. A published tag never changes, so each version's manifest is read once;
|
|
538
|
+
a tag moved to another object is read again.
|
|
539
|
+
- A version's content hash is the `Sous-Hash: sha256-...` line of its annotated tag's message. A tag made
|
|
540
|
+
by hand without that line has its recipe folder fetched and hashed once, and the hash is kept.
|
|
541
|
+
- Each recipe's folder, description and namespace come from the manifests at `HEAD`. A recipe `HEAD` no
|
|
542
|
+
longer lists is retired, with the replacements its `sous.repo.yaml` names.
|
|
543
|
+
- A dependency that could be read more than one way is settled once, by reading the candidate
|
|
544
|
+
repositories' indexes, and kept in the same file.
|
|
545
|
+
|
|
546
|
+
A fresh machine that downloads a pinned recipe while the config is still being built reads the tags
|
|
547
|
+
without each version's dependencies; that read serves the download only and is never cached, and the
|
|
548
|
+
next read completes it from the local copy without fetching again. Measured with 50 recipes and 500
|
|
549
|
+
tags, a first read takes about 3 seconds and a read from the local copy about a tenth of a second.
|
|
550
|
+
|
|
462
551
|
## `.sous/sous.lock.json`
|
|
463
552
|
|
|
464
553
|
Machine-written, committed, and the reason a fresh clone restores with no prompts and no drift.
|
|
@@ -514,13 +603,19 @@ lockfile's pins); every entry carries a `.sous.entry.json` marker. It sits under
|
|
|
514
603
|
$SOUS_HOME/
|
|
515
604
|
cache/<repository identity>/<namespace>/<name>/<version>/ .sous.entry.json, then the files
|
|
516
605
|
cache/_indexes/<repository identity>.json the cached index
|
|
517
|
-
cache/_indexes/<repository identity>.meta.json etag, fetchedAt, lastCheckedAt,
|
|
606
|
+
cache/_indexes/<repository identity>.meta.json etag, fetchedAt, lastCheckedAt, readFrom
|
|
607
|
+
cache/_tags/<repository identity>.git a tags-only repository's tags and manifests
|
|
608
|
+
cache/_tags/<repository identity>.json each tag's entry, and the dependencies settled
|
|
518
609
|
cache/read-strategies.json per repository: the read strategy and clone URL that worked, and since when
|
|
519
610
|
cache/gitlab-instances.json per GitLab host: the sub-path GitLab is installed under ("" at the root)
|
|
520
611
|
repos/ checkouts cloned by 'sous repo link --global'
|
|
521
612
|
sous.links.json the machine-wide links map
|
|
522
613
|
```
|
|
523
614
|
|
|
615
|
+
A cached index's `readFrom` names the file the copy was read from (`sous.repo.yaml`, `.sous/sous.repo.yaml`,
|
|
616
|
+
`sous.index.json`, or the path an `index` setting names), or `tags` for an index built from the tags; its
|
|
617
|
+
`etag` is sent only when that same file is read again.
|
|
618
|
+
|
|
524
619
|
The marker makes an entry self-describing, so the store is sweepable without consulting a project:
|
|
525
620
|
|
|
526
621
|
```json
|
|
@@ -568,6 +663,8 @@ subscriptions:
|
|
|
568
663
|
workflow/task-files:
|
|
569
664
|
range: "^1.2.0" # defaults to "*"; prerelease, enabled, alwaysPull, addedAt
|
|
570
665
|
prerelease: false # and addedBy work as they do above
|
|
666
|
+
declinedRecommendations: # recommendations this project said no to; sous does not offer them again
|
|
667
|
+
- quality/lint-rules
|
|
571
668
|
store: # every value is a default you can change
|
|
572
669
|
maxBytes: 1073741824 # one gigabyte; past it, 'sous repo gc' evicts unpinned entries
|
|
573
670
|
freshnessSeconds: 300 # how long a fetched index stays fresh
|
|
@@ -588,6 +685,7 @@ projectRecipes: # the project's own recipes; both values are the defa
|
|
|
588
685
|
| `repos` | the short name refs use | Adding a repository IS trusting it, and removing the entry withdraws that trust. The name `project` is reserved for the project's own recipes and is an error here |
|
|
589
686
|
| `subscriptions` | a ref key | A bare namespace (every recipe in it, including ones published later) or `namespace/recipe`. No repo qualifier and no range in the key |
|
|
590
687
|
| `enabled: false` | either of the two above | The opt-out for the entries sous provides itself, the `sous-recipes` repository and the `core` subscription |
|
|
688
|
+
| `declinedRecommendations` | a list | `string[]`, empty by default. Each entry is a recommended recipe or namespace the project declined, in canonical form (`namespace/recipe` or `namespace`); see [Recommended recipes](repositories-consuming.md#recommended-recipes) |
|
|
591
689
|
| `store` | fixed fields | Plain numbers, all optional; the values sous ships are defaults, not assumptions |
|
|
592
690
|
| `recipes` | content kind | What each kind does; see [recipes: what each content kind does](#recipes-what-each-content-kind-does) |
|
|
593
691
|
| `recipes.handlers` | a list | Written by sous while the config is built: one `{ recipe, purpose, file, handler }` entry for each handler a subscribed recipe from a trusted repository, or one of the project's own recipes, lists; see [Handlers](handlers.md) |
|
|
@@ -632,7 +730,7 @@ are `.jsonc` so they can carry real comments, and each opens with a header sayin
|
|
|
632
730
|
| Layer | Holds | Written by |
|
|
633
731
|
|-------|-------|-----------|
|
|
634
732
|
| `500-repos.jsonc` | `repos` | `sous repo add`, `sous repo remove` |
|
|
635
|
-
| `510-subscriptions.jsonc` | `subscriptions` | `sous subscription add`, `remove`, `enable` and `disable` |
|
|
733
|
+
| `510-subscriptions.jsonc` | `subscriptions`, `declinedRecommendations` | `sous subscription add`, `remove`, `enable` and `disable`; `sous subscription add` and `sous update` when a recommendation is declined |
|
|
636
734
|
| `520-var-mappings.jsonc` | `varMappings` | `sous vars ask` |
|
|
637
735
|
|
|
638
736
|
```jsonc
|
|
@@ -14,7 +14,10 @@ Every provider answers the **read path**, which is deliberately small:
|
|
|
14
14
|
|
|
15
15
|
- recognize a repository URL as its own;
|
|
16
16
|
- take that URL apart into a host, an owner and a name;
|
|
17
|
-
- hand back the repository
|
|
17
|
+
- hand back one file of the repository at `HEAD`, which is how sous reads its `sous.repo.yaml` and the
|
|
18
|
+
index it leads to ([How a project reads a repository](repositories-file-formats.md#how-a-project-reads-a-repository));
|
|
19
|
+
- list the repository's tags and fetch what a reader asks for at them, for a repository that publishes
|
|
20
|
+
through its tags alone;
|
|
18
21
|
- fetch **one** recipe's subtree at one tag.
|
|
19
22
|
|
|
20
23
|
Nothing there clones a whole repository. A provider that can also carry a contribution answers
|
|
@@ -117,6 +120,7 @@ every machine-wide thing keys by:
|
|
|
117
120
|
| the store entry | `~/.sous/cache/github.com/sous-io/sous-recipes/<namespace>/<recipe>/<version>/` |
|
|
118
121
|
| the cached index | `~/.sous/cache/_indexes/github.com/sous-io/sous-recipes.json` |
|
|
119
122
|
| the index sidecar | `~/.sous/cache/_indexes/github.com/sous-io/sous-recipes.meta.json` |
|
|
123
|
+
| the tags of a repository that publishes through them | `~/.sous/cache/_tags/github.com/sous-io/sous-recipes.git` and `.json` |
|
|
120
124
|
| the lockfile's `identity` field | `github.com/sous-io/sous-recipes` |
|
|
121
125
|
|
|
122
126
|
A repository's **short name** (`sous-recipes`) is something your project chose, and it keys
|
|
@@ -143,12 +147,13 @@ because a path on your disk is not a published location. Every form is in
|
|
|
143
147
|
|
|
144
148
|
Sous reads a repository in two very different ways, and they authenticate differently.
|
|
145
149
|
|
|
146
|
-
**
|
|
150
|
+
**What a repository publishes** (its `sous.repo.yaml`, then the index it leads to) is read by trying three
|
|
151
|
+
ways in order, so reading works with whatever access you have.
|
|
147
152
|
Neither `gh` nor `glab` is ever required to read a repository; they are needed only for
|
|
148
153
|
`sous repo contribute` and `sous repo submit`.
|
|
149
154
|
|
|
150
155
|
```text
|
|
151
|
-
Reading
|
|
156
|
+
Reading a file a repository publishes
|
|
152
157
|
1. HTTP with a token if a token is found (see below)
|
|
153
158
|
2. HTTP with no token public repositories
|
|
154
159
|
3. git a shallow, sparse fetch of the one file, using your own git
|
|
@@ -159,14 +164,23 @@ For GitLab, the HTTP requests use the API address, with the whole project path e
|
|
|
159
164
|
group's `/` becomes `%2F`:
|
|
160
165
|
|
|
161
166
|
```text
|
|
162
|
-
https://raw.githubusercontent.com/<owner>/<name>/HEAD/sous.
|
|
163
|
-
https://<gitlab host>/api/v4/projects/<owner>%2F<name>/repository/files/sous.
|
|
167
|
+
https://raw.githubusercontent.com/<owner>/<name>/HEAD/sous.repo.yaml
|
|
168
|
+
https://<gitlab host>/api/v4/projects/<owner>%2F<name>/repository/files/sous.repo.yaml/raw?ref=HEAD
|
|
164
169
|
```
|
|
165
170
|
|
|
171
|
+
The first file read walks those ways in order. A way that reached the repository and found a file missing
|
|
172
|
+
(a `404`, or git's "does not exist") reads the rest of the files for that read, and the other places a
|
|
173
|
+
manifest may be are read together, so a repository whose manifest is in `.sous/` costs a few small extra
|
|
174
|
+
requests. A file is missing, which is an answer rather than a failure, when git (or, for a local
|
|
175
|
+
repository, its working tree) reached the repository and found no such file, or when a way answered `404`
|
|
176
|
+
and no other failed to connect or was refused (a `404` alone may also mean a private repository). Sous then
|
|
177
|
+
moves on to the next file, and the error, if any, is the one under
|
|
178
|
+
[How a project reads a repository](repositories-file-formats.md#how-a-project-reads-a-repository).
|
|
179
|
+
|
|
166
180
|
GitHub's raw host can answer with a copy it cached for up to five minutes. When sous must see the
|
|
167
181
|
current index (a `--latest` read, or a recipe missing from its cached copy, which is how a recipe
|
|
168
182
|
released moments ago looks), it reads GitHub's contents API without a token instead
|
|
169
|
-
(`https://api.github.com/repos/<owner>/<name>/contents
|
|
183
|
+
(`https://api.github.com/repos/<owner>/<name>/contents/<path>`), and tries the raw host only
|
|
170
184
|
if nothing else answers. GitHub allows 60 such requests an hour from one address, so ordinary reads
|
|
171
185
|
never use it. GitLab's API always answers with the current file.
|
|
172
186
|
|
|
@@ -197,7 +211,7 @@ first for the next seven days, counted from when it became first. After that, th
|
|
|
197
211
|
tried first again, so a repository read through git while its token was broken goes back to HTTP once the
|
|
198
212
|
token works. `store.strategyMemorySeconds` sets the time (`604800`, seven days, by default; `0` always
|
|
199
213
|
tries the usual order first). After a failure sous forgets the remembered way and walks the whole list
|
|
200
|
-
again. When every way fails, one error lists each attempt and why it failed, then names the fixes:
|
|
214
|
+
again; a missing file is not a failure, so it keeps the way that found it missing. When every way fails, one error lists each attempt and why it failed, then names the fixes:
|
|
201
215
|
|
|
202
216
|
```text
|
|
203
217
|
Error: could not read gitlab.com/acme/private-recipes.
|
|
@@ -213,8 +227,8 @@ The fixes depend on what the attempts said:
|
|
|
213
227
|
|
|
214
228
|
- Every attempt could not connect (DNS, a refused connection, a timeout): the only fix is to check
|
|
215
229
|
that the machine can reach the host, or to set `HTTPS_PROXY`. No token is offered.
|
|
216
|
-
- git reached the repository and said
|
|
217
|
-
|
|
230
|
+
- git reached the repository and said the file is not there: the fix is to check the URL. No token is
|
|
231
|
+
offered, since the repository is not private.
|
|
218
232
|
- A token was found and refused: the attempt and the fix name where it came from (`GITLAB_TOKEN`,
|
|
219
233
|
`git credential fill`, `glab`) instead of asking you to set it.
|
|
220
234
|
- `gh` or `glab` is installed but printed no token: the fixes include `gh auth login` or
|
|
@@ -226,11 +240,17 @@ once, and the error is told once, naming every recipe it stopped.
|
|
|
226
240
|
The HTTP reads honor `HTTPS_PROXY`, `HTTP_PROXY` and `NO_PROXY` (or their lowercase spellings), as
|
|
227
241
|
git does.
|
|
228
242
|
|
|
229
|
-
A cached index is checked again once its freshness window lapses
|
|
230
|
-
"not modified" through the
|
|
243
|
+
A cached index is checked again once its freshness window lapses, by reading the manifest again and the
|
|
244
|
+
file the copy came from. GitHub answers that check with "not modified" through the file's `ETag`, which
|
|
245
|
+
sous sends only when it reads the same file the copy came from. GitLab sends no `ETag` for a file, so sous keeps the
|
|
231
246
|
`X-Gitlab-Content-Sha256` header GitLab sends instead, asks for that header alone with one `HEAD`
|
|
232
247
|
request, and downloads the index again only when the hash changed.
|
|
233
248
|
|
|
249
|
+
**A repository that publishes through its tags** (`index: tags`) is read with git too: `git ls-remote`
|
|
250
|
+
lists the tags, and fetches bring only the commits, trees and manifests a reader needs, as
|
|
251
|
+
[A repository that publishes through its tags](repositories-file-formats.md#a-repository-that-publishes-through-its-tags)
|
|
252
|
+
describes. These commands use the same credentials, clone URLs and token as a recipe's files, below.
|
|
253
|
+
|
|
234
254
|
**A recipe's files** come from git itself: a shallow, blobless, sparse clone at the version's
|
|
235
255
|
tag, fetching only the blobs inside that one recipe folder. That means git's own credentials
|
|
236
256
|
apply, exactly as they would for a manual clone: credential helpers, the SSH agent, proxies and
|
|
@@ -378,8 +398,10 @@ It exists for local development and for tests: authoring a repository, trying a
|
|
|
378
398
|
publishing it, or running a whole workflow with no network at all. Two details make it behave
|
|
379
399
|
like a host rather than like a shortcut.
|
|
380
400
|
|
|
381
|
-
-
|
|
382
|
-
still writing is picked up without a commit, and from
|
|
401
|
+
- Each file sous reads (the manifest, then the index it leads to) is read from the **working tree** when
|
|
402
|
+
it is there, so an index you are still writing is picked up without a commit, and from
|
|
403
|
+
`git show HEAD:<path>` otherwise. A repository that publishes through its tags has them read through
|
|
404
|
+
its `file://` URL, the way git reads any remote.
|
|
383
405
|
- A recipe's files come from a clone of the local repository at the version's **tag**, exactly as
|
|
384
406
|
a hosted repository would be fetched, so a version really is the version its tag points at. A
|
|
385
407
|
directory that is not a git repository, or one missing that tag, has no versions to honor, so
|
|
@@ -262,7 +262,7 @@ One repository has to be trusted before this can continue.
|
|
|
262
262
|
This project now trusts 'my-recipes'. Nothing from it has been installed.
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
-
|
|
265
|
+
Sous reads the repository's `sous.repo.yaml` and the index it leads to, and nothing is installed. The entry lands
|
|
266
266
|
in `.sous/conf.d/500-repos.jsonc`, which is committed, so a colleague inherits the repository and
|
|
267
267
|
the trust decision together.
|
|
268
268
|
|
|
@@ -352,7 +352,7 @@ Fix one of these:
|
|
|
352
352
|
set up git access to gitlab.com (an SSH key, or a credential helper)
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
-
Sous tried every way it has to read the repository
|
|
355
|
+
Sous tried every way it has to read the repository, and each line says why that one failed. Any
|
|
356
356
|
one fix lets sous read the index and download recipe files: sous hands the token it found to git for an
|
|
357
357
|
HTTPS download, so a token alone is enough to build. `gh` and `glab` are not needed to read.
|
|
358
358
|
|
|
@@ -365,7 +365,27 @@ The order sous tries, and where it finds a token, are under
|
|
|
365
365
|
The fixes follow from what the attempts said. When every attempt could not connect, the one fix is to
|
|
366
366
|
check that this machine can reach the host, or to set `HTTPS_PROXY` on a network that needs a proxy;
|
|
367
367
|
sous's HTTP reads honor `HTTPS_PROXY`, `HTTP_PROXY` and `NO_PROXY`. When git reached the repository and
|
|
368
|
-
said
|
|
368
|
+
said the file is not there, the fix is to check the URL, and no token is offered.
|
|
369
|
+
|
|
370
|
+
## A repository with nothing to read
|
|
371
|
+
|
|
372
|
+
```text
|
|
373
|
+
Error: https://github.com/acme/recipes has no 'sous.repo.yaml' (at its root or in '.sous/') and no
|
|
374
|
+
'sous.index.json', so it is not a sous recipe repository, or nothing in it has been released yet.
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Sous reached the repository and found neither a manifest nor an index. Check the URL first. If the
|
|
378
|
+
repository is meant to publish recipes, its maintainers commit a `sous.repo.yaml` and release.
|
|
379
|
+
|
|
380
|
+
```text
|
|
381
|
+
Error: https://github.com/acme/recipes/sous.repo.yaml says its index is at 'published/index.json', and
|
|
382
|
+
https://github.com/acme/recipes has no file there.
|
|
383
|
+
The repository's maintainers fix this: release again, or correct 'index' in the manifest.
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
The manifest's `index` setting names a file the repository does not hold. Only the repository's
|
|
387
|
+
maintainers can fix it. Where sous looks, in order, is under
|
|
388
|
+
[How a project reads a repository](repositories-file-formats.md#how-a-project-reads-a-repository).
|
|
369
389
|
|
|
370
390
|
## A recipe that requires a plugin
|
|
371
391
|
|