@sous-io/sous 0.2.17 → 0.2.19
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/docs/markdown/_sidebar.md +1 -0
- package/docs/markdown/commands.md +64 -6
- package/docs/markdown/repositories-authoring.md +30 -3
- package/docs/markdown/repositories-consuming.md +44 -2
- package/docs/markdown/repositories-contributing.md +145 -0
- package/docs/markdown/repositories-file-formats.md +2 -1
- package/package.json +1 -1
- package/recipes/core/sous-skills/sous.recipe.yaml +1 -1
- package/src/commands/repo/contribute.ts +604 -0
- package/src/commands/repo/unlink.ts +333 -20
- package/src/commands/subscription/update.ts +215 -0
- package/src/lib/repos/contribute.ts +452 -0
- package/src/lib/repos/formats/links-map.ts +5 -3
- package/src/lib/repos/git-clone.ts +71 -0
- package/src/lib/repos/links.ts +2 -1
- package/src/lib/repos/locked-recipes.ts +22 -0
- package/src/lib/repos/release/changelog.ts +20 -7
- package/src/lib/repos/release/git-state.ts +16 -0
- package/src/lib/repos/release/submit-service.ts +1 -1
- package/src/lib/repos/resolver.ts +25 -2
- package/src/lib/repos/seed.ts +64 -5
- package/src/lib/repos/store/hash.ts +68 -8
- package/src/lib/repos/subscription-service.ts +744 -20
- package/src/lib/repos/update-plan.ts +234 -0
- package/src/utils/formatting.ts +27 -1
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
- [Overview](repositories.md)
|
|
13
13
|
- [Quickstart](repositories-quickstart.md)
|
|
14
14
|
- [Consuming recipes](repositories-consuming.md)
|
|
15
|
+
- [Contributing a change](repositories-contributing.md)
|
|
15
16
|
- [Authoring a repository](repositories-authoring.md)
|
|
16
17
|
- [Recipe variables](repositories-variables.md)
|
|
17
18
|
- [Providers](repositories-providers.md)
|
|
@@ -231,9 +231,50 @@ Example: `sous repo link sous-recipes ~/Projects/sous-recipes`, or `sous repo li
|
|
|
231
231
|
--generate-branch --latest --yes`
|
|
232
232
|
|
|
233
233
|
### `sous repo unlink REPO`
|
|
234
|
-
Stops reading a repository from a working copy
|
|
235
|
-
it appears in `sous.links.json` (see
|
|
236
|
-
|
|
234
|
+
Stops reading a repository from a working copy, goes back to the versions the lockfile pins, and rebuilds the
|
|
235
|
+
project; `REPO` is the short name as it appears in `sous.links.json` (see
|
|
236
|
+
[File formats](repositories-file-formats.md)). On its own it also fetches the repository's index, with a short
|
|
237
|
+
timeout, and reports any newer published version the ranges allow, without moving anything; when the index
|
|
238
|
+
cannot be fetched in time it says it could not check. The checkout stays where it is unless `--remove` is passed.
|
|
239
|
+
Takes `--dry-run`, `--no-build`, `--answer` and `--answers-file`.
|
|
240
|
+
|
|
241
|
+
- `--global`: remove the machine-wide link, not this project's.
|
|
242
|
+
- `--update`: move this repository's pins to the newest versions their ranges allow before rebuilding. It runs
|
|
243
|
+
the same code as `sous subscription update REPO`.
|
|
244
|
+
- `--remove`: delete the checkout as well, but only one sous cloned itself; a checkout linked by path is refused
|
|
245
|
+
with an error. Uncommitted changes, commits no remote has and stashes are listed first and asked about.
|
|
246
|
+
- `-y, --yes`: answer every question this command asks: deleting a checkout that holds work, the update plan,
|
|
247
|
+
and the trust question for a repository a newer version needs (also `--force`, `--trust`).
|
|
248
|
+
|
|
249
|
+
Example: `sous repo unlink sous-recipes --update`
|
|
250
|
+
|
|
251
|
+
### `sous repo contribute REF`
|
|
252
|
+
Starts a contribution to a recipe repository, or finishes one with `--finish`, by running `sous repo link`,
|
|
253
|
+
`sous repo submit` and `sous repo unlink` in order; see [Contributing a change](repositories-contributing.md).
|
|
254
|
+
`REF` names a repository, or a namespace or recipe, in which case the repository that publishes it is used.
|
|
255
|
+
Each step runs the real command with the flags below passed through, prints as it runs, and a failure names the
|
|
256
|
+
step that failed and the steps that completed. `--dry-run` prints each step and runs none. Also spelled
|
|
257
|
+
`sous repo contrib`.
|
|
258
|
+
|
|
259
|
+
Starting runs `sous repo link REPO --latest --generate-branch`:
|
|
260
|
+
|
|
261
|
+
- `--create-branch <name>`: start on a new branch with this name instead of a generated one.
|
|
262
|
+
- `--branch <name>`: work on an existing branch instead of a new one (when finishing, the branch to submit).
|
|
263
|
+
- `--from <branch>`: the base of the new branch; defaults to the repository's default branch.
|
|
264
|
+
- `--global`: the machine-wide link, sharing one checkout (when finishing, too).
|
|
265
|
+
|
|
266
|
+
Finishing looks for work no proposal carries yet (uncommitted changes, commits never pushed, or pushed commits
|
|
267
|
+
with no open proposal), asks whether to submit it with `sous repo submit REPO`, then runs
|
|
268
|
+
`sous repo unlink REPO --update`. With nothing to submit, the submit step is skipped without asking.
|
|
269
|
+
|
|
270
|
+
- `--submit`, `--no-submit`: submit without asking, or finish without submitting.
|
|
271
|
+
- `--title <text>`, `--body <text>`, `--draft`, `--commit`: passed through to `sous repo submit`.
|
|
272
|
+
- `--remove`: passed through to `sous repo unlink`, deleting the checkout sous cloned.
|
|
273
|
+
- `-y, --yes`: passed through to every step, and submits without asking (also `-f`, `--force`).
|
|
274
|
+
- `--accept-first`: when `REF` matches several things, take the first one listed.
|
|
275
|
+
|
|
276
|
+
Example: `sous repo contribute workflow/task-files`, then `sous repo contribute workflow/task-files --finish
|
|
277
|
+
--title "Clarify the resume steps" --body "The resume steps skipped the task file."`
|
|
237
278
|
|
|
238
279
|
### `sous repo init [DIRECTORY]`
|
|
239
280
|
Creates a new recipe repository in a directory, defaulting to the current one; `--dry-run` prints the files it
|
|
@@ -306,6 +347,20 @@ Example: `sous subscription add workflow/task-files@^1.2.0 --answer apiUrl=https
|
|
|
306
347
|
Removes a subscription and everything only it brought in, then rebuilds so those files are gone. Also spelled
|
|
307
348
|
`sous unsubscribe`. Takes `--dry-run` and `--no-build`. Example: `sous subscription remove workflow/task-files`
|
|
308
349
|
|
|
350
|
+
### `sous subscription update [REF]`
|
|
351
|
+
Moves the lockfile's pins to the newest published versions their ranges allow, then rebuilds the project. With
|
|
352
|
+
no `REF` it covers every subscription; a `REF` naming a repository, a namespace or a recipe narrows it, and
|
|
353
|
+
everything outside it stays where it is pinned. It fetches every trusted repository's index first, never widens
|
|
354
|
+
a range, moves dependencies with the closure, and changes only the lockfile, never the subscriptions. It prints
|
|
355
|
+
the plan and asks once; with nothing to update it says so and asks nothing. See
|
|
356
|
+
[Moving to newer versions](repositories-consuming.md#moving-to-newer-versions). Takes `--no-build`, `--answer`
|
|
357
|
+
and `--answers-file`, and `--dry-run`, which fetches the indexes but downloads no recipe and writes nothing.
|
|
358
|
+
|
|
359
|
+
- `-y, --yes`: accept the plan, and trust any repository a newer version needs (also `--force`, `--trust`).
|
|
360
|
+
- `--accept-first`: when `REF` matches several things, take the first one listed.
|
|
361
|
+
|
|
362
|
+
Example: `sous subscription update workflow/task-files`
|
|
363
|
+
|
|
309
364
|
### `sous subscription list`
|
|
310
365
|
Lists the subscriptions this project declares, switched-off ones included, with the range each resolves within,
|
|
311
366
|
the versions the lockfile pins, the latest version each of those recipes has published, where it came from and
|
|
@@ -317,7 +372,8 @@ only the subscriptions that have pinned something. Example: `sous subscription l
|
|
|
317
372
|
|
|
318
373
|
`namespace` reads the cached indexes and the lockfile, so it works offline. A trusted repository whose index has
|
|
319
374
|
never been fetched is named at the end of a listing, not left out. Both commands take the
|
|
320
|
-
[browsing flags](#flags-that-browse); with `--installed` the recipe count is the number installed.
|
|
375
|
+
[browsing flags](#flags-that-browse); with `--installed` the recipe count is the number installed. The core version this installation of sous
|
|
376
|
+
ships is listed even while the cached index does not publish it yet.
|
|
321
377
|
|
|
322
378
|
### `sous namespace list`
|
|
323
379
|
Lists every namespace the trusted repositories publish, how many recipes each holds, and how much of it this
|
|
@@ -354,8 +410,10 @@ Prints what `.sous/sous.lock.json` pins: the recipe, the version, the repository
|
|
|
354
410
|
### `sous lock rebuild`
|
|
355
411
|
Recomputes the whole lockfile from the subscriptions the config declares and the cached indexes, starting from
|
|
356
412
|
empty, so an entry nothing holds any more is dropped rather than carried through: the repair for a file that
|
|
357
|
-
drifted through a hand edit or a bad merge. It asks nothing, grants no trust and downloads nothing.
|
|
358
|
-
|
|
413
|
+
drifted through a hand edit or a bad merge. It asks nothing, grants no trust and downloads nothing. The core
|
|
414
|
+
version this installation of sous ships resolves even when the cached index has not published it yet, exactly
|
|
415
|
+
as it does in a build. To move pins to versions published since the last fetch, use `sous subscription update`.
|
|
416
|
+
Takes `--dry-run`. Example: `sous lock rebuild --dry-run`
|
|
359
417
|
|
|
360
418
|
## vars
|
|
361
419
|
|
|
@@ -289,8 +289,29 @@ and freshness checks no longer apply to it. Builds say so every time.
|
|
|
289
289
|
Run 'sous repo unlink my-recipes' to go back to published versions.
|
|
290
290
|
```
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
### Unlink, and pick up your release
|
|
293
|
+
|
|
294
|
+
Linking never touches the lockfile, so `sous repo unlink my-recipes` goes back to exactly the versions pinned
|
|
295
|
+
before the link, and rebuilds the project so its outputs match them. It also fetches the repository's index,
|
|
296
|
+
with a short timeout, and says whether a newer version the ranges allow has been published since; it moves
|
|
297
|
+
nothing, and when the index cannot be fetched in time it says it could not check. Unlinking a name linked in
|
|
298
|
+
the other scope says which scope holds it.
|
|
299
|
+
|
|
300
|
+
Once your change is released, one of these moves the project onto it:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
sous repo unlink my-recipes --update # unlink, move this repository's pins, then rebuild
|
|
304
|
+
sous subscription update my-recipes # the same move, when nothing is linked any more
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
`--update` runs exactly the code `sous subscription update my-recipes` runs: every pin the repository supplies
|
|
308
|
+
moves to the newest version its range allows, after one plan and one question. See
|
|
309
|
+
[Moving to newer versions](repositories-consuming.md#moving-to-newer-versions).
|
|
310
|
+
|
|
311
|
+
The checkout stays where it is unless you pass `--remove`, because `sous repo submit` uses a leftover checkout to
|
|
312
|
+
revise a proposal that is still open. `--remove` deletes it only when sous cloned it; a checkout you linked by
|
|
313
|
+
path is yours, and sous refuses with an error. Before deleting, sous lists anything in the checkout that exists
|
|
314
|
+
nowhere else (uncommitted changes, commits no remote has, and stashes) and asks; `--yes` answers ahead.
|
|
294
315
|
|
|
295
316
|
### How a checkout compares with upstream
|
|
296
317
|
|
|
@@ -347,6 +368,10 @@ changing its branch says it affects all of them.
|
|
|
347
368
|
|
|
348
369
|
## Contribute to someone else's repository
|
|
349
370
|
|
|
371
|
+
?> The whole path a recipe user takes, from starting a change in their own project to picking up the released
|
|
372
|
+
version, is one page: [Contributing a change](repositories-contributing.md). `sous repo contribute` chains the
|
|
373
|
+
commands this section and [Edit a repository in place](#edit-a-repository-in-place) describe.
|
|
374
|
+
|
|
350
375
|
`sous repo submit` proposes a change to a repository's maintainers and follows it through; it never publishes
|
|
351
376
|
and never writes to a repository directly. Run it inside the recipe repository you changed, or from a project
|
|
352
377
|
that links it: `sous repo submit sous-recipes` runs in the linked checkout, and with no argument the project's
|
|
@@ -380,7 +405,8 @@ your change carries with the default branch:
|
|
|
380
405
|
|
|
381
406
|
- recipes added, and recipes retired (a renamed recipe shows as one of each);
|
|
382
407
|
- version changes;
|
|
383
|
-
- recipes whose files changed without a version raise,
|
|
408
|
+
- recipes whose files changed without a version raise, with a warning that a release run with `--ci` (as the
|
|
409
|
+
scaffolded workflow runs it after a merge) refuses a changed recipe whose version was not raised;
|
|
384
410
|
- namespaces added or removed;
|
|
385
411
|
- variables added, removed or changed, with a warning that removing a variable or tightening its validation is
|
|
386
412
|
usually a major change.
|
|
@@ -413,6 +439,7 @@ that field in your own repository so a contributor is never left without a route
|
|
|
413
439
|
|
|
414
440
|
- [Repository file formats](repositories-file-formats.md): every manifest and index schema
|
|
415
441
|
- [Consuming recipes](repositories-consuming.md): the other side, from `repo add` to `build`
|
|
442
|
+
- [Contributing a change](repositories-contributing.md): proposing a change to a recipe you use, start to finish
|
|
416
443
|
- [Command reference](commands.md): every command and flag
|
|
417
444
|
- [Providers](repositories-providers.md): what `gh` and `glab` can each do for a release and a submission
|
|
418
445
|
- [Recipe variables](repositories-variables.md): how the definitions declared here are answered at build time
|
|
@@ -220,7 +220,48 @@ build` instead. The `Latest version` column beside it is read from the cache, or
|
|
|
220
220
|
`sous repo list` shows each trusted repository with its provider, origin, whether it is linked, its
|
|
221
221
|
recipe count and its URL; `--verbose` adds a `Namespaces:` line under each row. `sous lock show`
|
|
222
222
|
prints the other half: every version your lockfile pins, where it came from and who holds it. When
|
|
223
|
-
that file has drifted, `sous lock rebuild` recomputes it from your subscriptions
|
|
223
|
+
that file has drifted, `sous lock rebuild` recomputes it from your subscriptions and the cached
|
|
224
|
+
indexes, fetching nothing.
|
|
225
|
+
|
|
226
|
+
## Moving to newer versions
|
|
227
|
+
|
|
228
|
+
A build holds the versions the lockfile pins, so a newer release reaches the project only when
|
|
229
|
+
something moves the pin. `sous subscription update` is that step:
|
|
230
|
+
|
|
231
|
+
```term
|
|
232
|
+
$ sous subscription update workflow/qa-variables
|
|
233
|
+
Updating the recipe 'qa-recipes:workflow/qa-variables' changes the lockfile:
|
|
234
|
+
|
|
235
|
+
• Adding workflow/qa-helper version 1.0.0
|
|
236
|
+
• Updating workflow/qa-variables from version 0.1.0 to version 0.2.0
|
|
237
|
+
|
|
238
|
+
Update the lockfile? (y/N)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
It fetches every trusted repository's index first, so a version published a minute ago counts.
|
|
242
|
+
With no reference it covers every subscription; a reference names a repository, a namespace or a
|
|
243
|
+
recipe, at any level of qualification, and everything outside it stays exactly where it is pinned.
|
|
244
|
+
What it will and will not do:
|
|
245
|
+
|
|
246
|
+
- A pin moves only within the range its subscription declares, or the range the recipe depending
|
|
247
|
+
on it declares; a range is never widened. Prereleases count only for a subscription that opted
|
|
248
|
+
into them.
|
|
249
|
+
- Dependencies move with the closure: a dependency a newer version adds is pinned, and one it
|
|
250
|
+
dropped leaves the lockfile unless something else still holds it.
|
|
251
|
+
- Only the lockfile changes. Your subscriptions stay exactly as they are written.
|
|
252
|
+
- It prints the plan and asks once; `--yes` accepts it, and a run with no terminal and no `--yes`
|
|
253
|
+
fails naming the flag. With nothing to update it says so and asks nothing.
|
|
254
|
+
- A repository a newer version needs that the project does not trust goes through the usual trust
|
|
255
|
+
question, and new questions the newer versions ask are asked the way subscribing asks them.
|
|
256
|
+
- A repository whose index cannot be fetched is skipped and named, and its pins stay put.
|
|
257
|
+
- A linked repository's pins move too, and the plan notes that builds keep reading the checkout
|
|
258
|
+
until it is unlinked.
|
|
259
|
+
- The built-in `core` subscription never moves: its range is exactly the running sous version, so
|
|
260
|
+
upgrading sous is what moves it.
|
|
261
|
+
|
|
262
|
+
It rebuilds the project afterwards. `--dry-run` fetches the indexes and prints the plan, and
|
|
263
|
+
downloads no recipe and writes nothing, so the dependencies and questions of a version this machine
|
|
264
|
+
does not hold yet are named rather than listed. `--no-build` skips the rebuild.
|
|
224
265
|
|
|
225
266
|
## Remove a subscription
|
|
226
267
|
|
|
@@ -290,7 +331,8 @@ lapsed (`store.freshnessSeconds`, five minutes by default), or when a command fo
|
|
|
290
331
|
check never breaks a build, because the cached index is used instead. Always-pull changes what
|
|
291
332
|
happens after that check, not how often it happens: a repository or subscription marked
|
|
292
333
|
`alwaysPull` takes a newer in-range version rather than the locked one; set it with
|
|
293
|
-
`--always-pull`, or on either entry in the config.
|
|
334
|
+
`--always-pull`, or on either entry in the config. Without it, `sous subscription update` is how a
|
|
335
|
+
pin moves; see [Moving to newer versions](#moving-to-newer-versions).
|
|
294
336
|
|
|
295
337
|
Every other repository the lockfile pins from is checked on the same window, only to tell you what
|
|
296
338
|
is newer. A build lists each recipe with a newer version inside the range declared for it, beside
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Contributing a Recipe Change
|
|
2
|
+
|
|
3
|
+
This page takes you from "a recipe I use could be better" to "my project runs the released fix", for a recipe
|
|
4
|
+
published by someone else's repository. It is written for the person using the recipe, not the person who
|
|
5
|
+
maintains it; everything happens from inside your own project.
|
|
6
|
+
|
|
7
|
+
One command covers the lifecycle: `sous repo contribute` starts a contribution, and `sous repo contribute --finish`
|
|
8
|
+
ends it. Each step it takes is an ordinary sous command, named on this page, so you can also run the parts by
|
|
9
|
+
hand.
|
|
10
|
+
|
|
11
|
+
## Start
|
|
12
|
+
|
|
13
|
+
Name the repository, or any namespace or recipe it publishes:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
sous repo contribute sous-recipes # the repository itself
|
|
17
|
+
sous repo contribute workflow/task-files # the repository that publishes this recipe
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
A namespace or recipe is resolved to the repository that publishes it, the same way every other command resolves
|
|
21
|
+
a reference; a name that matches in more than one trusted repository is a question, which `--accept-first`
|
|
22
|
+
answers by taking the first match.
|
|
23
|
+
|
|
24
|
+
Starting runs one step, `sous repo link <repo> --latest --generate-branch`:
|
|
25
|
+
|
|
26
|
+
- the repository is cloned into `.sous/repos/<owner>/<name>`, or the clone already there is reused;
|
|
27
|
+
- its default branch is brought up to upstream's (anything that would discard local work is listed and asked
|
|
28
|
+
about first; `--yes` answers);
|
|
29
|
+
- a new branch named `sous/edit-<YYYYMMDD>-<HHMM>` is created from it, so the change never stacks on an old,
|
|
30
|
+
already-merged branch;
|
|
31
|
+
- the project is pointed at the checkout, so builds read the repository from it instead of from a published
|
|
32
|
+
version.
|
|
33
|
+
|
|
34
|
+
Name the branch yourself with `--create-branch <name>`, work on a branch that already exists with
|
|
35
|
+
`--branch <name>`, or start the new branch from another base with `--from <branch>`. `--global` links the
|
|
36
|
+
machine-wide checkout that every project on this machine shares. The link and its flags are described in full
|
|
37
|
+
under [Edit a repository in place](repositories-authoring.md#edit-a-repository-in-place).
|
|
38
|
+
|
|
39
|
+
`--dry-run` prints the step without running it.
|
|
40
|
+
|
|
41
|
+
## Edit, and see the change in your own build
|
|
42
|
+
|
|
43
|
+
Edit the recipe's files in the checkout the start step printed. While the repository is linked, every build in
|
|
44
|
+
your project reads its recipes from that checkout, so the next `sous build` shows your edit in your own agent's
|
|
45
|
+
files; there is nothing to publish first. Builds say the repository is linked every time, because a link
|
|
46
|
+
bypasses versions, the lockfile and freshness checks.
|
|
47
|
+
|
|
48
|
+
Commit your work on the branch as you go. What a proposal carries is commits.
|
|
49
|
+
|
|
50
|
+
## Propose the change
|
|
51
|
+
|
|
52
|
+
Finishing proposes whatever is not proposed yet, so you can go straight to [Finish](#finish). To open the proposal
|
|
53
|
+
now and keep working, run the submit step on its own:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
sous repo submit sous-recipes --title "Clarify the resume steps" --body "The resume steps skipped the task file."
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`sous repo submit` validates the repository, pushes the branch (through a fork on your own account when you
|
|
60
|
+
cannot push to the repository itself) and opens a pull request or merge request through the host's own command
|
|
61
|
+
line tool. Its body is your description followed by a changelog sous generates. Every step it takes is described
|
|
62
|
+
under [Contribute to someone else's repository](repositories-authoring.md#contribute-to-someone-elses-repository).
|
|
63
|
+
|
|
64
|
+
## Revise it
|
|
65
|
+
|
|
66
|
+
Review comments are answered with more commits on the same branch. Commit them, then run
|
|
67
|
+
`sous repo submit sous-recipes` again: it finds the open proposal for the branch and pushes the new commits into
|
|
68
|
+
it. A new `--title` or `--body` replaces the proposal's own. With nothing new to send, it reports where the
|
|
69
|
+
proposal stands (review, checks, and whether it can merge). `sous repo submit sous-recipes --status` only
|
|
70
|
+
reports.
|
|
71
|
+
|
|
72
|
+
## Finish
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
sous repo contribute sous-recipes --finish
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Finishing first looks at the branch for work no proposal carries yet: uncommitted changes, commits that were never
|
|
79
|
+
pushed, or pushed commits with no open proposal behind them (that last one is looked up with the host's command
|
|
80
|
+
line tool). When it finds some, it asks whether to submit it; `--submit` or `--yes` submits without asking,
|
|
81
|
+
`--no-submit` finishes without submitting, and a run with no terminal fails naming those flags. When there is
|
|
82
|
+
nothing to submit, that part is skipped. The submit step passes `--title`, `--body`, `--draft`, `--commit` and
|
|
83
|
+
`--branch` through to `sous repo submit`.
|
|
84
|
+
|
|
85
|
+
Then it runs `sous repo unlink <repo> --update`:
|
|
86
|
+
|
|
87
|
+
- the project goes back to reading published versions, exactly the ones the lockfile pinned before the link;
|
|
88
|
+
- each pin the repository supplies moves to the newest published version its range allows;
|
|
89
|
+
- the project is rebuilt.
|
|
90
|
+
|
|
91
|
+
The checkout stays on disk, so an open proposal can still be revised from it later with `sous repo submit`. Pass
|
|
92
|
+
`--remove` to delete it as well; sous deletes only a checkout it cloned, and lists anything in it that exists
|
|
93
|
+
nowhere else before asking.
|
|
94
|
+
|
|
95
|
+
Every step prints as it runs, preceded by the command line that runs it. When a step fails, its own error comes
|
|
96
|
+
first, followed by the name of the step that failed and the steps that had already completed; nothing after the
|
|
97
|
+
failed step runs. `--dry-run` shows what finishing would do and runs none of it.
|
|
98
|
+
|
|
99
|
+
## Pick up the release
|
|
100
|
+
|
|
101
|
+
A contribution ships when the repository's maintainers merge it and the repository releases a new version. If
|
|
102
|
+
that happened before you finished, `--finish` already moved your pins to it. If it happens later, move them with
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
sous subscription update sous-recipes
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
which runs the same update `unlink --update` runs; with `--dry-run` it only shows what it would move. See
|
|
109
|
+
[Moving to newer versions](repositories-consuming.md#moving-to-newer-versions).
|
|
110
|
+
|
|
111
|
+
## What a contributor leaves alone
|
|
112
|
+
|
|
113
|
+
**Releases are the maintainers' business.** A contributor never runs `sous repo release`, and never edits
|
|
114
|
+
`sous.index.json`. The index is written by the repository's own release after a merge, from the manifests and the
|
|
115
|
+
tags; `sous repo submit` refuses a change that edits it, and says how to put it back.
|
|
116
|
+
|
|
117
|
+
**Versions depend on how the repository releases.** The release workflow `sous repo init` scaffolds, which
|
|
118
|
+
`sous-recipes` also runs, publishes on every merge to the default branch with `sous repo release --ci`, and that
|
|
119
|
+
raises no versions: the version a merge publishes is the one the merged change declares. A recipe whose files
|
|
120
|
+
changed while its `version` still equals its last release tag stops that release. So, unless the repository's
|
|
121
|
+
contribution guide says its maintainers raise versions themselves, raise the recipe's `version` in its
|
|
122
|
+
`sous.recipe.yaml` by hand as part of your change: a patch step for wording and fixes, a minor step for new files
|
|
123
|
+
or a new optional variable, and a major step for anything that breaks an existing subscriber (removing a file,
|
|
124
|
+
renaming a variable, or tightening a variable's validation). The changelog `sous repo submit` generates lists any
|
|
125
|
+
recipe your change touches without a version raise, with a warning that a `--ci` release refuses it, so a missed
|
|
126
|
+
one is visible in the proposal. The repository's
|
|
127
|
+
own guide is named by the `contribute` field of its `sous.repo.yaml`; for `sous-recipes` it is its
|
|
128
|
+
`CONTRIBUTING.md`.
|
|
129
|
+
|
|
130
|
+
**Core is edited in sous itself.** The `core` recipes in `sous-io/sous-recipes` are machine-written copies. Their
|
|
131
|
+
source is `recipes/core/sous-skills/` in `sous-io/sous`, and each sous release overwrites the copy, so an edit
|
|
132
|
+
merged into the copy would be lost. Their manifest says so with a
|
|
133
|
+
[`submissions`](repositories-file-formats.md#the-submissions-block) block: `sous repo submit` warns before
|
|
134
|
+
proposing a change that touches one and names where to send it instead, and the repository's own pull request
|
|
135
|
+
check refuses such a change. Propose core edits as a pull request to `sous-io/sous`.
|
|
136
|
+
|
|
137
|
+
## The commands this chains
|
|
138
|
+
|
|
139
|
+
| Part of the lifecycle | What `sous repo contribute` runs |
|
|
140
|
+
|-----------------------|----------------------------------|
|
|
141
|
+
| Start | `sous repo link <repo> --latest --generate-branch` (or the branch you named) |
|
|
142
|
+
| Propose, when finishing | `sous repo submit <repo>`, with the proposal flags passed through |
|
|
143
|
+
| Finish | `sous repo unlink <repo> --update`, plus `--remove` when given |
|
|
144
|
+
|
|
145
|
+
Every flag is listed in the [command reference](commands.md#sous-repo-contribute-ref).
|
|
@@ -252,7 +252,8 @@ freshness checks; entries are keyed by the repository's configured short name.
|
|
|
252
252
|
```
|
|
253
253
|
|
|
254
254
|
`path` is absolute; `origin` is `clone` when sous cloned the working copy itself and `path` when it was
|
|
255
|
-
pointed at an existing checkout
|
|
255
|
+
pointed at an existing checkout. Unlinking removes the entry and leaves the checkout in place, unless
|
|
256
|
+
`sous repo unlink --remove` is asked to delete one sous cloned; it never deletes a `path` checkout. Both the
|
|
256
257
|
project's `.sous/sous.links.json` and `$SOUS_HOME/sous.links.json` are read, and the project's entries win.
|
|
257
258
|
|
|
258
259
|
## Configuration keys
|
package/package.json
CHANGED