Prow job configs: the files whose top-level keys (YAML Variables) include * presubmits / postsubmits / periodics. */
| 3895 | /* Prow job configs: the files whose top-level keys (YAML Variables) include |
| 3896 | * presubmits / postsubmits / periodics. */ |
| 3897 | static CBMHashTable *sh_prow_files(cbm_pipeline_ctx_t *ctx) { |
| 3898 | static const char *const keys[] = {"presubmits", "postsubmits", "periodics", NULL}; |
| 3899 | CBMHashTable *out = NULL; |
| 3900 | for (int k = 0; keys[k]; k++) { |
| 3901 | const cbm_gbuf_node_t **nodes = NULL; |
| 3902 | int n = 0; |
| 3903 | if (cbm_gbuf_find_by_name(ctx->gbuf, keys[k], &nodes, &n) != 0) { |
| 3904 | continue; |
| 3905 | } |
| 3906 | for (int i = 0; i < n; i++) { |
| 3907 | const char *fp = nodes[i]->file_path; |
| 3908 | if (!fp || !sh_eq(nodes[i]->label, "Variable")) { |
| 3909 | continue; |
| 3910 | } |
| 3911 | out = out ? out : cbm_ht_create(0); |
| 3912 | if (out) { |
| 3913 | cbm_ht_set(out, fp, (void *)fp); |
| 3914 | } |
| 3915 | } |
| 3916 | } |
| 3917 | return out; |
| 3918 | } |
| 3919 | |
| 3920 | /* One script, Makefile or CI configuration `rel` (on disk at `path`). */ |
| 3921 | static void sh_pass_file(sh_pass_t *p, cbm_pipeline_ctx_t *ctx, CBMHashTable *prow, const char *rel, |
no test coverage detected