@sous-io/sous 1.2.1 → 1.2.2
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 +130 -120
- package/docs/markdown/commands.md +15 -7
- package/docs/markdown/project-recipes.md +15 -4
- package/docs/markdown/repositories-authoring.md +100 -30
- package/docs/markdown/repositories-contributing.md +5 -3
- package/docs/markdown/repositories-file-formats.md +68 -24
- package/docs/markdown/repositories-quickstart.md +12 -8
- package/package.json +38 -38
- package/recipes/core/sous-skills/skills/about-sous-recipes/SKILL.tpl.md +13 -8
- package/recipes/core/sous-skills/skills/about-sous-repos/SKILL.tpl.md +63 -30
- package/recipes/core/sous-skills/sous.recipe.yaml +1 -1
|
@@ -677,17 +677,25 @@ sous repo init --for-project --workflow --no-example --readme
|
|
|
677
677
|
|
|
678
678
|
### `sous repo release`
|
|
679
679
|
|
|
680
|
-
Publishes new versions of the repository's recipes: raises their versions,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
680
|
+
Publishes new versions of the repository's recipes: raises their versions, writes the published data where
|
|
681
|
+
`sous.repo.yaml` keeps it (embedded under `published:`, in an index file, or nowhere for `index: tags`), commits
|
|
682
|
+
what changed and tags each version. It plans first and asks once, and it needs a git commit identity
|
|
683
|
+
(`user.name` and `user.email`) in the repository. `--check` only validates, and `--ci` is the setting for a
|
|
684
|
+
merge job. A recipe the repository no longer lists keeps its published versions, marked retired, with any
|
|
685
|
+
replacements `sous.repo.yaml` names (see
|
|
686
|
+
[Retire or move a recipe](repositories-authoring.md#retire-or-move-a-recipe)). It warns about every recipe that
|
|
687
|
+
uses `recommends`, which needs sous 1.2.0 or later in every subscribing project (see
|
|
686
688
|
[Recommend other recipes](repositories-authoring.md#recommend-other-recipes)).
|
|
687
689
|
|
|
690
|
+
`--create-manifest` creates `sous.repo.yaml` at the project root, listing the project's recipe paths, when there
|
|
691
|
+
is none, without asking. `--publish-dependencies` also publishes the project's own recipes that a published
|
|
692
|
+
recipe depends on, without asking. `--yes` answers neither question; see
|
|
693
|
+
[What a release writes for you](repositories-authoring.md#what-a-release-writes-for-you).
|
|
694
|
+
|
|
688
695
|
```bash
|
|
689
696
|
sous repo release --recipe workflow/task-files --bump minor --push
|
|
690
|
-
sous repo release --ci --
|
|
697
|
+
sous repo release --ci --push
|
|
698
|
+
sous repo release --create-manifest --publish-dependencies --yes
|
|
691
699
|
```
|
|
692
700
|
|
|
693
701
|
### `sous repo submit [REPO]`
|
|
@@ -44,7 +44,8 @@ sous build
|
|
|
44
44
|
The skill is written to `.claude/skills/review-helpers/SKILL.md`, as a subscribed recipe's skill
|
|
45
45
|
would be. There was nothing to subscribe to: every recipe the project's recipe paths cover is in
|
|
46
46
|
use. The manifest needs no `namespace` and no `version`. The namespace, `tooling`, came from the
|
|
47
|
-
folder holding the recipe (see [Namespaces](#namespaces)), and a version
|
|
47
|
+
folder holding the recipe (see [Namespaces](#namespaces)), and a version matters only once it is
|
|
48
|
+
published (see [Publishing](#publishing)).
|
|
48
49
|
|
|
49
50
|
Sous lists project recipes under the reserved repository name `project`, so the full ref of this
|
|
50
51
|
one is `project:tooling/review-helpers`:
|
|
@@ -181,9 +182,19 @@ character, so `.sous/recipes/*` watches all of `.sous/recipes/`.
|
|
|
181
182
|
|
|
182
183
|
## Publishing
|
|
183
184
|
|
|
184
|
-
A project recipe is never published by being there. A project
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
A project recipe is never published by being there. A project publishes the recipes its own
|
|
186
|
+
`sous.repo.yaml` lists (folders or glob patterns, such as `.sous/recipes/*`), through
|
|
187
|
+
`sous repo release`. Run in a project with no `sous.repo.yaml`, the release lists the project's
|
|
188
|
+
recipe paths and offers to create one listing them (`--create-manifest` answers yes).
|
|
189
|
+
|
|
190
|
+
A project recipe needs nothing more to be published. Its namespace is worked out the same way as for
|
|
191
|
+
a build (see [Namespaces](#namespaces)), and when it came from step 3 or later (the config, a
|
|
192
|
+
`package.json`, git or the folder's name), the release first writes a `sous.namespace.yaml` naming it
|
|
193
|
+
in the folder holding the recipe, so its published key never changes. A recipe with no `version` is
|
|
194
|
+
published as `1.0.0`, which the release writes into its manifest. A published recipe that depends on a
|
|
195
|
+
project recipe the manifest does not list makes the release ask whether to publish that one too
|
|
196
|
+
(`--publish-dependencies` answers yes). See
|
|
197
|
+
[What a release writes for you](repositories-authoring.md#what-a-release-writes-for-you).
|
|
187
198
|
|
|
188
199
|
## Where to go next
|
|
189
200
|
|
|
@@ -26,8 +26,8 @@ $ sous repo init ./my-recipes --name my-recipes --namespace workflow
|
|
|
26
26
|
// then sous init sets the repository up as a sous project, and runs its first build
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
`--name` is the repository's short name (default: the directory's own name), `--namespace` the
|
|
30
|
-
|
|
29
|
+
`--name` is the repository's short name (default: the directory's own name), `--namespace` the example recipe's
|
|
30
|
+
namespace, described in `sous.repo.yaml` (default: the repository's name), and `--dry-run` lists the files without writing them. `--host` names the repository host whose release automation to add:
|
|
31
31
|
`github` writes `.github/workflows/sous-release.yml`, and `gitlab` writes `.gitlab-ci.yml`. Without it, the host is
|
|
32
32
|
read from the directory's `origin` remote, and is `github` when there is none. Names are lowercase kebab-case, so `My-Recipes` yields `my-recipes`. Every
|
|
33
33
|
file is read back through the schemas sous uses on published repositories, so the scaffold validates. The scaffold
|
|
@@ -90,12 +90,18 @@ recipes. `--workflow`, `--example` and `--readme` answer yes ahead of time; `--n
|
|
|
90
90
|
README section sits between sous's marker comments, so the rest of the file is never touched. `--in-sous-directory`
|
|
91
91
|
writes the manifest into `.sous/` instead, where sous also looks for it. `--for-project` does not run
|
|
92
92
|
`sous init`; run it first if the project has no `.sous/` yet. A project with its own release pipeline adds one
|
|
93
|
-
step to it, `sous repo release --ci --push`, instead of the workflow.
|
|
93
|
+
step to it, `sous repo release --ci --push --yes`, instead of the workflow.
|
|
94
|
+
|
|
95
|
+
`--for-project` is optional: `sous repo release`, run in a project with no `sous.repo.yaml`, lists the
|
|
96
|
+
project's recipe paths and offers to create one at the project root listing them (`--create-manifest` answers
|
|
97
|
+
yes; see [Cut a release](#cut-a-release)).
|
|
94
98
|
|
|
95
99
|
## Write a recipe
|
|
96
100
|
|
|
97
|
-
Copy the example folder, edit its manifest, and
|
|
98
|
-
|
|
101
|
+
Copy the example folder, edit its manifest, and make sure the `recipes` list in `sous.repo.yaml` covers its
|
|
102
|
+
folder: list the folder (`recipes:`, then `- recipes/workflow/task-files` under it), or a glob pattern that
|
|
103
|
+
matches it, such as `recipes/*/*`. A pattern is expanded the way a project expands its own recipe paths, so a
|
|
104
|
+
new folder under it is published with no edit to the list.
|
|
99
105
|
|
|
100
106
|
```yaml
|
|
101
107
|
formatVersion: 1
|
|
@@ -115,7 +121,14 @@ relative to the recipe folder (and optional `exclude` patterns). Sous registers
|
|
|
115
121
|
`prompts` and `config`, and a sous plugin may register more; the kind decides what happens to them in the subscriber's project, which the subscriber shapes with
|
|
116
122
|
[`recipes`](repositories-file-formats.md#recipes-what-each-content-kind-does). Field tables are in the
|
|
117
123
|
[recipe manifest](repositories-file-formats.md#sousrecipeyaml-the-recipe-manifest) reference, and recipe
|
|
118
|
-
metadata is the source of truth for the version: never edit `
|
|
124
|
+
metadata is the source of truth for the version: never edit the published data (the `published:` block of
|
|
125
|
+
`sous.repo.yaml`, or `sous.index.json`) by hand.
|
|
126
|
+
|
|
127
|
+
`namespace` and `version` may be left out. A recipe with no `namespace` gets one worked out from where it sits,
|
|
128
|
+
as a project's own recipe does (see [Namespaces](project-recipes.md#namespaces)): the nearest
|
|
129
|
+
`sous.namespace.yaml` above it that sets a `name`, then the first folder under the `recipes` path that found
|
|
130
|
+
it, then the project's names. A recipe with no `version` is released as `1.0.0` the first time, and the release
|
|
131
|
+
writes that version into its manifest.
|
|
119
132
|
|
|
120
133
|
?> To write a recipe for one project only, or to try one out before it is published, put it under that
|
|
121
134
|
project's `.sous/recipes/` instead: every build uses it from the working tree, with no release. See
|
|
@@ -348,8 +361,8 @@ instructions so they still read correctly without it ("if the task-files skill i
|
|
|
348
361
|
|
|
349
362
|
## Cut a release
|
|
350
363
|
|
|
351
|
-
`sous repo release` publishes new versions: one run raises versions,
|
|
352
|
-
and cuts the tags. Run it inside the repository, with your recipe changes committed.
|
|
364
|
+
`sous repo release` publishes new versions: one run raises versions, writes the published data, commits what
|
|
365
|
+
changed, and cuts the tags. Run it inside the repository, with your recipe changes committed.
|
|
353
366
|
|
|
354
367
|
```term
|
|
355
368
|
$ sous repo release
|
|
@@ -363,9 +376,9 @@ $ sous repo release
|
|
|
363
376
|
|
|
364
377
|
This run would:
|
|
365
378
|
Raise the versions listed above, in the manifests that declare them.
|
|
366
|
-
|
|
367
|
-
Commit the
|
|
368
|
-
Cut one annotated tag per version, dependency-first.
|
|
379
|
+
Write the published data into sous.repo.yaml published, with each version's dependencies resolved.
|
|
380
|
+
Commit the changed files and the published data together.
|
|
381
|
+
Cut one annotated tag per version, dependency-first, each carrying its content hash.
|
|
369
382
|
Push nothing; pass '--push' to push what it makes.
|
|
370
383
|
|
|
371
384
|
Publish these versions? yes
|
|
@@ -373,7 +386,7 @@ Publish these versions? yes
|
|
|
373
386
|
▶ Publishing:
|
|
374
387
|
|
|
375
388
|
workflow/qa-helper: 0.1.0 becomes 0.1.1.
|
|
376
|
-
|
|
389
|
+
written sous.repo.yaml
|
|
377
390
|
Committed: Release workflow/qa-helper@0.1.1
|
|
378
391
|
Created the tag workflow/qa-helper@0.1.1.
|
|
379
392
|
```
|
|
@@ -384,13 +397,21 @@ stops. Three facts about each recipe decide that plan and nothing else does: whe
|
|
|
384
397
|
files changed since the tag that last published it, and whether its version was already raised past that tag. The
|
|
385
398
|
third case is what a merge looks like to continuous integration: the bump is done, so the run only publishes it.
|
|
386
399
|
|
|
400
|
+
Where the published data goes is the repository's choice: embedded in `sous.repo.yaml` under `published:`
|
|
401
|
+
(where a repository that has published nothing puts it), in `sous.index.json` or another `.json` file, or
|
|
402
|
+
nowhere but the release tags (`index: tags`). Each form, and what a release writes in it, is in
|
|
403
|
+
[Where the published data lives](repositories-file-formats.md#where-the-published-data-lives). Every annotated
|
|
404
|
+
release tag's message carries the version's content hash on a line of its own, `Sous-Hash: sha256-...`, in every
|
|
405
|
+
form.
|
|
406
|
+
|
|
387
407
|
`--namespace <ns>` and `--recipe <ns/name>` narrow the run and both repeat; `--bump <level>` is `patch` (the
|
|
388
408
|
default), `minor`, `major` or `prerelease`; `--no-bump` raises nothing; `--include-unchanged` releases every
|
|
389
409
|
recipe in scope, changed or not; `--check` only reads, validating, failing on any problem the release would
|
|
390
410
|
refuse and on a change to a recipe whose [`submissions`](repositories-file-formats.md#the-submissions-block)
|
|
391
|
-
block says it takes no proposals, and reporting how merging would rewrite the committed
|
|
392
|
-
on it, since that
|
|
393
|
-
|
|
411
|
+
block says it takes no proposals, and reporting how merging would rewrite the committed published data without
|
|
412
|
+
failing on it (`Merging rewrites <file>, because:`, then each reason), since that data is the release's output;
|
|
413
|
+
and `--ci` is the merge preset: never bump, accept the plan, never ask, fail on anything unbumped. Every flag
|
|
414
|
+
this command takes, `--tag`, `--push`, `--publish-dependencies` and `--create-manifest` among them, is in the
|
|
394
415
|
[command reference](commands.md#sous-repo-release).
|
|
395
416
|
|
|
396
417
|
`--bump` and `--no-bump` contradict each other, and so do `--check` and `--ci`; sous refuses the combination and
|
|
@@ -398,10 +419,53 @@ says which one to keep. `--ci` implies `--no-bump` and `--yes`, accepting the pl
|
|
|
398
419
|
but it deliberately does not imply `--push`, so what a workflow pushes stays visible in the workflow file. Under
|
|
399
420
|
either, a recipe whose files changed without a bump is an error naming its manifest and the colliding tag.
|
|
400
421
|
|
|
401
|
-
`--push` pushes the branch to `origin`, plus every release tag that
|
|
402
|
-
holds and that `origin` lacks
|
|
403
|
-
|
|
404
|
-
|
|
422
|
+
`--push` pushes the branch to `origin`, plus every release tag that the published data names, that this checkout
|
|
423
|
+
holds and that `origin` lacks (with `index: tags`, every release tag the checkout holds that `origin` lacks).
|
|
424
|
+
That includes tags an earlier run cut without `--push`, so the pushed published data never names a tag
|
|
425
|
+
subscribers cannot fetch. The tags go first, then the branch. A `--push` run with nothing new to release still
|
|
426
|
+
pushes them, which is how to send a release you made without `--push`.
|
|
427
|
+
|
|
428
|
+
A run with no new version still rewrites the published data when it differs from what the repository publishes
|
|
429
|
+
(a recipe retired or moved, a namespace description changed, data written by an older sous), lists why, and
|
|
430
|
+
commits it as `Update the published data of <name>`. It asks first, unless `--yes` or `--ci` is given.
|
|
431
|
+
|
|
432
|
+
### What a release writes for you
|
|
433
|
+
|
|
434
|
+
A release fills in what a repository left out, so the first release of a project's own recipes needs nothing
|
|
435
|
+
written by hand:
|
|
436
|
+
|
|
437
|
+
- **No `sous.repo.yaml`.** When there is none in the directory, its `.sous/` directory or any directory above,
|
|
438
|
+
the release lists the project's recipe paths (`projectRecipes.paths`, `.sous/recipes/*` by default) and asks
|
|
439
|
+
whether to create `sous.repo.yaml` at the project root, listing them. `--create-manifest` answers yes; without
|
|
440
|
+
a terminal and without it, the release fails naming the switch. The new manifest holds only `recipes`, so its
|
|
441
|
+
published data is embedded. `--check` and `--dry-run` never create it: their error says to run the release
|
|
442
|
+
without them, or to run `sous repo init --for-project`.
|
|
443
|
+
- **No `version`.** A recipe whose manifest names none is released as `1.0.0`, and the release writes
|
|
444
|
+
`version: 1.0.0` into the manifest, in place, keeping its comments. A recipe that already has release tags but
|
|
445
|
+
names no version is an error.
|
|
446
|
+
- **A namespace worked out from outside the recipe.** When a recipe's namespace came from the project's sous
|
|
447
|
+
config `name`, its `package.json`, its git `origin` or its folder's name, a later change to any of them would
|
|
448
|
+
change the recipe's published key. So before publishing it, the release writes a `sous.namespace.yaml` holding
|
|
449
|
+
`name: <namespace>` in the folder holding the recipe (or sets `name` in the one already there, in place). If
|
|
450
|
+
that file would change the key of another recipe, the release takes it back and stops, asking you to add
|
|
451
|
+
`namespace:` to the manifests instead.
|
|
452
|
+
- **A dependency the repository does not publish.** When a recipe it publishes depends, with no location, on one
|
|
453
|
+
of the project's own recipes that `sous.repo.yaml` does not list, subscribers could never install it. The
|
|
454
|
+
release lists those recipes and asks whether to publish them too; `--publish-dependencies` answers yes, and
|
|
455
|
+
declining stops the release. Yes adds their folders to `recipes` (and writes a `sous.namespace.yaml` for one
|
|
456
|
+
whose namespace came from its folder, so its key stays the same). Without a terminal and without the switch
|
|
457
|
+
the release fails naming it. `--check` and `--dry-run` report it as an error.
|
|
458
|
+
|
|
459
|
+
`--yes` answers neither of the two questions above; only their own switches do. A first release that should
|
|
460
|
+
ask nothing passes all three:
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
sous repo release --create-manifest --publish-dependencies --yes
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
The release commits every one of these changes before it cuts the tags. A repository that keeps its published
|
|
467
|
+
data in its tags alone (`index: tags`) is the exception under `--ci`, which changes no file there: each of these
|
|
468
|
+
changes is an error saying to commit it first, or to run the release on a machine.
|
|
405
469
|
|
|
406
470
|
### The branch rule
|
|
407
471
|
|
|
@@ -434,13 +498,16 @@ hash, its dependencies and its variable definitions are carried forward exactly
|
|
|
434
498
|
disagreement is an error telling you to bump rather than republish
|
|
435
499
|
([what is checked](repositories-file-formats.md#sousindexjson)). A version counts
|
|
436
500
|
as published once its tag exists, and the tags are the backstop, so a tagged version missing from the index is
|
|
437
|
-
rebuilt from it, dependencies included, whenever the index is regenerated,
|
|
438
|
-
publishes something. A bump edits the manifest in place, so comments, field order and layout survive; a folded
|
|
501
|
+
rebuilt from it, dependencies included, whenever the index is regenerated. A bump edits the manifest in place, so comments, field order and layout survive; a folded
|
|
439
502
|
block of YAML prose may be re-wrapped and the space before a trailing comment collapsed to one.
|
|
440
503
|
|
|
441
|
-
!> A release commits the version bumps
|
|
442
|
-
|
|
443
|
-
|
|
504
|
+
!> A release commits the files it changed (version bumps, a first version, a namespace file, the repository
|
|
505
|
+
manifest, the published data), and nothing else; the only other commit sous ever makes for you is
|
|
506
|
+
`sous repo submit --commit`. It refuses to run while anything it publishes or writes has uncommitted changes:
|
|
507
|
+
every recipe folder it publishes, `sous.repo.yaml`, the index file when the published data is one, and any
|
|
508
|
+
`sous.namespace.yaml` it is about to write, because a tag names one commit and the published data records what
|
|
509
|
+
each recipe folder holds right now. A file the same run wrote earlier (a `sous.repo.yaml` it just created, for
|
|
510
|
+
example) does not count.
|
|
444
511
|
Uncommitted changes to any other file (such as the project files a newer sous rewrites when it runs its
|
|
445
512
|
migrations in a continuous integration checkout) do not stop it, and its commit leaves them out. It also
|
|
446
513
|
refuses when git does not know who is committing: set `git config user.name` and `git config user.email` first, or
|
|
@@ -460,8 +527,8 @@ retired:
|
|
|
460
527
|
- github://other/recipes/tools/widget # a recipe in another repository
|
|
461
528
|
```
|
|
462
529
|
|
|
463
|
-
A recipe that moved to another repository is retired the same way, naming its new home.
|
|
464
|
-
|
|
530
|
+
A recipe that moved to another repository is retired the same way, naming its new home. The next release
|
|
531
|
+
writes the retirement into the published data, even when it publishes no new version. The fields and what
|
|
465
532
|
the release checks are in [Retired recipes](repositories-file-formats.md#retired-recipes); what a
|
|
466
533
|
subscriber sees is in [Retired recipes](repositories-consuming.md#retired-recipes).
|
|
467
534
|
|
|
@@ -471,7 +538,7 @@ On GitHub, `sous repo init` writes `.github/workflows/sous-release.yml`, which r
|
|
|
471
538
|
calling the CLI from npm so nothing is installed into the repository. On a **pull request** it runs
|
|
472
539
|
`npx --yes @sous-io/sous repo release --check`, which only reads, so it is safe on an untrusted branch and
|
|
473
540
|
fails the pull request when a manifest is wrong or a published version changed, and notes how the merge will
|
|
474
|
-
rewrite the
|
|
541
|
+
rewrite the published data. On a **push to `main`** it
|
|
475
542
|
runs `npx --yes @sous-io/sous repo release --ci --push --yes`; edit the workflow's `branches` list if your
|
|
476
543
|
default branch has another name. `--ci` accepts the plan on its own, the redundant `--yes` keeping the file
|
|
477
544
|
working with an older published sous. Both jobs check out with `fetch-depth: 0`, so existing tags are visible
|
|
@@ -623,9 +690,12 @@ It prints each step as it runs them:
|
|
|
623
690
|
(`gh` or `glab`) is installed and signed in, and everything is committed. `--commit` lifts that last rule:
|
|
624
691
|
sous lists what is uncommitted, asks once (`--yes` answers), checks git knows who is committing before
|
|
625
692
|
writing anything, and commits it all with the proposal's title, description and changelog as the message.
|
|
626
|
-
2. **Validation.** The repository validates, and your change leaves
|
|
627
|
-
proposal never fails the maintainer's own checks and wastes their review.
|
|
628
|
-
|
|
693
|
+
2. **Validation.** The repository validates, and your change leaves the published data as it found it, so a
|
|
694
|
+
proposal never fails the maintainer's own checks and wastes their review. Where the repository keeps it in an
|
|
695
|
+
index file, the change may not edit that file; where it is embedded in `sous.repo.yaml`, only the
|
|
696
|
+
`published:` block is compared, so a proposal may edit the rest of the manifest (to list a new recipe, for
|
|
697
|
+
example); a repository that publishes through its tags alone has nothing to compare. The published data is
|
|
698
|
+
written by the repository's own release after a merge; whether it agrees with the release tags is checked there, by
|
|
629
699
|
`sous repo release --check` on a full clone, not by `submit`. That is what lets `submit` run from the shallow
|
|
630
700
|
checkout `sous repo link` makes, which holds almost none of the tags. The comparison is made against the
|
|
631
701
|
copy of the default branch your checkout holds (`origin/main`, for example); when it holds none, `submit`
|
|
@@ -110,9 +110,11 @@ which runs the same update `unlink --update` runs; with `--dry-run` it only show
|
|
|
110
110
|
|
|
111
111
|
## What a contributor leaves alone
|
|
112
112
|
|
|
113
|
-
**Releases are the maintainers' business.** A contributor never runs `sous repo release`, and never edits
|
|
114
|
-
`sous.index.json
|
|
115
|
-
tags; `sous repo submit` refuses a change that
|
|
113
|
+
**Releases are the maintainers' business.** A contributor never runs `sous repo release`, and never edits the
|
|
114
|
+
published data: `sous.index.json`, or the `published:` block of `sous.repo.yaml`. It is written by the
|
|
115
|
+
repository's own release after a merge, from the manifests and the tags; `sous repo submit` refuses a change that
|
|
116
|
+
edits it, and says how to put it back. The rest of `sous.repo.yaml` is yours to edit, to list a new recipe, for
|
|
117
|
+
example.
|
|
116
118
|
|
|
117
119
|
**Versions depend on how the repository releases.** The release workflow `sous repo init` scaffolds, which
|
|
118
120
|
`sous-recipes` also runs, publishes on every merge to the default branch with `sous repo release --ci`, and that
|
|
@@ -43,15 +43,15 @@ one, the one at the root is used.
|
|
|
43
43
|
|
|
44
44
|
```yaml
|
|
45
45
|
formatVersion: 1 # optional; 1 when given
|
|
46
|
-
name: qa-recipes # suggested short name; a project records its own
|
|
47
|
-
namespaces:
|
|
46
|
+
name: qa-recipes # optional suggested short name; a project records its own
|
|
47
|
+
namespaces: # optional: descriptions only
|
|
48
48
|
workflow:
|
|
49
49
|
description: Recipes about how work moves through a project.
|
|
50
50
|
quality:
|
|
51
51
|
description: Recipes that exercise the edges.
|
|
52
|
-
recipes: #
|
|
52
|
+
recipes: # recipe folders or glob patterns, relative to the repository root
|
|
53
53
|
- recipes/workflow/qa-variables
|
|
54
|
-
- recipes/quality
|
|
54
|
+
- recipes/quality/*
|
|
55
55
|
retired: # optional: replacements for recipes no longer listed above
|
|
56
56
|
quality/qa-old-dep:
|
|
57
57
|
replacements:
|
|
@@ -59,19 +59,59 @@ retired: # optional: replacements for recipes no long
|
|
|
59
59
|
- github://acme/recipes/quality/qa-remote-dep # in another repository
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Only `recipes` is required for the file to be valid
|
|
63
|
-
recipe's namespace under `namespaces`.
|
|
62
|
+
Only `recipes` is required, both for the file to be valid and for `sous repo release`.
|
|
64
63
|
|
|
65
64
|
| Field | Required | Notes |
|
|
66
65
|
|-------|----------|-------|
|
|
67
|
-
| `recipes` | yes | One path, or a list of paths, relative to the repository root
|
|
68
|
-
| `name` |
|
|
69
|
-
| `namespaces` |
|
|
66
|
+
| `recipes` | yes | One path, or a list of paths, relative to the repository root; a single string is read as a list of one, and a path listed twice is an error. A path is a recipe folder or a glob pattern (`recipes/*`), expanded the way a project expands its own [`projectRecipes.paths`](project-recipes.md), in a working tree and in the repository at a tag alike. A pattern that matches no recipe yet is a warning; a listed folder that is missing, or holds no recipe manifest, is an error |
|
|
67
|
+
| `name` | no | A suggestion only; `sous repo add --name` decides what a project calls it. When it is missing, the published data uses the name of the repository's root folder |
|
|
68
|
+
| `namespaces` | no | Descriptions only, keyed by namespace name; each entry takes an optional `description`. A namespace needs no entry here: it exists because a recipe is in it. Describing one namespace here and in a [`sous.namespace.yaml`](#sousnamespaceyaml-a-namespaces-name-and-description) too stops a release, naming both |
|
|
70
69
|
| `description`, `contribute` | no | A summary for anyone reading the repository, and where to send a contribution when a provider cannot support `sous repo submit` |
|
|
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.
|
|
70
|
+
| `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. See [Where the published data lives](#where-the-published-data-lives); a project reads every form ([How a project reads a repository](#how-a-project-reads-a-repository)) |
|
|
72
71
|
| `submissions` | no | Whether the repository's recipes take proposed changes; see [The submissions block](#the-submissions-block) |
|
|
73
72
|
| `retired` | no | Keyed `namespace/recipe`; see [Retired recipes](#retired-recipes) |
|
|
74
73
|
|
|
74
|
+
### Where the published data lives
|
|
75
|
+
|
|
76
|
+
The published data is the catalog of every version the repository has published: what
|
|
77
|
+
[`sous.index.json`](#sousindexjson) holds. `sous repo release` writes it in one of three places, which
|
|
78
|
+
the `index` setting and the files beside the manifest decide:
|
|
79
|
+
|
|
80
|
+
- **Embedded**, in a `published:` block at the end of `sous.repo.yaml`. This is where a repository that
|
|
81
|
+
has published nothing (no `published:` block, and no `sous.index.json` beside the manifest) puts it on
|
|
82
|
+
its first release, so `index: embedded` is allowed but never needed. When a release writes the block, it
|
|
83
|
+
writes the whole manifest again, comments removed, in this layout:
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
# Note: Comments are systematically removed from this file.
|
|
87
|
+
formatVersion: 1
|
|
88
|
+
name: qa-recipes
|
|
89
|
+
recipes:
|
|
90
|
+
- recipes/quality/*
|
|
91
|
+
x-team: quality # extension keys come after the fields sous knows
|
|
92
|
+
# Everything below is written by Sous when it publishes recipes. Do not edit it by hand.
|
|
93
|
+
published: # what sous.index.json holds, less formatVersion and name
|
|
94
|
+
generatedAt: "2026-12-03T07:06:33.236Z"
|
|
95
|
+
generator: 1.1.13
|
|
96
|
+
recipes:
|
|
97
|
+
quality/qa-remote-dep:
|
|
98
|
+
path: recipes/quality/qa-remote-dep
|
|
99
|
+
versions: {} # each version, as in sous.index.json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The fields you edit come first, in a fixed order (`formatVersion`, `name`, `description`,
|
|
103
|
+
`contribute`, `submissions`, `index`, `namespaces`, `recipes`, `retired`), then any `x-` extension
|
|
104
|
+
keys, then the marker line and `published:`. A manifest written as JSON is written back as JSON, in the
|
|
105
|
+
same order.
|
|
106
|
+
- **In a file**: `sous.index.json` beside the manifest (a repository that already has one keeps using
|
|
107
|
+
it), or the `.json` file `index: <path>` names, relative to the repository root.
|
|
108
|
+
- **Nowhere but the tags**, with `index: tags`. A release never writes an index; the release tags are the
|
|
109
|
+
record. Run on a machine, a release still commits the recipe files it has to change (a raised version,
|
|
110
|
+
a first `1.0.0`, a `sous.namespace.yaml`, a new `sous.repo.yaml`, a dependency added to `recipes`)
|
|
111
|
+
before it tags. With `--ci` it changes no file and makes no commit, and does not push the branch: it
|
|
112
|
+
only creates tags, and pushes them with `--push`. A recipe that would need one of those file changes is
|
|
113
|
+
then an error saying to commit the change first, or to run the release on a machine.
|
|
114
|
+
|
|
75
115
|
### Retired recipes
|
|
76
116
|
|
|
77
117
|
A recipe is retired when the repository stops listing its folder under `recipes`. Nothing else is
|
|
@@ -117,8 +157,8 @@ contents: # what a subscriber actually receives
|
|
|
117
157
|
| Field | Required | Notes |
|
|
118
158
|
|-------|----------|-------|
|
|
119
159
|
| `name` | yes | Unique within the recipe's namespace |
|
|
120
|
-
| `namespace` |
|
|
121
|
-
| `version` |
|
|
160
|
+
| `namespace` | no | The recipe's namespace. A recipe that names none gets one worked out from where it is, in a repository as in a project ([Namespaces](project-recipes.md#namespaces)); before publishing such a recipe for the first time, `sous repo release` may write a `sous.namespace.yaml` beside it so its key never changes (see [Cut a release](repositories-authoring.md#cut-a-release)) |
|
|
161
|
+
| `version` | no | An exact semantic version; the manifest is the source of truth and the git tag follows it. A recipe that names none is released as `1.0.0` the first time, and the release writes `version: 1.0.0` into its manifest. A recipe that has release tags but names no version is an error |
|
|
122
162
|
| `description` | no | Copied into the index at release time; shown by `sous recipe list` and `sous repo search` |
|
|
123
163
|
| `depends`, `subscribes` | no | Build dependencies and co-subscriptions; within either list, no entry may repeat |
|
|
124
164
|
| `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) |
|
|
@@ -375,9 +415,12 @@ one of its options; `secret: true` with `scope: shared` is refused; the committe
|
|
|
375
415
|
|
|
376
416
|
## `sous.namespace.yaml`: a namespace's name and description
|
|
377
417
|
|
|
378
|
-
Hand-written, in a folder among a project's own recipes (also `.yml`, `.json` or
|
|
379
|
-
|
|
380
|
-
|
|
418
|
+
Hand-written, in a folder among a project's own recipes or a repository's (also `.yml`, `.json` or
|
|
419
|
+
`.jsonc`); `sous repo release` also writes one holding only `name` to keep a published key fixed. A recipe
|
|
420
|
+
below it whose manifest names no namespace belongs to the namespace it names; see
|
|
421
|
+
[Namespaces](project-recipes.md#namespaces). Its `description` describes the namespace its `name` gives, or,
|
|
422
|
+
with no `name`, the namespace named after its folder. One namespace described in two places (two namespace
|
|
423
|
+
files, or a namespace file and `namespaces` in `sous.repo.yaml`) stops a release with an error naming both.
|
|
381
424
|
|
|
382
425
|
```yaml
|
|
383
426
|
name: tooling # optional; lowercase kebab-case
|
|
@@ -386,10 +429,12 @@ description: Helpers for the team's own tools. # optional; shown by sous names
|
|
|
386
429
|
|
|
387
430
|
## `sous.index.json`
|
|
388
431
|
|
|
389
|
-
Machine-written by `sous repo release` and committed beside the recipes it describes
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
432
|
+
Machine-written by `sous repo release` and committed beside the recipes it describes, when the repository
|
|
433
|
+
keeps its published data in a file; the same data, less `formatVersion` and `name`, is what an embedded
|
|
434
|
+
`published:` block holds ([Where the published data lives](#where-the-published-data-lives)). Adding a
|
|
435
|
+
repository reads only the repository manifest and this file; nothing more is downloaded until a project
|
|
436
|
+
subscribes. The data may also be built from the release tags; see
|
|
437
|
+
[How a project reads a repository](#how-a-project-reads-a-repository).
|
|
393
438
|
|
|
394
439
|
```json
|
|
395
440
|
{
|
|
@@ -421,9 +466,9 @@ tags; see [How a project reads a repository](#how-a-project-reads-a-repository).
|
|
|
421
466
|
|
|
422
467
|
| Field | Where | Notes |
|
|
423
468
|
|-------|-------|-------|
|
|
424
|
-
| `generatedAt`, `generator`, `name`, `namespaces` | top level | When the index was generated and by which sous version, then the name and
|
|
425
|
-
| `recipes` | top level | Keyed `namespace/recipe
|
|
426
|
-
| `hash`, `tag` | per version | The content hash verified after every fetch, and the tag, which must be exactly `namespace/recipe@version` so a version can never point at a branch |
|
|
469
|
+
| `generatedAt`, `generator`, `name`, `namespaces` | top level | When the index was generated and by which sous version, then the repository's name (the manifest's, else the root folder's) and every namespace a published recipe is in, each with its description when the repository manifest or a `sous.namespace.yaml` gives one. `$comment` is free text, since JSON has no comments, and is ignored on a published index |
|
|
470
|
+
| `recipes` | top level | Keyed `namespace/recipe`. Each entry carries `path` (the recipe folder), `description`, and `versions`, keyed by exact version |
|
|
471
|
+
| `hash`, `tag` | per version | The content hash verified after every fetch, and the tag, which must be exactly `namespace/recipe@version` so a version can never point at a branch. The tag is annotated, and its message carries the same hash on a line of its own, `Sous-Hash: sha256-...` |
|
|
427
472
|
| `prerelease`, `releasedAt`, `seeded` | per version | Whether ranges skip it unless a subscription opts in, when it was released, and whether it is the copy sous folds in from its own package |
|
|
428
473
|
| `dependencies` | per version | The range each dependency may take, keyed `namespace/recipe`; see below |
|
|
429
474
|
| `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 |
|
|
@@ -482,8 +527,7 @@ one included. A project pinned to such a sous fails to read that index until it
|
|
|
482
527
|
**Retired recipes.** A release keeps every version a retired recipe published: the entries the committed
|
|
483
528
|
index held, and any version a tag carries that it lacks, rebuilt from the tag (the folder and description
|
|
484
529
|
come from the newest tag when the index never recorded them). A retired version whose tag no longer exists
|
|
485
|
-
is an error, as for a published one. A key is under `recipes` or under `retired`, never both
|
|
486
|
-
recipe's namespace need not be declared any more. Retired recipes sit outside `recipes`, so a namespace
|
|
530
|
+
is an error, as for a published one. A key is under `recipes` or under `retired`, never both. Retired recipes sit outside `recipes`, so a namespace
|
|
487
531
|
never reaches one and a new subscription cannot find one; a subscription or a dependency that already names
|
|
488
532
|
one still resolves to its versions.
|
|
489
533
|
|
|
@@ -182,7 +182,7 @@ On GitLab (an `origin` remote on GitLab, or `--host gitlab`) the scaffold writes
|
|
|
182
182
|
`SOUS_RELEASE_TOKEN`; see [the scaffolded workflow](repositories-authoring.md#the-scaffolded-workflow). The
|
|
183
183
|
output goes on with what `sous init` writes and with its first build, which compiles the
|
|
184
184
|
memories file. The scaffold validates as written, and never replaces a file that already exists
|
|
185
|
-
(`--overwrite` does). `sous.repo.yaml`
|
|
185
|
+
(`--overwrite` does). `sous.repo.yaml` describes the namespaces and lists the recipe folders; each folder's
|
|
186
186
|
`sous.recipe.yaml` is one recipe, with its own version, and is heavily commented. To publish recipes from a
|
|
187
187
|
project you already have instead, run `sous repo init --for-project` in it; see
|
|
188
188
|
[Publish a project's own recipes](repositories-authoring.md#publish-a-projects-own-recipes).
|
|
@@ -211,8 +211,9 @@ second recipe; its path goes in the `recipes` list at the root.
|
|
|
211
211
|
|
|
212
212
|
## 8. Release it
|
|
213
213
|
|
|
214
|
-
Releasing reads versions from the recipe manifests,
|
|
215
|
-
the repository has to be a git repository with your
|
|
214
|
+
Releasing reads versions from the recipe manifests, writes the published data (the catalog of
|
|
215
|
+
versions projects read), commits and tags, so the repository has to be a git repository with your
|
|
216
|
+
work committed:
|
|
216
217
|
|
|
217
218
|
```bash
|
|
218
219
|
cd ~/projects/my-recipes
|
|
@@ -228,15 +229,18 @@ the run would do, and asks once.
|
|
|
228
229
|
...
|
|
229
230
|
▶ Publishing:
|
|
230
231
|
workflow/example: publishing version 0.1.0.
|
|
231
|
-
|
|
232
|
+
written sous.repo.yaml
|
|
232
233
|
Committed: Release workflow/example@0.1.0
|
|
233
234
|
Created the tag workflow/example@0.1.0.
|
|
234
235
|
```
|
|
235
236
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
The published data goes into a `published:` block at the end of `sous.repo.yaml`, because the
|
|
238
|
+
repository has published nothing before; see
|
|
239
|
+
[Where the published data lives](repositories-file-formats.md#where-the-published-data-lives) for
|
|
240
|
+
the other places it can go. Add `--push` to push the commit and the tags in the same run, and
|
|
241
|
+
`--yes` to accept the plan without being asked, which is what the scaffolded workflow does. Never
|
|
242
|
+
edit the `published:` block by hand; the recipe manifests are the source of truth for versions, and
|
|
243
|
+
this command writes the catalog from them. `sous repo release --check` validates without publishing, and runs on a pull
|
|
240
244
|
request.
|
|
241
245
|
|
|
242
246
|
## 9. Add your repository to the project
|