sf-flow-coverage 0.4.1 → 0.5.0

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 (60) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +92 -19
  3. package/lib/commands/flowcov/gate.d.ts +3 -0
  4. package/lib/commands/flowcov/gate.js +32 -4
  5. package/lib/commands/flowcov/gate.js.map +1 -1
  6. package/lib/commands/flowcov/readiness.d.ts +1 -0
  7. package/lib/commands/flowcov/readiness.js +16 -4
  8. package/lib/commands/flowcov/readiness.js.map +1 -1
  9. package/lib/commands/flowcov/scaffold.js +5 -1
  10. package/lib/commands/flowcov/scaffold.js.map +1 -1
  11. package/lib/core/apexTemplate.d.ts +9 -1
  12. package/lib/core/apexTemplate.js +188 -19
  13. package/lib/core/apexTemplate.js.map +1 -1
  14. package/lib/core/conditions.d.ts +25 -2
  15. package/lib/core/conditions.js +161 -13
  16. package/lib/core/conditions.js.map +1 -1
  17. package/lib/core/criteria.d.ts +14 -0
  18. package/lib/core/criteria.js +109 -27
  19. package/lib/core/criteria.js.map +1 -1
  20. package/lib/core/exclusions.d.ts +26 -0
  21. package/lib/core/exclusions.js +70 -0
  22. package/lib/core/exclusions.js.map +1 -0
  23. package/lib/core/flowFingerprint.d.ts +6 -0
  24. package/lib/core/flowFingerprint.js +94 -0
  25. package/lib/core/flowFingerprint.js.map +1 -1
  26. package/lib/core/flowGraph.d.ts +13 -0
  27. package/lib/core/flowGraph.js +28 -8
  28. package/lib/core/flowGraph.js.map +1 -1
  29. package/lib/core/flowSettings.d.ts +2 -1
  30. package/lib/core/flowSettings.js.map +1 -1
  31. package/lib/core/flowXml.js +18 -1
  32. package/lib/core/flowXml.js.map +1 -1
  33. package/lib/core/gate.d.ts +3 -0
  34. package/lib/core/gate.js +12 -0
  35. package/lib/core/gate.js.map +1 -1
  36. package/lib/core/lookupFilters.d.ts +33 -0
  37. package/lib/core/lookupFilters.js +139 -0
  38. package/lib/core/lookupFilters.js.map +1 -0
  39. package/lib/core/markdown.d.ts +14 -0
  40. package/lib/core/markdown.js +119 -0
  41. package/lib/core/markdown.js.map +1 -0
  42. package/lib/core/requiredFields.d.ts +19 -0
  43. package/lib/core/requiredFields.js +40 -0
  44. package/lib/core/requiredFields.js.map +1 -1
  45. package/lib/core/scaffold.d.ts +6 -0
  46. package/lib/core/scaffold.js +72 -3
  47. package/lib/core/scaffold.js.map +1 -1
  48. package/lib/core/toolingQuery.js.map +1 -1
  49. package/lib/core/types.d.ts +2 -0
  50. package/lib/core/validationRules.d.ts +14 -0
  51. package/lib/core/validationRules.js +30 -0
  52. package/lib/core/validationRules.js.map +1 -0
  53. package/lib/index.d.ts +4 -0
  54. package/lib/index.js +2 -0
  55. package/lib/index.js.map +1 -1
  56. package/messages/flowcov.gate.md +28 -1
  57. package/messages/flowcov.readiness.md +12 -0
  58. package/messages/flowcov.scaffold.md +1 -1
  59. package/oclif.manifest.json +40 -4
  60. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0](https://github.com/mcarvin8/sf-flow-coverage/compare/v0.4.2...v0.5.0) (2026-11-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * add markdown output and gate exclusions ([#31](https://github.com/mcarvin8/sf-flow-coverage/issues/31)) ([25d4abf](https://github.com/mcarvin8/sf-flow-coverage/commit/25d4abfe31b7be1aa0d2ffc4d6f3efcf0da99c2b))
9
+ * **gate:** compare element content with the org version ([#32](https://github.com/mcarvin8/sf-flow-coverage/issues/32)) ([f0c8231](https://github.com/mcarvin8/sf-flow-coverage/commit/f0c823179b626ebe5aaa7616ac9aec42be09fbf8))
10
+ * **scaffold:** meet field functions, CASE, and deeper related fields ([#33](https://github.com/mcarvin8/sf-flow-coverage/issues/33)) ([9e0347c](https://github.com/mcarvin8/sf-flow-coverage/commit/9e0347cdc25bf168b457c02f7b8641f5e3fca4ee))
11
+ * **scaffold:** meet lookup filters on standard lookups ([#29](https://github.com/mcarvin8/sf-flow-coverage/issues/29)) ([7a8e265](https://github.com/mcarvin8/sf-flow-coverage/commit/7a8e26512f0bd398c6e41391cd867e23371c6d0e))
12
+ * **scaffold:** meet required lookup filters ([#28](https://github.com/mcarvin8/sf-flow-coverage/issues/28)) ([afd9185](https://github.com/mcarvin8/sf-flow-coverage/commit/afd918552d648bb12b8728e7cb75944b0ef3fe1a))
13
+ * **scaffold:** meet the org's validation rules ([#26](https://github.com/mcarvin8/sf-flow-coverage/issues/26)) ([d4e4fa4](https://github.com/mcarvin8/sf-flow-coverage/commit/d4e4fa43f99f7f68325d76c693be41a06b9479bd))
14
+
15
+ ## [0.4.2](https://github.com/mcarvin8/sf-flow-coverage/compare/v0.4.1...v0.4.2) (2026-11-20)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **scaffold:** generate tests that pass in more real orgs ([#23](https://github.com/mcarvin8/sf-flow-coverage/issues/23)) ([04b114f](https://github.com/mcarvin8/sf-flow-coverage/commit/04b114f6930174166a22bb1118f36b0fd7411fbd))
21
+
3
22
  ## [0.4.1](https://github.com/mcarvin8/sf-flow-coverage/compare/v0.4.0...v0.4.1) (2026-11-20)
4
23
 
5
24
 
package/README.md CHANGED
@@ -75,7 +75,7 @@ sf flowcov transform --target-org ci-sandbox --format sonar
75
75
 
76
76
  It also reads whether **Deploy processes and flows as active** is already on and says what to do: turn it on once production is ready, or keep coverage up so deployments of active Flows keep working. The setting only affects production, so in a sandbox or scratch org the report points you to production instead.
77
77
 
78
- Pass `--fail-if-not-ready` to exit with code 1 below the threshold.
78
+ Pass `--fail-if-not-ready` to exit with code 1 below the threshold. For CI, see [Markdown output](#markdown-output).
79
79
 
80
80
  ## Pull request gate
81
81
 
@@ -87,7 +87,30 @@ Coverage is read from the target org, so in CI:
87
87
  2. Run Apex tests there with `sf apex run test --code-coverage`.
88
88
  3. Run the gate against that org.
89
89
 
90
- The gate checks the Flow's active version in the org (or its latest version if none is active), and prints that version in the result. It fails a Flow when the org has no active version of it, or a newer inactive one: both usually mean the branch was deployed inactive. With `--from`, it also compares each changed Flow with the org's version and warns (or, with `--content-check fail`, fails) when the branch wasn't deployed. A Flow that fails `--min-element-coverage` names the elements no test runs.
90
+ The gate checks the Flow's active version in the org (or its latest version if none is active), and prints that version in the result. It fails a Flow when the org has no active version of it, or a newer inactive one: both usually mean the branch was deployed inactive. With `--from`, it also compares each changed Flow with the org's version, down to the content of each element, and warns (or, with `--content-check fail`, fails) when the branch wasn't deployed. The warning names the elements that differ, such as `changed: decisions:Is_Big`. A Flow that fails `--min-element-coverage` names the elements no test runs.
91
+
92
+ ### Excluding Flows
93
+
94
+ To leave out Flows your team has chosen not to test yet, such as legacy Flows, add a `.flowcovignore` file to the project directory, or pass `--exclude`. Each line holds one pattern, with an optional `# reason` after it:
95
+
96
+ ```text
97
+ # Deferred until the Q3 rewrite
98
+ Legacy_*
99
+ Close_Old_Cases # replaced by Case_Closure next release
100
+ force-app/main/legacy/
101
+ ```
102
+
103
+ A pattern without `/` matches Flow API names, ignoring case. A pattern with `/` matches file paths from the repository root, and a path ending in `/` matches everything under it. In patterns, `*` matches any characters except `/`, `**` matches any characters, and `?` matches one character. The gate skips an excluded Flow and gives the matching pattern as the reason. Exclusions only affect the gate: Salesforce still counts every active Flow toward the org-wide total.
104
+
105
+ ## Markdown output
106
+
107
+ `readiness` and `gate` take `--output-format markdown`. With it, the report goes to standard output as one Markdown document, with its warnings included, so CI can post it as a pull request comment or add it to a GitHub Actions job summary:
108
+
109
+ ```bash
110
+ sf flowcov gate --target-org ci-sandbox --from origin/main --output-format markdown >> "$GITHUB_STEP_SUMMARY"
111
+ ```
112
+
113
+ The exit code is the same as with the default output, and `--json` takes precedence over both.
91
114
 
92
115
  ## Test scaffolding
93
116
 
@@ -101,9 +124,9 @@ The gate checks the Flow's active version in the org (or its latest version if n
101
124
  | Schedule-triggered | Starts the Flow directly, since Apex tests can't fire the schedule. |
102
125
  | Process Builder | A placeholder test to fill in. |
103
126
 
104
- Entry criteria are read as one condition, whether they are filters (with AND, OR, or custom logic such as `1 OR (2 AND 3)`) or a formula. The command meets one branch of an `OR` or `IF`, and handles every filter operator, comparisons with literals, other fields, `$User.Id`, and `TODAY()`/`NOW()`/`DATE()`, `$Record__Prior` and `PRIORVALUE` in update tests, and fields on related records such as `{!$Record.Account__r.Type}`, which it sets on the parent record it inserts.
127
+ Entry criteria are read as one condition, whether they are filters (with AND, OR, or custom logic such as `1 OR (2 AND 3)`) or a formula. The command meets one branch of an `OR`, `IF`, or `CASE`, and handles every filter operator, comparisons with literals, other fields, `$User.Id`, and `TODAY()`/`NOW()`/`DATE()`, `$Record__Prior` and `PRIORVALUE` in update tests, and `TEXT`, `LEN`, `UPPER`, `LOWER`, `TRIM`, and `VALUE` of a field (`LEN({!$Record.Name}) > 3` gets a name four characters long). Fields on related records, such as `{!$Record.Account__r.Type}` or `{!$Record.Contact__r.Account.Type}` up to three relationships away, are set on the parent records it inserts, each one looking up the next.
105
128
 
106
- With a target org (`--target-org` or your default org), the command describes each object the test creates and fills in its required fields: text, numbers, dates, and the default picklist value. It meets "is not null" criteria by giving those fields a value, and fills required lookups with a parent record it inserts, up to three levels of parents deep (or the running user, the standard price book, the default business hours, or one of the object's record types). Without an org, only common standard objects (Account, Contact, Opportunity, and so on) get required fields.
129
+ With a target org (`--target-org` or your default org), the command describes each object the test creates and fills in its required fields: text, numbers, dates, and the default picklist value. It meets "is not null" criteria by giving those fields a value, and fills required lookups with a parent record it inserts, up to three levels of parents deep (or the running user, the standard price book, the default business hours, or one of the object's record types). It also reads each object's active validation rules and gives every record the test saves the field values that keep a rule from blocking it, such as the status a rule exempts. A rule it can't avoid gets a TODO that names it. Required lookup filters, on standard and custom lookup fields, work the same way: the parent records the test inserts get the field values the filter needs. Without an org, only common standard objects (Account, Contact, Opportunity, and so on) get required fields.
107
130
 
108
131
  For record-triggered Flows, the command follows the Flow's elements for the record the test creates, deciding each decision the record settles. That includes formula resources, checkbox defaults, picklist defaults on objects without record types, and lookups on data the test doesn't create, which find nothing in an Apex test. It asserts the fields the Flow is certain to set and the records it is certain to create. When the Flow is certain to block the save with a custom error, the test expects that error, and a second test sets the fields that avoid it. What the Flow does only on a decision outcome it can't predict gets commented-out assertions.
109
132
 
@@ -138,7 +161,8 @@ Require Apex test coverage for every Flow a pull request changes.
138
161
  ```
139
162
  USAGE
140
163
  $ sf flowcov gate -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [--from <value> | --flow
141
- <value>...] [--to <value>] [-d <value>] [--min-element-coverage <value>] [--content-check warn|fail|off]
164
+ <value>...] [--to <value>] [-d <value>] [--min-element-coverage <value>] [--content-check warn|fail|off] [--exclude
165
+ <value>...] [--output-format human|markdown]
142
166
 
143
167
  FLAGS
144
168
  -d, --project-dir=<value> [default: .] Git repository to read changed Flows from.
@@ -148,10 +172,13 @@ FLAGS
148
172
  --content-check=<option> [default: warn] What to do when a changed Flow's content differs from the org's
149
173
  version.
150
174
  <options: warn|fail|off>
175
+ --exclude=<value>... Flow API name or file path pattern for a Flow the gate skips.
151
176
  --flow=<value>... Flow API name to check. Use instead of --from to skip git.
152
177
  --from=<value> Git ref the pull request merges into (the gate compares from the merge base of
153
178
  this ref).
154
179
  --min-element-coverage=<value> Minimum percentage of each Flow's elements that tests must run.
180
+ --output-format=<option> [default: human] Format of the report printed to standard output.
181
+ <options: human|markdown>
155
182
  --to=<value> [default: HEAD] Git ref with the changes.
156
183
 
157
184
  GLOBAL FLAGS
@@ -174,10 +201,16 @@ DESCRIPTION
174
201
  latest version. Both usually mean the branch was deployed inactive, so the org's coverage doesn't belong to the
175
202
  version in the pull request.
176
203
 
177
- With --from, the gate also compares each changed Flow at --to with the org's version: process type, start trigger and
178
- entry criteria, and the names of its elements and resources. A difference usually means the branch wasn't deployed to
179
- the org. By default this is a warning; use --content-check to fail instead, or to skip the comparison. The comparison
180
- doesn't look inside elements, so it can miss a change that only edits an existing element.
204
+ With --from, the gate also compares each changed Flow at --to with the org's version: its process type, start element
205
+ and entry criteria, Flow properties such as the API version and label, and each element and resource: which ones exist
206
+ and what each one contains, such as a decision's conditions or an assignment's values. Canvas positions and Flow
207
+ Builder's own settings are ignored. A difference usually means the branch wasn't deployed to the org. By default this
208
+ is a warning; use --content-check to fail instead, or to skip the comparison.
209
+
210
+ To leave out Flows a team has chosen not to test yet, such as legacy Flows, list them in a `.flowcovignore` file in
211
+ --project-dir or pass --exclude. Excluded Flows are skipped, with the pattern that matched them as the reason.
212
+ Exclusions only affect the gate: Salesforce still counts every active Flow toward the org-wide total that `sf flowcov
213
+ readiness` reports.
181
214
 
182
215
  For a Flow that tests run only in part, the --json output lists the elements no test runs, and a Flow that fails
183
216
  --min-element-coverage names them in its reason.
@@ -197,6 +230,11 @@ EXAMPLES
197
230
 
198
231
  $ sf flowcov gate --target-org ci-sandbox --from origin/main --content-check fail
199
232
 
233
+ Skip legacy Flows, and add the results to a GitHub Actions job summary:
234
+
235
+ $ sf flowcov gate --target-org ci-sandbox --from origin/main --exclude "Legacy_*" --output-format markdown >> \
236
+ "$GITHUB_STEP_SUMMARY"
237
+
200
238
  Check named Flows without git:
201
239
 
202
240
  $ sf flowcov gate --target-org ci-sandbox --flow Account_After_Save --flow Close_Cases
@@ -206,6 +244,24 @@ FLAG DESCRIPTIONS
206
244
 
207
245
  "warn" prints a warning, "fail" fails a Flow that would otherwise pass, and "off" skips the comparison (and its one
208
246
  Tooling API query per Flow). Only applies with --from.
247
+
248
+ --exclude=<value>... Flow API name or file path pattern for a Flow the gate skips.
249
+
250
+ A pattern without "/" matches Flow API names, ignoring case; a pattern with "/" matches file paths from the
251
+ repository root. "*" matches any characters except "/", "**" matches any characters, and "?" matches one character.
252
+ A path ending in "/" matches everything under it. Patterns add to those in .flowcovignore, which lists one pattern
253
+ per line with an optional "# reason" after it:
254
+
255
+ # Deferred until the Q3 rewrite
256
+ Legacy_*
257
+ Close_Old_Cases # replaced by Case_Closure next release
258
+ force-app/main/legacy/
259
+
260
+ --output-format=human|markdown Format of the report printed to standard output.
261
+
262
+ "human" prints tables and warnings to the terminal. "markdown" prints the results as one Markdown document, warnings
263
+ included, for a pull request comment or a GitHub Actions job summary. Redirect it to a file, for example `>>
264
+ "$GITHUB_STEP_SUMMARY"`. --json takes precedence over both.
209
265
  ```
210
266
 
211
267
  _See code: [src/commands/flowcov/gate.ts](https://github.com/mcarvin8/sf-flow-coverage/blob/main/src/commands/flowcov/gate.ts)_
@@ -217,17 +273,19 @@ Report how close the org is to the coverage needed to deploy Flows as active.
217
273
  ```
218
274
  USAGE
219
275
  $ sf flowcov readiness -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-d <value>] [--since
220
- <value>] [--threshold <value>] [--fail-if-not-ready]
276
+ <value>] [--threshold <value>] [--fail-if-not-ready] [--output-format human|markdown]
221
277
 
222
278
  FLAGS
223
- -d, --project-dir=<value> [default: .] Git repository used to rank uncovered Flows by how often they change.
224
- -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
225
- configuration variable is already set.
226
- --api-version=<value> Override the api version used for api requests made by this command
227
- --fail-if-not-ready Exit with code 1 when the org is below the threshold.
228
- --since=<value> Only count commits after this date: a date (2026-01-31) or "<n> days|weeks|months|years
229
- ago".
230
- --threshold=<value> [default: 75] Coverage percentage the org must reach.
279
+ -d, --project-dir=<value> [default: .] Git repository used to rank uncovered Flows by how often they change.
280
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
281
+ configuration variable is already set.
282
+ --api-version=<value> Override the api version used for api requests made by this command
283
+ --fail-if-not-ready Exit with code 1 when the org is below the threshold.
284
+ --output-format=<option> [default: human] Format of the report printed to standard output.
285
+ <options: human|markdown>
286
+ --since=<value> Only count commits after this date: a date (2026-01-31) or "<n> days|weeks|months|years
287
+ ago".
288
+ --threshold=<value> [default: 75] Coverage percentage the org must reach.
231
289
 
232
290
  GLOBAL FLAGS
233
291
  --flags-dir=<value> Import flag values from a directory.
@@ -264,6 +322,17 @@ EXAMPLES
264
322
  Fail a CI job unless the org is at or above 75%:
265
323
 
266
324
  $ sf flowcov readiness --target-org prod --fail-if-not-ready
325
+
326
+ Add the report to a GitHub Actions job summary:
327
+
328
+ $ sf flowcov readiness --target-org prod --output-format markdown >> "$GITHUB_STEP_SUMMARY"
329
+
330
+ FLAG DESCRIPTIONS
331
+ --output-format=human|markdown Format of the report printed to standard output.
332
+
333
+ "human" prints tables and warnings to the terminal. "markdown" prints the report as one Markdown document, warnings
334
+ included, for a pull request comment or a GitHub Actions job summary. Redirect it to a file, for example `>>
335
+ "$GITHUB_STEP_SUMMARY"`. --json takes precedence over both.
267
336
  ```
268
337
 
269
338
  _See code: [src/commands/flowcov/readiness.ts](https://github.com/mcarvin8/sf-flow-coverage/blob/main/src/commands/flowcov/readiness.ts)_
@@ -300,7 +369,11 @@ DESCRIPTION
300
369
  record-triggered Flows get a record built from the trigger object and entry criteria, autolaunched Flows are started
301
370
  with Flow.Interview and their input variables, and platform event Flows publish the event. When a target org is
302
371
  available (--target-org or a default org), the command describes each object the test creates and fills in its
303
- required fields, the fields the entry criteria need, and parent records (and their parents) for required lookups.
372
+ required fields, the fields the entry criteria need, and parent records (and their parents) for required lookups. It
373
+ also reads each object's active validation rules: a record the test saves (the triggering record on insert and on
374
+ update, parents, and input records) gets the field values that keep a rule from blocking it, and a rule it can't avoid
375
+ gets a TODO that names it. Required lookup filters (on standard and custom lookups) are met the same way: a parent
376
+ record the test inserts gets the field values the filter needs.
304
377
 
305
378
  Entry criteria are read as one condition, whether they are filters (with AND, OR, or custom logic) or a formula. The
306
379
  command meets one branch of an OR, and handles comparisons with literals, other fields, `$User.Id`, and `TODAY()`;
@@ -13,6 +13,9 @@ export default class FlowcovGate extends SfCommand<GateResult> {
13
13
  'project-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
14
  'min-element-coverage': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
15
15
  'content-check': import("@oclif/core/interfaces").OptionFlag<"fail" | "off" | "warn", import("@oclif/core/interfaces").CustomOptions>;
16
+ exclude: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'output-format': import("@oclif/core/interfaces").OptionFlag<"human" | "markdown", import("@oclif/core/interfaces").CustomOptions>;
16
18
  };
17
19
  run(): Promise<GateResult>;
20
+ private logResult;
18
21
  }
@@ -1,6 +1,8 @@
1
1
  import { Messages, SfError } from '@salesforce/core';
2
2
  import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
3
+ import { readIgnoreFile } from '../../core/exclusions.js';
3
4
  import { collectChangedFlows, evaluateGate } from '../../core/gate.js';
5
+ import { gateMarkdown, OUTPUT_FORMATS } from '../../core/markdown.js';
4
6
  import { OrgCoverageSource } from '../../core/orgCoverageSource.js';
5
7
  import { toolingQuery } from '../../core/toolingQuery.js';
6
8
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
@@ -43,6 +45,17 @@ export default class FlowcovGate extends SfCommand {
43
45
  options: ['warn', 'fail', 'off'],
44
46
  default: 'warn',
45
47
  })(),
48
+ exclude: Flags.string({
49
+ summary: messages.getMessage('flags.exclude.summary'),
50
+ description: messages.getMessage('flags.exclude.description'),
51
+ multiple: true,
52
+ }),
53
+ 'output-format': Flags.option({
54
+ summary: messages.getMessage('flags.output-format.summary'),
55
+ description: messages.getMessage('flags.output-format.description'),
56
+ options: OUTPUT_FORMATS,
57
+ default: 'human',
58
+ })(),
46
59
  };
47
60
  async run() {
48
61
  const { flags } = await this.parse(FlowcovGate);
@@ -56,17 +69,34 @@ export default class FlowcovGate extends SfCommand {
56
69
  else {
57
70
  throw new SfError(messages.getMessage('error.noInput'));
58
71
  }
72
+ const markdown = flags['output-format'] === 'markdown';
59
73
  if (candidates.length === 0) {
60
- this.log('No Flows changed. Nothing to check.');
61
- return { passed: true, minElementCoverage: flags['min-element-coverage'], flows: [], warnings: [] };
74
+ const empty = { passed: true, minElementCoverage: flags['min-element-coverage'], flows: [], warnings: [] };
75
+ this.log(markdown ? gateMarkdown(empty) : 'No Flows changed. Nothing to check.');
76
+ return empty;
62
77
  }
78
+ const exclusions = [
79
+ ...(await readIgnoreFile(flags['project-dir'])),
80
+ ...(flags.exclude ?? []).map((pattern) => ({ pattern, source: '--exclude' })),
81
+ ];
63
82
  const connection = flags['target-org'].getConnection(flags['api-version']);
64
83
  const result = await evaluateGate({
65
84
  source: new OrgCoverageSource(toolingQuery(connection)),
66
85
  candidates,
67
86
  minElementCoverage: flags['min-element-coverage'],
68
87
  contentCheck: flags['content-check'],
88
+ exclusions,
69
89
  });
90
+ if (!result.passed)
91
+ process.exitCode = 1;
92
+ if (markdown) {
93
+ this.log(gateMarkdown(result));
94
+ return result;
95
+ }
96
+ this.logResult(result);
97
+ return result;
98
+ }
99
+ logResult(result) {
70
100
  this.table({
71
101
  data: result.flows.map((f) => ({
72
102
  Flow: f.flowName,
@@ -87,9 +117,7 @@ export default class FlowcovGate extends SfCommand {
87
117
  else {
88
118
  const failed = result.flows.filter((f) => f.status === 'fail').length;
89
119
  this.warn(`Flow coverage gate failed for ${failed} Flow(s). See the Reason column.`);
90
- process.exitCode = 1;
91
120
  }
92
- return result;
93
121
  }
94
122
  }
95
123
  //# sourceMappingURL=gate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gate.js","sourceRoot":"","sources":["../../../src/commands/flowcov/gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAsB,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,QAAQ,CAAC,kCAAkC,CAAC,OAAO,IAAI,CA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AAC,QAAQ;gBAChB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE;gBAC9B,kBAAkB,EAAE,CAAC,CAAC,sBAAsB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,sBAAsB,GAAG;gBAChG,MAAM,EAAE,CAAC,CAAC,MAAM;aACjB,CAAC,CAAC;SACJ,CAAC,CAAC;QAEH,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAChC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE;gBAAE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC,CAAC;QACvF,CAAC;QACD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE1D,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,IAAI,CAAC,UAAU,CAAC,iCAAiC,MAAM,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,CAAC;QACnF,CAAC;aAAM,CAAC;YACN,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;YACtE,IAAI,CAAC,IAAI,CAAC,iCAAiC,MAAM,kCAAkC,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;CACF"}
@@ -11,6 +11,7 @@ export default class FlowcovReadiness extends SfCommand<ReadinessResult> {
11
11
  since: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
12
  threshold: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
13
13
  'fail-if-not-ready': import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ 'output-format': import("@oclif/core/interfaces").OptionFlag<"human" | "markdown", import("@oclif/core/interfaces").CustomOptions>;
14
15
  };
15
16
  run(): Promise<ReadinessResult>;
16
17
  private logReport;
@@ -4,6 +4,7 @@ import { describeElements } from '../../core/elementCoverage.js';
4
4
  import { deployAsActiveAdvice } from '../../core/flowSettings.js';
5
5
  import { DEFAULT_THRESHOLD, isProcessBuilder, PROCESS_BUILDER_ADVICE, processTypeLabel } from '../../core/flowTypes.js';
6
6
  import { getFlowChurn } from '../../core/git.js';
7
+ import { OUTPUT_FORMATS, readinessMarkdown } from '../../core/markdown.js';
7
8
  import { OrgCoverageSource } from '../../core/orgCoverageSource.js';
8
9
  import { buildReadinessReport } from '../../core/readiness.js';
9
10
  import { dataQuery, metadataRead, toolingQuery } from '../../core/toolingQuery.js';
@@ -35,6 +36,12 @@ export default class FlowcovReadiness extends SfCommand {
35
36
  summary: messages.getMessage('flags.fail-if-not-ready.summary'),
36
37
  default: false,
37
38
  }),
39
+ 'output-format': Flags.option({
40
+ summary: messages.getMessage('flags.output-format.summary'),
41
+ description: messages.getMessage('flags.output-format.description'),
42
+ options: OUTPUT_FORMATS,
43
+ default: 'human',
44
+ })(),
38
45
  };
39
46
  async run() {
40
47
  const { flags } = await this.parse(FlowcovReadiness);
@@ -49,9 +56,14 @@ export default class FlowcovReadiness extends SfCommand {
49
56
  threshold: flags.threshold,
50
57
  });
51
58
  this.spinner.stop();
52
- for (const warning of result.warnings)
53
- this.warn(warning);
54
- this.logReport(result);
59
+ if (flags['output-format'] === 'markdown') {
60
+ this.log(readinessMarkdown(result));
61
+ }
62
+ else {
63
+ for (const warning of result.warnings)
64
+ this.warn(warning);
65
+ this.logReport(result);
66
+ }
55
67
  if (flags['fail-if-not-ready'] && !result.ready)
56
68
  process.exitCode = 1;
57
69
  return result;
@@ -82,7 +94,7 @@ export default class FlowcovReadiness extends SfCommand {
82
94
  Flow: f.flowName,
83
95
  Type: processTypeLabel(f.processType),
84
96
  Version: f.versionNumber ?? '',
85
- ...(showChanges ? { Changes: f.changes ?? 0 } : {}),
97
+ ...(showChanges ? { Changes: f.changes } : {}),
86
98
  })),
87
99
  });
88
100
  }
@@ -1 +1 @@
1
- {"version":3,"file":"readiness.js","sourceRoot":"","sources":["../../../src/commands/flowcov/readiness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACxH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAGnF,QAAQ,CAAC,kCAAkC,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,SAA0B;IAC/D,MAAM,CAAmB,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAClE,MAAM,CAAmB,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAC1E,MAAM,CAAmB,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAErE,MAAM,CAAmB,KAAK,GAAG;QACtC,YAAY,EAAE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f-plugins-core';
3
+ import { lookupFilterReader } from '../../core/lookupFilters.js';
3
4
  import { OrgCoverageSource } from '../../core/orgCoverageSource.js';
4
5
  import { scaffoldTests } from '../../core/scaffold.js';
5
- import { describeObject, toolingQuery } from '../../core/toolingQuery.js';
6
+ import { describeObject, metadataRead, toolingQuery } from '../../core/toolingQuery.js';
7
+ import { validationRuleReader } from '../../core/validationRules.js';
6
8
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
7
9
  const messages = Messages.loadMessages('sf-flow-coverage', 'flowcov.scaffold');
8
10
  export default class FlowcovScaffold extends SfCommand {
@@ -62,6 +64,8 @@ export default class FlowcovScaffold extends SfCommand {
62
64
  force: flags.force,
63
65
  dryRun: flags['dry-run'],
64
66
  describe: connection ? describeObject(connection) : undefined,
67
+ validationRules: connection ? validationRuleReader(toolingQuery(connection)) : undefined,
68
+ lookupFilters: connection ? lookupFilterReader(metadataRead(connection)) : undefined,
65
69
  });
66
70
  const verb = flags['dry-run'] ? 'Would create' : 'Created';
67
71
  for (const test of result.created)
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/commands/flowcov/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1E,QAAQ,CAAC,kCAAkC,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;AAE/E,MAAM,CAAC,OAAO,OAAO,eAAgB,S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AM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC5G,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,5 +1,7 @@
1
- import { type RequiredFieldMap } from './requiredFields.js';
1
+ import { type LookupFilter } from './lookupFilters.js';
2
+ import { type PicklistInfo, type RequiredFieldMap } from './requiredFields.js';
2
3
  import type { FlowMetadata } from './types.js';
4
+ import type { ValidationRule } from './validationRules.js';
3
5
  export type GeneratedApexTest = {
4
6
  className: string;
5
7
  body: string;
@@ -33,6 +35,12 @@ export type GenerateOptions = {
33
35
  readOnlyFields?: Record<string, string[]>;
34
36
  /** Fields a test can set on insert but not change in an update, per object. Update tests set them in the insert. */
35
37
  createOnlyFields?: Record<string, string[]>;
38
+ /** Active picklist values per field, per object. Criteria values are spelled to match, and restricted picklists only get their own values. */
39
+ picklists?: Record<string, Record<string, PicklistInfo>>;
40
+ /** Active validation rules per object. Generated records meet them where the generator can. */
41
+ validationRules?: Record<string, ValidationRule[]>;
42
+ /** Required lookup filters per object. Parents the test inserts meet them where the generator can. */
43
+ lookupFilters?: Record<string, LookupFilter[]>;
36
44
  };
37
45
  /** Generates a starter Apex test class for a Flow from its metadata. */
38
46
  export declare function generateApexTest(flow: FlowMetadata, options?: GenerateOptions): GeneratedApexTest;