@sous-io/sous 0.2.15 → 0.2.17

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.
Files changed (39) hide show
  1. package/docs/markdown/commands.md +63 -16
  2. package/docs/markdown/repositories-authoring.md +52 -11
  3. package/docs/markdown/repositories-consuming.md +32 -1
  4. package/docs/markdown/repositories-file-formats.md +20 -0
  5. package/docs/markdown/repositories-providers.md +20 -10
  6. package/package.json +1 -1
  7. package/recipes/core/sous-skills/sous.recipe.yaml +8 -1
  8. package/src/commands/namespace/list.ts +42 -21
  9. package/src/commands/namespace/show.ts +32 -12
  10. package/src/commands/recipe/list.ts +40 -23
  11. package/src/commands/recipe/show.ts +28 -6
  12. package/src/commands/repo/list.ts +67 -10
  13. package/src/commands/repo/release.ts +41 -0
  14. package/src/commands/repo/search.ts +68 -15
  15. package/src/commands/repo/submit.ts +245 -35
  16. package/src/commands/subscription/list.ts +98 -19
  17. package/src/lib/build-preparation.ts +44 -1
  18. package/src/lib/repos/catalog-display.ts +101 -2
  19. package/src/lib/repos/catalog-inputs.ts +145 -17
  20. package/src/lib/repos/catalog.ts +92 -5
  21. package/src/lib/repos/formats/common.ts +20 -0
  22. package/src/lib/repos/formats/recipe-manifest.ts +7 -0
  23. package/src/lib/repos/formats/repo-manifest.ts +8 -0
  24. package/src/lib/repos/freshness.ts +56 -0
  25. package/src/lib/repos/providers/base.ts +33 -1
  26. package/src/lib/repos/providers/github.ts +276 -3
  27. package/src/lib/repos/providers/gitlab.ts +1 -0
  28. package/src/lib/repos/providers/http.ts +7 -2
  29. package/src/lib/repos/providers/index-cache.ts +56 -17
  30. package/src/lib/repos/providers/provider.ts +121 -3
  31. package/src/lib/repos/release/changelog.ts +448 -0
  32. package/src/lib/repos/release/git-state.ts +101 -15
  33. package/src/lib/repos/release/index.ts +2 -0
  34. package/src/lib/repos/release/submissions.ts +214 -0
  35. package/src/lib/repos/release/submit-checkout.ts +271 -0
  36. package/src/lib/repos/release/submit-questions.ts +153 -0
  37. package/src/lib/repos/release/submit-service.ts +581 -174
  38. package/src/lib/repos/subscription-service.ts +138 -9
  39. package/src/utils/flags.ts +24 -0
@@ -2,21 +2,32 @@
2
2
  * `sous repo search <text>`.
3
3
  *
4
4
  * Searches the cached index of every repository this project trusts: recipe
5
- * names, namespace names and descriptions. It reads only what is already on
6
- * disk, so it works offline and never downloads anything; a repository whose
7
- * index has not been fetched yet is named at the end rather than silently left
8
- * out of the results.
5
+ * names, namespace names and descriptions. By default it reads only what is
6
+ * already on disk, so it works offline and never downloads anything; a
7
+ * repository whose index has not been fetched yet is named at the end rather
8
+ * than silently left out of the results. `--latest` searches each index as
9
+ * upstream serves it, saving nothing, and `--installed` searches only the
10
+ * recipes the lockfile pins, showing the installed version.
9
11
  */
10
12
 
11
13
  import { Args, Flags } from "@oclif/core";
12
14
  import { BaseCommand } from "../../base-command.js";
13
15
  import { subscriptionServiceFor } from "../../lib/repos/subscription-service.js";
16
+ import { readTrustedIndexes } from "../../lib/repos/catalog-inputs.js";
17
+ import {
18
+ LINKED_NOTE,
19
+ describeIndexSource,
20
+ pinnedCell,
21
+ } from "../../lib/repos/catalog-display.js";
22
+ import { readEffectiveLinks } from "../../lib/repos/links.js";
14
23
  import { renderTable, type TableColumn } from "../../utils/table.js";
24
+ import { browsingFlags } from "../../utils/flags.js";
15
25
  import {
16
26
  blankLine,
17
27
  footer,
18
28
  indent,
19
29
  log,
30
+ note,
20
31
  paragraph,
21
32
  section,
22
33
  showCommandVars,
@@ -45,12 +56,24 @@ const COLUMNS: TableColumn[] = [
45
56
  },
46
57
  ];
