|
31 | 31 | @Getter |
32 | 32 | @NoArgsConstructor |
33 | 33 | @Schema( |
34 | | - title = "Run a Soda scan." |
| 34 | + title = "Run Soda scan and report results", |
| 35 | + description = "Executes SodaCL checks with the provided configuration, writes scan results to internal storage, and emits metrics to Kestra. Uses the soda-core container by default, runs non-verbose unless `verbose` is true, and requires both configuration and checks to be supplied." |
35 | 36 | ) |
36 | | -@Plugin( |
37 | | - examples = { |
38 | | - @Example( |
39 | | - title = "Run a scan on BigQuery.", |
40 | | - full = true, |
| 37 | + @Plugin( |
| 38 | + examples = { |
| 39 | + @Example( |
| 40 | + title = "Run a scan on BigQuery.", |
| 41 | + full = true, |
41 | 42 | code = """ |
42 | 43 | id: soda_scan |
43 | 44 | namespace: company.team |
|
67 | 68 | requirements: |
68 | 69 | - soda-core-bigquery |
69 | 70 | """ |
70 | | - ) |
71 | | - } |
72 | | -) |
| 71 | + ), |
| 72 | + @Example( |
| 73 | + title = "Scan PostgreSQL with variables and verbose output", |
| 74 | + full = true, |
| 75 | + code = """ |
| 76 | + id: soda_scan_postgres |
| 77 | + namespace: company.team |
| 78 | +
|
| 79 | + tasks: |
| 80 | + - id: scan_pg |
| 81 | + type: io.kestra.plugin.soda.Scan |
| 82 | + configuration: |
| 83 | + data_source kestra: |
| 84 | + type: postgres |
| 85 | + connection: |
| 86 | + host: localhost |
| 87 | + port: 5432 |
| 88 | + database: app |
| 89 | + username: kestra |
| 90 | + password: {{ secret('PG_PASSWORD') }} |
| 91 | + checks: |
| 92 | + checks for users: |
| 93 | + - row_count > 0 |
| 94 | + - missing_count(email) = 0 |
| 95 | + variables: |
| 96 | + env: staging |
| 97 | + threshold: 1000 |
| 98 | + verbose: true |
| 99 | + requirements: |
| 100 | + - soda-core-postgres |
| 101 | + """ |
| 102 | + ) |
| 103 | + } |
| 104 | + ) |
73 | 105 | public class Scan extends AbstractSoda implements RunnableTask<Scan.Output> { |
74 | 106 | @Schema( |
75 | | - title = "The checks file" |
| 107 | + title = "SodaCL checks definition", |
| 108 | + description = "Required map rendered to `checks.yml` and executed against the `kestra` data source. Follow SodaCL syntax; failing checks mark the task accordingly." |
76 | 109 | ) |
77 | 110 | @PluginProperty(dynamic = true) |
78 | 111 | @NotNull |
79 | 112 | @NotEmpty |
80 | 113 | Map<String, Object> checks; |
81 | 114 |
|
82 | 115 | @Schema( |
83 | | - title = "The variables to pass" |
| 116 | + title = "Runtime variables", |
| 117 | + description = "Optional variables injected into the Soda scan for templating checks or configuration; values are rendered by Kestra before execution." |
84 | 118 | ) |
85 | 119 | Property<Map<String, Object>> variables; |
86 | 120 |
|
87 | 121 | @Schema( |
88 | | - title = "Whether to enable verbose logging" |
| 122 | + title = "Enable verbose logging", |
| 123 | + description = "Defaults to false; when true, the Soda scan runs with verbose output." |
89 | 124 | ) |
90 | 125 | @Builder.Default |
91 | 126 | Property<Boolean> verbose = Property.ofValue(false); |
@@ -181,28 +216,33 @@ protected ScanResult parseResult(RunContext runContext, ScriptOutput output) thr |
181 | 216 | @Getter |
182 | 217 | public static class Output implements io.kestra.core.models.tasks.Output { |
183 | 218 | @Schema( |
184 | | - title = "The scan result" |
| 219 | + title = "Scan results payload", |
| 220 | + description = "Parsed Soda scan outcome including warnings, failures, and emitted metrics." |
185 | 221 | ) |
186 | 222 | private final ScanResult result; |
187 | 223 |
|
188 | 224 | @Schema( |
189 | | - title = "The standard output line count" |
| 225 | + title = "Standard output line count", |
| 226 | + description = "Number of lines captured from stdout during the scan execution." |
190 | 227 | ) |
191 | 228 | private final int stdOutLineCount; |
192 | 229 |
|
193 | 230 | @Schema( |
194 | | - title = "The standard error line count" |
| 231 | + title = "Standard error line count", |
| 232 | + description = "Number of lines captured from stderr during the scan execution." |
195 | 233 | ) |
196 | 234 | private final int stdErrLineCount; |
197 | 235 |
|
198 | 236 | @Schema( |
199 | | - title = "The exit code of the whole execution" |
| 237 | + title = "Scan process exit code", |
| 238 | + description = "Exit code returned by the underlying Soda command (0 for success, non-zero on failure)." |
200 | 239 | ) |
201 | 240 | @NotNull |
202 | 241 | private final int exitCode; |
203 | 242 |
|
204 | 243 | @Schema( |
205 | | - title = "The used configuration" |
| 244 | + title = "Rendered configuration", |
| 245 | + description = "Configuration map applied to the Soda scan, as rendered by Kestra expressions." |
206 | 246 | ) |
207 | 247 | @NotNull |
208 | 248 | private Map<String, Object> configuration; |
|
0 commit comments