47
58
 
59
+ /** The column an `--installed` search adds: the version the lockfile pins. */
60
+ const INSTALLED_COLUMN: TableColumn = {
61
+ key: "installed",
62
+ header: "Installed",
63
+ overflow: "truncate",
64
+ minWidth: 9,
65
+ };
66
+
48
67
  /** One recipe that matched, ready to be shown. */
49
68
  type Match = {
50
69
  repo: string;
51
70
  key: string;
52
71
  description: string;
53
72
  versions: string[];
73
+ /** The version the lockfile pins, when it pins this recipe from this repository. */
74
+ installed?: string;
75
+ /** The linked checkout builds read it from, when it is installed and its repository is linked. */
76
+ linkedPath?: string;
54
77
  };
55
78
 
56
79
  export default class RepoSearch extends BaseCommand {
@@ -67,6 +90,7 @@ export default class RepoSearch extends BaseCommand {
67
90
  static examples = [
68
91
  "<%= config.bin %> repo search task",
69
92
  "<%= config.bin %> repo search browser --limit 50",
93
+ "<%= config.bin %> repo search task --installed --latest",
70
94
  ];
71
95
 
72
96
  static args = {
@@ -78,6 +102,7 @@ export default class RepoSearch extends BaseCommand {
78
102
 
79
103
  static flags = {
80
104
  ...BaseCommand.baseFlags,
105
+ ...browsingFlags(),
81
106
  limit: Flags.integer({
82
107
  description: "How many matches to show",
83
108
  default: 25,
@@ -92,6 +117,8 @@ export default class RepoSearch extends BaseCommand {
92
117
  Project: this.projectLabel,
93
118
  Config: this.configContext.configPath,
94
119
  Searching: args.text,
120
+ Reading: describeIndexSource(flags.latest),
121
+ ...(flags.installed ? { Showing: "only what this project has installed" } : {}),
95
122
  });
96
123
 
97
124
  section("Recipes matching your search");
@@ -104,16 +131,17 @@ export default class RepoSearch extends BaseCommand {
104
131
 
105
132
  const repos = Object.keys(service.currentRepos()).sort();
106
133
  const matches: Match[] = [];
107
- const notFetched: string[] = [];
108
-
109
- for (const repo of repos) {
110
- const index = service.cachedIndex(repo);
111
- if (index === undefined) {
112
- notFetched.push(repo);
113
- continue;
114
- }
134
+ const indexes = await readTrustedIndexes(service, { latest: flags.latest });
135
+ const { notFetched, notChecked } = indexes;
136
+ const lock = service.lockService.read();
137
+ const links = readEffectiveLinks(this.configContext.sousDir);
115
138
 
139
+ for (const { name: repo, index } of indexes.repos) {
116
140
  for (const [key, recipe] of Object.entries(index.recipes)) {
141
+ const locked = lock.recipes[key];
142
+ const installed = locked?.repo === repo ? locked.version : undefined;
143
+ if (flags.installed && installed === undefined) continue;
144
+
117
145
  const namespace = key.slice(0, key.indexOf("/"));
118
146
  const haystack = [
119
147
  key,
@@ -129,6 +157,10 @@ export default class RepoSearch extends BaseCommand {
129
157
  key,
130
158
  description: recipe.description ?? "",
131
159
  versions: Object.keys(recipe.versions).sort(),
160
+ ...(installed === undefined ? {} : { installed }),
161
+ ...(installed === undefined || links[repo] === undefined
162
+ ? {}
163
+ : { linkedPath: links[repo]!.path }),
132
164
  });
133
165
  }
134
166
  }
@@ -148,7 +180,9 @@ export default class RepoSearch extends BaseCommand {
148
180
  repos.length === 0
149
181
  ? "This project trusts no repositories yet, so there is nothing to search. " +
150
182
  "Add one with 'sous repo add <url>'."
151
- : `Nothing in the repositories this project trusts matches '${args.text}'.`
183
+ : flags.installed
184
+ ? `Nothing this project has installed matches '${args.text}'.`
185
+ : `Nothing in the repositories this project trusts matches '${args.text}'.`
152
186
  );
153
187
  } else {
154
188
  const shown = matches.slice(0, flags.limit);
@@ -156,11 +190,18 @@ export default class RepoSearch extends BaseCommand {
156
190
  key: match.key,
157
191
  repo: match.repo,
158
192
  versions: match.versions.join(", "),
193
+ installed: pinnedCell(match.installed, match.linkedPath),
159
194
  description:
160
195
  match.description.length > 0 ? match.description : "no description published",
161
196
  }));
162
197
 
163
- for (const line of renderTable(COLUMNS, rows, { indent: INDENT })) {
198
+ // Narrowed to what is installed, the installed version sits right after
199
+ // the recipe, ahead of every version the repository publishes.
200
+ const columns = flags.installed
201
+ ? [COLUMNS[0]!, INSTALLED_COLUMN, ...COLUMNS.slice(1)]
202
+ : COLUMNS;
203
+
204
+ for (const line of renderTable(columns, rows, { indent: INDENT })) {
164
205
  log(indent(line, INDENT));
165
206
  }
166
207
 
@@ -179,9 +220,21 @@ export default class RepoSearch extends BaseCommand {
179
220
  );
180
221
  }
181
222
 
223
+ if (notChecked.length > 0) {
224
+ summary.push(
225
+ `These repositories could not be reached, so they were searched as the cache ` +
226
+ `has them and were not checked: ${notChecked.join(", ")}.`
227
+ );
228
+ }
229
+
182
230
  if (summary.length > 0) {
183
231
  blankLine();
184
- for (const line of summary) log(indent(line));
232
+ for (const line of summary) paragraph(line);
233
+ }
234
+
235
+ if (matches.slice(0, flags.limit).some((match) => match.linkedPath !== undefined)) {
236
+ blankLine();
237
+ note(LINKED_NOTE);
185
238
  }
186
239
 
187
240
  footer();
@@ -1,25 +1,49 @@
1
- import { Command, Flags } from "@oclif/core";
2
- import { findRepoRoot, submitRepo } from "../../lib/repos/release/index.js";
1
+ import { Args, Command, Flags } from "@oclif/core";
2
+ import { discoverConfig, refreshDiscoveredConfig } from "../../lib/config-discovery.js";
3
+ import { loadEnvFiles } from "../../lib/env-local.js";
4
+ import { isInteractive } from "../../lib/interactive.js";
5
+ import { enabledRepos } from "../../lib/repos/defaults.js";
6
+ import {
7
+ findRepoRoot,
8
+ renderChangelog,
9
+ submitRepo,
10
+ type SubmitResult,
11
+ } from "../../lib/repos/release/index.js";
12
+ import {
13
+ findSubmitCheckout,
14
+ type SubmitProject,
15
+ } from "../../lib/repos/release/submit-checkout.js";
16
+ import { submitQuestions } from "../../lib/repos/release/submit-questions.js";
17
+ import type { ProposalStatus } from "../../lib/repos/providers/provider.js";
18
+ import { loadSettings } from "../../lib/settings.js";
3
19
  import { reportCommandError } from "../../utils/command-errors.js";
4
- import { nonInteractiveFlag } from "../../utils/flags.js";
20
+ import { confirmationFlag, nonInteractiveFlag } from "../../utils/flags.js";
5
21
  import {
22
+ BULLET,
6
23
  blankLine,
7
24
  dryRunNotice,
8
25
  footer,
9
26
  header,
10
27
  log,
28
+ note,
29
+ paragraph,
11
30
  section,
12
31
  showCommandVars,
13
32
  showVariables,
33
+ warning,
14
34
  } from "../../utils/formatting.js";
15
35
 
16
36
  /**
17
- * `sous repo submit` proposes the committed changes in a recipe repository to
18
- * that repository's maintainers.
37
+ * `sous repo submit` carries a proposed change to a recipe repository's
38
+ * maintainers through its whole life: it opens the proposal, updates it when
39
+ * there is more to send, reports where it stands, and starts the next one once
40
+ * it was merged.
19
41
  *
20
42
  * Like `sous repo init` and `sous repo release`, this command does NOT extend
21
- * BaseCommand: it runs inside a RECIPE repository, which is not a sous project
22
- * and has no `.sous/` directory of its own.
43
+ * BaseCommand: it runs inside a RECIPE repository, which is not a sous project.
44
+ * It can also be run from a project, naming a repository the project links, and
45
+ * then looks for the project's config itself, optionally: finding none is not a
46
+ * failure while the working directory is inside a recipe repository.
23
47
  *
24
48
  * Submitting never publishes and never writes to a repository directly. Sous
25
49
  * validates first, then hands the fork, branch and pull request mechanics to the
@@ -29,7 +53,7 @@ import {
29
53
  */
30
54
  export default class RepoSubmit extends Command {
31
55
  static description =
32
- "Propose this recipe repository's committed changes to its maintainers";
56
+ "Propose a recipe repository's changes to its maintainers, and follow the proposal through";
33
57
 
34
58
  /**
35
59
  * The other spelling of the topic. It lives under a hidden topic, so it is
@@ -38,25 +62,46 @@ export default class RepoSubmit extends Command {
38
62
  static aliases = ["repos:submit"];
39
63
 
40
64
  static examples = [
41
- "<%= config.bin %> repo submit",
42
- '<%= config.bin %> repo submit --title "Add a linting recipe"',
43
- "<%= config.bin %> repo submit --draft",
65
+ '<%= config.bin %> repo submit --title "Add a linting recipe" --body "Adds lint rules."',
66
+ "<%= config.bin %> repo submit sous-recipes",
67
+ "<%= config.bin %> repo submit --status",
68
+ "<%= config.bin %> repo submit --commit --yes --title \"Fix a typo\" --body \"Fixes it.\"",
44
69
  "<%= config.bin %> repo submit --dry-run",
45
70
  ];
46
71
 
72
+ static args = {
73
+ repo: Args.string({
74
+ description: "The linked repository to propose a change from, when run inside a project",
75
+ required: false,
76
+ }),
77
+ };
78
+
47
79
  static flags = {
48
80
  title: Flags.string({
49
- description: "Title for the proposal. Defaults to the last commit's subject.",
81
+ description: "The proposal's title; required for a new proposal, and replaces an open one's",
50
82
  }),
51
83
  body: Flags.string({
52
- description: "Body for the proposal. Defaults to a summary sous writes.",
84
+ description:
85
+ "The proposal's description; required for a new proposal, and replaces an open one's",
86
+ }),
87
+ branch: Flags.string({
88
+ description: "The branch to work with, instead of the one that is checked out",
89
+ }),
90
+ status: Flags.boolean({
91
+ description: "Only report where the branch's proposal stands",
92
+ default: false,
93
+ }),
94
+ commit: Flags.boolean({
95
+ description: "Commit uncommitted changes for you, after listing them and asking once",
96
+ default: false,
53
97
  }),
54
98
  draft: Flags.boolean({
55
- description: "Open the proposal as a draft",
99
+ description: "Open a new proposal as a draft",
56
100
  default: false,
57
101
  }),
102
+ yes: confirmationFlag(),
58
103
  "dry-run": Flags.boolean({
59
- description: "Check everything and print the plan without sending anything",
104
+ description: "Check everything and print the plan without writing or sending anything",
60
105
  default: false,
61
106
  }),
62
107
  // This command does not extend BaseCommand, so it declares the global
@@ -70,30 +115,121 @@ export default class RepoSubmit extends Command {
70
115
  }
71
116
 
72
117
  async run(): Promise<void> {
73
- const { flags } = await this.parse(RepoSubmit);
118
+ const { args, flags } = await this.parse(RepoSubmit);
74
119
  const dryRun = flags["dry-run"];
75
- const rootDir = findRepoRoot(process.cwd());
120
+ const interactive = isInteractive();
121
+ const cwd = process.cwd();
76
122
 
77
123
  showCommandVars({
78
- Repository: rootDir,
79
- Title: flags.title ?? "(the last commit's subject)",
80
- Draft: flags.draft,
81
- "Dry Run": dryRun,
124
+ "Working directory": cwd,
125
+ Repository: args.repo ?? "(the one the working directory is in)",
126
+ Branch: flags.branch ?? "(the one that is checked out)",
127
+ Mode: flags.status ? "Status only" : dryRun ? "Dry run" : "Propose",
128
+ });
129
+
130
+ const checkout = await findSubmitCheckout({
131
+ cwd,
132
+ ...(args.repo === undefined ? {} : { repo: args.repo }),
133
+ ...(await this.projectFor(cwd, args.repo)),
134
+ interactive,
135
+ });
136
+
137
+ section("The checkout");
138
+ showVariables({
139
+ Checkout: checkout.rootDir,
140
+ ...(checkout.repo === undefined ? {} : { Repository: checkout.repo }),
82
141
  });
142
+ blankLine();
143
+ note(checkout.reason);
144
+ for (const entry of checkout.notes) note(entry);
83
145
 
84
- section("Proposing a change");
146
+ section(flags.status ? "Looking the proposal up" : "Proposing a change");
85
147
 
86
148
  const result = await submitRepo({
87
- rootDir,
88
- title: flags.title,
89
- body: flags.body,
149
+ rootDir: checkout.rootDir,
150
+ ...(flags.title === undefined ? {} : { title: flags.title }),
151
+ ...(flags.body === undefined ? {} : { body: flags.body }),
152
+ ...(flags.branch === undefined ? {} : { branch: flags.branch }),
153
+ statusOnly: flags.status,
154
+ commit: flags.commit,
90
155
  draft: flags.draft,
91
156
  dryRun,
157
+ questions: submitQuestions({ interactive, yes: flags.yes }),
92
158
  onStep: (message) => log(` ${message}`),
93
- onNotice: (message) => (dryRun ? dryRunNotice(message) : log(` ${message}`)),
159
+ onNotice: (message) => (dryRun ? dryRunNotice(message) : note(message)),
160
+ onWarning: (message) => warning(message),
94
161
  });
95
162
 
96
- section(dryRun ? "What would be proposed" : "What was proposed");
163
+ this.report(result);
164
+ footer();
165
+ }
166
+
167
+ /**
168
+ * The project around the working directory, when the run needs one: always
169
+ * when a repository was named, and otherwise only when the working directory
170
+ * is not a recipe repository itself (the checkout finder decides that; a
171
+ * project found here is simply handed to it). A project whose config does not
172
+ * load is an error, because the run cannot say what the argument names.
173
+ *
174
+ * @param cwd - The working directory.
175
+ * @param repo - The repository the command line named, when it named one.
176
+ */
177
+ private async projectFor(
178
+ cwd: string,
179
+ repo: string | undefined
180
+ ): Promise<{ project?: SubmitProject }> {
181
+ const discovered = discoverConfig(cwd, undefined);
182
+ if (discovered === null) return {};
183
+ if (repo === undefined && insideRecipeRepo(cwd)) return {};
184
+
185
+ loadEnvFiles(discovered.sousDir);
186
+ const refreshed = refreshDiscoveredConfig(discovered);
187
+ const settings = await loadSettings(refreshed);
188
+ return { project: { sousDir: refreshed.sousDir, repos: enabledRepos(settings) } };
189
+ }
190
+
191
+ /**
192
+ * Prints what the run did, or would do, as a key and value list followed by
193
+ * one sentence, and the changelog when one was generated.
194
+ *
195
+ * @param result - What the submission reported.
196
+ */
197
+ private report(result: SubmitResult): void {
198
+ const noun = result.proposalNoun;
199
+
200
+ if (result.outcome === "cancelled") {
201
+ blankLine();
202
+ log(" Nothing was written and nothing was sent.");
203
+ return;
204
+ }
205
+
206
+ if (result.outcome === "status") {
207
+ section(`The ${noun} for '${result.branch}'`);
208
+ if (result.status === undefined) {
209
+ showVariables({ Repository: `${result.repo.owner}/${result.repo.name}`, Branch: result.branch });
210
+ blankLine();
211
+ paragraph(`The branch '${result.branch}' has no ${noun}.`);
212
+ return;
213
+ }
214
+ showVariables(statusFacts(result, result.status));
215
+ return;
216
+ }
217
+
218
+ if (result.changelog !== undefined) {
219
+ section("What merging this changes");
220
+ printChangelog(renderChangelog(result.changelog));
221
+ }
222
+
223
+ const heading =
224
+ result.outcome === "created"
225
+ ? result.dryRun
226
+ ? `The ${noun} this would open`
227
+ : `The ${noun} that was opened`
228
+ : result.dryRun
229
+ ? `The ${noun} this would update`
230
+ : `The ${noun} for '${result.branch}'`;
231
+ section(heading);
232
+
97
233
  showVariables({
98
234
  Provider: result.provider,
99
235
  Repository: `${result.repo.owner}/${result.repo.name}`,
@@ -101,20 +237,29 @@ export default class RepoSubmit extends Command {
101
237
  "Target branch": result.baseBranch,
102
238
  "Pushed to": result.dryRun ? "(nothing was pushed)" : result.pushedTo,
103
239
  "Through a fork": result.usedFork,
104
- Title: result.title,
105
- Proposal: result.url ?? "(the provider printed no address)",
240
+ ...(result.title === undefined ? {} : { Title: result.title }),
241
+ ...(result.committed === undefined ? {} : { Committed: result.committed.join(", ") }),
242
+ Address: result.url ?? (result.dryRun ? "(not opened yet)" : "(the provider printed no address)"),
106
243
  });
107
244
 
245
+ if (result.status !== undefined && !result.dryRun) {
246
+ blankLine();
247
+ showVariables(statusFacts(result, result.status));
248
+ }
249
+
108
250
  blankLine();
109
251
  if (result.dryRun) {
110
- log(" Nothing was sent. Run the command again without --dry-run to propose it.");
252
+ log(" Nothing was written and nothing was sent.");
253
+ } else if (result.outcome === "created") {
254
+ paragraph(
255
+ `The ${noun} is open for review. The maintainers decide what happens next; sous ` +
256
+ `never publishes on their behalf.`
257
+ );
258
+ } else if (result.outcome === "updated") {
259
+ paragraph(`The ${noun} was updated with what this run sent.`);
111
260
  } else {
112
- log(" The maintainers decide what happens next; sous never publishes on their");
113
- log(" behalf. Anything they ask for goes on the same branch, and the proposal");
114
- log(" updates itself when you push again.");
261
+ paragraph(`There was nothing new to send, so the ${noun} was left as it was.`);
115
262
  }
116
-
117
- footer();
118
263
  }
119
264
 
120
265
  /**
@@ -129,3 +274,68 @@ export default class RepoSubmit extends Command {
129
274
  return this.exit(exitCode);
130
275
  }
131
276
  }
277
+
278
+ /**
279
+ * Prints the Markdown changelog for a terminal: the heading is already the
280
+ * section's, emphasis and code marks are dropped, a list item becomes a real
281
+ * bullet, and every line is wrapped.
282
+ *
283
+ * @param markdown - The changelog as it goes into the proposal.
284
+ */
285
+ function printChangelog(markdown: string): void {
286
+ const lines = markdown.split("\n").slice(2);
287
+ for (const raw of lines) {
288
+ const line = raw.replace(/\*\*/g, "").replace(/`/g, "");
289
+ if (line.trim().length === 0) {
290
+ blankLine();
291
+ } else if (line.startsWith("- ")) {
292
+ paragraph(`${BULLET} ${line.slice(2)}`, { indent: 4, hangingIndent: 2 });
293
+ } else {
294
+ paragraph(line);
295
+ }
296
+ }
297
+ }
298
+
299
+ /** True when the directory is inside a recipe repository. */
300
+ function insideRecipeRepo(cwd: string): boolean {
301
+ try {
302
+ findRepoRoot(cwd);
303
+ return true;
304
+ } catch {
305
+ return false;
306
+ }
307
+ }
308
+
309
+ /**
310
+ * The facts about where a proposal stands, as a key and value list.
311
+ *
312
+ * @param result - The submission, for the repository and the noun.
313
+ * @param status - What the provider reported.
314
+ */
315
+ function statusFacts(result: SubmitResult, status: ProposalStatus): Record<string, unknown> {
316
+ const { proposal } = status;
317
+ const state =
318
+ proposal.state === "open"
319
+ ? proposal.draft
320
+ ? "open, as a draft"
321
+ : "open"
322
+ : proposal.state === "merged"
323
+ ? "merged"
324
+ : "closed without being merged";
325
+ return {
326
+ [`The ${result.proposalNoun}`]: proposal.title,
327
+ State: state,
328
+ ...(status.review === undefined ? {} : { Review: status.review }),
329
+ ...(status.checks === undefined
330
+ ? {}
331
+ : {
332
+ Checks:
333
+ `${status.checks.passed} passed, ${status.checks.failed} failed, ` +
334
+ `${status.checks.pending} still running`,
335
+ }),
336
+ ...(status.mergeable === undefined
337
+ ? {}
338
+ : { Mergeable: status.mergeable ? "yes" : "no, it conflicts with its target branch" }),
339
+ ...(proposal.url === undefined ? {} : { Address: proposal.url }),
340
+ };
341
+ }