gh-workflow-parser 0.5.4

Parse GitHub workflows and do stuff like create issues
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
use super::{WorkflowKind, LEVENSHTEIN_THRESHOLD};
use crate::{
    err_msg_parse,
    errlog::ErrorLog,
    gh,
    issue::{FailedJob, Issue},
    util,
};
use std::error::Error;

pub fn create_issue_from_run(
    github_cli: Box<dyn gh::GitHub>,
    run_id: &str,
    labels: &str,
    kind: WorkflowKind,
    dry_run: bool,
    no_duplicate: bool,
) -> Result<(), Box<dyn std::error::Error>> {
    // Run the GitHub CLI to get the workflow run
    let run_summary = github_cli.run_summary(None, run_id)?;
    log::info!("Run summary: {run_summary}");

    let failed_jobs = util::take_lines_with_failed_jobs(run_summary);
    if failed_jobs.is_empty() {
        log::error!("No failed jobs found! Exiting...");
        std::process::exit(1);
    }

    log::info!("Failed jobs: {:?}", failed_jobs);
    let failed_job_ids = util::id_from_job_lines(&failed_jobs);
    let failed_job_logs: Vec<String> = failed_job_ids
        .iter()
        .map(|job_id| github_cli.failed_job_log(None, job_id))
        .collect::<Result<Vec<String>, Box<dyn Error>>>()?;

    log::info!("Got {} failed job log(s)", failed_job_logs.len());

    let failed_logs = failed_job_logs
        .iter()
        .zip(failed_job_ids.iter())
        .map(|(log, id)| ErrorLog::new(id.to_string(), log.to_string()))
        .collect::<Result<Vec<ErrorLog>, Box<dyn Error>>>()?;

    let gh_issue = parse_to_gh_issue(
        failed_logs,
        github_cli.default_repo(),
        run_id.to_owned(),
        labels.to_string(),
        kind,
    )?;
    if no_duplicate {
        let similar_issues = github_cli.issue_bodies_open_with_label(None, labels)?;
        // Check how similar the issues are
        let smallest_distance = issue_text_similarity(&gh_issue.body(), &similar_issues);
        log::info!("Smallest levenshtein distance to similar issue: {smallest_distance} (Similarity threshold={LEVENSHTEIN_THRESHOLD})");
        match smallest_distance {
            0 => {
                log::warn!("An issue with the exact same body already exists. Exiting...");
                std::process::exit(0);
            },
            _ if smallest_distance < LEVENSHTEIN_THRESHOLD => {
                log::warn!("An issue with a similar body already exists. Exiting...");
                std::process::exit(0);
            },
            _ => log::info!("No similar issue found. Continuing..."),
        }
    }
    if dry_run {
        println!("####################################");
        println!("DRY RUN MODE! The following issue would be created:");
        println!("==== ISSUE TITLE ==== \n{}", gh_issue.title());
        println!("==== ISSUE LABEL(S) ==== \n{}", gh_issue.labels().join(","));
        println!("==== START OF ISSUE BODY ==== \n{}", gh_issue.body());
        println!("==== END OF ISSUE BODY ====");
    } else {
        log::debug!("Creating an issue in the remote repository with the following characteristics:\n==== ISSUE TITLE ==== \n{title}\n==== ISSUE LABEL(S) ==== \n{labels}\n==== START OF ISSUE BODY ==== \n{body}\n==== END OF ISSUE BODY ====", title = gh_issue.title(), labels = gh_issue.labels().join(","), body = gh_issue.body());
        github_cli.create_issue(None, gh_issue.title(), &gh_issue.body(), gh_issue.labels())?;
    }
    Ok(())
}

/// Calculate the smallest levenshtein distance between the issue body and the other issues with the same label
fn issue_text_similarity(issue_body: &str, other_issues: &[String]) -> usize {
    let issue_body_without_timestamps = util::remove_timestamps(issue_body);

    let smallest_distance = other_issues
        .iter()
        .map(|other_issue_body| {
            distance::levenshtein(
                &issue_body_without_timestamps,
                &util::remove_timestamps(other_issue_body),
            )
        })
        .min()
        .unwrap_or(usize::MAX);

    smallest_distance
}

fn parse_to_gh_issue(
    errlogs: Vec<ErrorLog>,
    repo: &str,
    run_id: String,
    label: String,
    kind: WorkflowKind,
) -> Result<Issue, Box<dyn Error>> {
    let failed_jobs: Vec<FailedJob> = errlogs
        .iter()
        .map(|errlog| {
            let err_summary = err_msg_parse::parse_error_message(errlog.no_prefix_log(), kind)?;
            Ok(FailedJob::new(
                errlog.failed_job().to_owned(),
                errlog.job_id().to_owned(),
                gh::util::repo_url_to_job_url(repo, &run_id, errlog.job_id()),
                errlog.failed_step().to_owned(),
                err_summary,
            ))
        })
        .collect::<Result<Vec<FailedJob>, Box<dyn Error>>>()?;

    let issue = Issue::new(
        run_id.to_string(),
        gh::util::repo_url_to_run_url(repo, &run_id),
        failed_jobs,
        label,
    );
    Ok(issue)
}

#[cfg(test)]
mod tests {
    use super::*;
    use pretty_assertions::assert_eq;

    const EXAMPLE_ISSUE_BODY_0: &str = r#"**Run ID**: 7858139663 [LINK TO RUN]( https://github.com/luftkode/distro-template/actions/runs/7850874958)

**2 jobs failed:**
- **`Test template xilinx`**
- **`Test template raspberry`**

### `Test template xilinx` (ID 21442749267)
**Step failed:** `📦 Build yocto image`
\
**Log:** https://github.com/luftkode/distro-template/actions/runs/7858139663/job/21442749267
\
*Best effort error summary*:
```
Yocto error: ERROR: No recipes available for: ...
```
### `Test template raspberry` (ID 21442749166)
**Step failed:** `📦 Build yocto image`
\
**Log:** https://github.com/luftkode/distro-template/actions/runs/7858139663/job/21442749166
\
*Best effort error summary*:
```
Yocto error: ERROR: No recipes available for: ...
```"#;

    const EXAMPLE_ISSUE_BODY_1: &str = r#"**Run ID**: 7858139663 [LINK TO RUN]( https://github.com/luftkode/distro-template/actions/runs/7850874958)

**2 jobs failed:**
- **`Test template xilinx`**
- **`Test template raspberry`**

### `Test template xilinx` (ID 21442749267)
**Step failed:** `📦 Build yocto image`
\
**Log:** https://github.com/luftkode/distro-template/actions/runs/7858139663/job/21442749267
\
*Best effort error summary*:
```
Yocto error: ERROR: No recipes available for: ...
```
### `Test template raspberry` (ID 21442749166)
**Step failed:** `📦 Build yocto image`
\
**Log:** https://github.com/luftkode/distro-template/actions/runs/7858139663/job/21442749166
\
*Best effort error summary*:
```
Yocto error: ERROR: No recipes available for: ...
```"#;

    #[test]
    fn test_issue_body_distance() {
        let issue_0 = EXAMPLE_ISSUE_BODY_0.to_string();
        let issue_1 = EXAMPLE_ISSUE_BODY_1.to_string();
        let distance = issue_text_similarity(&issue_0, &[issue_1]);
        assert_eq!(distance, 0);
    }

    /// Identical except for very similar run and job IDs
    #[test]
    fn test_issue_body_distance_edit_minimal_diff() {
        let issue_0 = EXAMPLE_ISSUE_BODY_0.to_string();
        let issue_1 = EXAMPLE_ISSUE_BODY_1.to_string();
        let new_run_id = "7858139660";
        let new_job0_id = "21442749260";
        let new_job1_id = "21442749200";

        let issue_1 = issue_1.replace("7858139663", new_run_id);
        let issue_1 = issue_1.replace("21442749267", new_job0_id);
        let issue_1 = issue_1.replace("21442749166", new_job1_id);

        let distance = issue_text_similarity(&issue_0, &[issue_1]);
        assert_eq!(distance, 0); // No difference as IDs are now masked when comparing
    }

    /// Identical except for as different run and job IDs as possible
    #[test]
    fn test_issue_body_distance_edit_largest_similar() {
        let issue_0 = EXAMPLE_ISSUE_BODY_0.to_string();
        let issue_1 = EXAMPLE_ISSUE_BODY_1.to_string();
        let new_run_id = "0000000000";
        let new_job0_id = "00000000000";
        let new_job1_id = "33333333333";

        let issue_1 = issue_1.replace("7858139663", new_run_id);
        let issue_1 = issue_1.replace("21442749267", new_job0_id);
        let issue_1 = issue_1.replace("21442749166", new_job1_id);

        let distance = issue_text_similarity(&issue_0, &[issue_1]);
        assert_eq!(distance, 0); // No difference as IDs are now masked when comparing
    }

    /// Smallest difference in job and run IDs but different in other ways and should be treated as different.
    #[test]
    fn test_issue_body_distance_edit_minimal_but_different() {
        let issue_0 = EXAMPLE_ISSUE_BODY_0.to_string();
        let issue_1 = EXAMPLE_ISSUE_BODY_1.to_string();
        let new_run_id = "7858139660";
        let new_job0_id = "21442749260";
        let new_job1_id = "21442749200";

        let issue_1 = issue_1.replace("7858139663", new_run_id);
        let issue_1 = issue_1.replace("21442749267", new_job0_id);
        let issue_1 = issue_1.replace("21442749166", new_job1_id);
        let issue_1 = issue_1.replace(
            "Yocto error: ERROR: No recipes available for: ...",
            "ERROR: fetcher failure. malformed url. Attempting to fetch from ${SOURCE_MIRROR_URL}",
        );

        let distance = issue_text_similarity(&issue_0, &[issue_1]);
        assert_eq!(distance, 142);
    }

    // Regression test for https://github.com/luftkode/gh-workflow-parser/issues/9
    /// Large issue text with many timestamps doesn't make the issues dissimilar
    #[test]
    fn test_issue9_similar_with_frequest_timestamps() {
        let distance = issue_text_similarity(
            ISSUE_FREQUENT_TIMESTAMPS_TEXT1,
            &[ISSUE_FREQUENT_TIMESTAMPS_TEXT2.to_string()],
        );

        assert!(distance < LEVENSHTEIN_THRESHOLD, "Distance: {distance}");
    }

    const ISSUE_FREQUENT_TIMESTAMPS_TEXT1: &'static str = r#"**Run ID**: 8072883145 [LINK TO RUN](https://github.com/luftkode/distro-template/actions/runs/8072883145)

**1 job failed:**
- **`Test template xilinx`**

### `Test template xilinx` (ID 22055505284)
**Step failed:** `📦 Build yocto image`
\
**Log:** https://github.com/luftkode/distro-template/actions/runs/8072883145/job/22055505284
\
*Best effort error summary*:
```
##[group]Run set -ou pipefail
set -ou pipefail
just --yes build-ci-image 2>&1 | tee "yocto_build.log"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  REGISTRY: ghcr.io
  CARGO_TERM_COLOR: always
  SSH_AUTH_SOCK: /tmp/ssh-XXXXXXJhUcQF/agent.2944549
  CLONE_TO_DIR: clone-to-dir
  YOCTO_BUILD_LOG: yocto_build.log
##[endgroup]
ABS_KAS_FRAG_CFG_DIR: /opt/github_runner_yocto/_work/distro-template/distro-template/clone-to-dir/test-template-ci-xilinx-distro/distro-builder-common/kas-config-fragments
[[BEFORE RUN]] - copying kas config: build_ci.yml from: /opt/github_runner_yocto/_work/distro-template/distro-template/clone-to-dir/test-template-ci-xilinx-distro/distro-builder-common/kas-config-fragments to: /opt/github_runner_yocto/_work/distro-template/distro-template/clone-to-dir/test-template-ci-xilinx-distro/main-image
---
Setting bitbake environment variables: export BB_ENV_PASSTHROUGH_ADDITIONS=YOCTO_BRANCH; export YOCTO_BRANCH=nanbield;
---
Running command(s): just in-container-build-ci-image
---
Not in container, running command(s) through: "docker compose" with image=image
---
 Network distro-builder-common_default  Creating
 Network distro-builder-common_default  Created
~/kas/run-kas shell "main-image/image.yml:main-image/build_ci.yml" -c "bitbake -c cleansstate virtual/bootloader virtual/kernel"
2024-02-28 00:03:44 - INFO     - run-kas 4.2 started
2024-02-28 00:03:44 - INFO     - /app/main-image$ git rev-parse --show-toplevel
2024-02-28 00:03:44 - INFO     - /app/main-image$ git rev-parse --show-toplevel
2024-02-28 00:03:44 - INFO     - /app/main-image$ git rev-parse --show-toplevel
2024-02-28 00:03:44 - INFO     - /app/yocto$ git clone -q https://git.yoctoproject.org/poky /app/yocto/poky/
2024-02-28 00:03:44 - INFO     - /app/yocto$ git clone -q https://github.com/openembedded/meta-openembedded /app/yocto/layers/meta-openembedded
2024-02-28 00:03:44 - INFO     - /app/yocto$ git clone -q git@github.com:luftkode/meta-airborne.git /app/yocto/layers/meta-airborne
2024-02-28 00:03:44 - INFO     - /app/yocto$ git clone -q git@github.com:luftkode/meta-skytem-xilinx.git /app/yocto/layers/meta-skytem-xilinx
2024-02-28 00:03:44 - INFO     - /app/yocto$ git clone -q https://github.com/Xilinx/meta-xilinx /app/yocto/layers/meta-xilinx
2024-02-28 00:03:44 - INFO     - /app/yocto$ git clone -q https://github.com/Xilinx/meta-xilinx-tools /app/yocto/layers/meta-xilinx-tools
2024-02-28 00:03:44 - INFO     - /app/yocto$ git clone -q https://git.yoctoproject.org/meta-virtualization/ /app/yocto/layers/meta-virtualization
2024-02-28 00:03:44 - INFO     - /app/yocto$ git clone -q git@github.com:rust-embedded/meta-rust-bin.git /app/yocto/layers/meta-rust-bin
2024-02-28 00:03:45 - ERROR    - Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
2024-02-28 00:03:45 - ERROR    - Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
2024-02-28 00:03:45 - ERROR    - Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
2024-02-28 00:03:45 - INFO     - Repository meta-virtualization cloned
2024-02-28 00:03:45 - INFO     - /app/yocto/layers/meta-virtualization$ git remote set-url origin https://git.yoctoproject.org/meta-virtualization/
2024-02-28 00:03:45 - INFO     - /app/yocto/layers/meta-virtualization$ git cat-file -t ac125d881f34ff356390e19e02964f8980d4ec38
2024-02-28 00:03:45 - INFO     - Repository meta-virtualization already contains ac125d881f34ff356390e19e02964f8980d4ec38 as commit
2024-02-28 00:03:45 - INFO     - Repository meta-xilinx-tools cloned
2024-02-28 00:03:45 - INFO     - /app/yocto/layers/meta-xilinx-tools$ git remote set-url origin https://github.com/Xilinx/meta-xilinx-tools
2024-02-28 00:03:45 - INFO     - /app/yocto/layers/meta-xilinx-tools$ git cat-file -t 92b449c333e3a991735388f4cc0e38ec97e1f9ad
2024-02-28 00:03:45 - INFO     - Repository meta-xilinx-tools already contains 92b449c333e3a991735388f4cc0e38ec97e1f9ad as commit
2024-02-28 00:03:46 - INFO     - Repository meta-xilinx cloned
2024-02-28 00:03:46 - INFO     - /app/yocto/layers/meta-xilinx$ git remote set-url origin https://github.com/Xilinx/meta-xilinx
2024-02-28 00:03:46 - INFO     - /app/yocto/layers/meta-xilinx$ git cat-file -t a1c7db00727d02b8cd47d665fee86f75b0f83080
2024-02-28 00:03:46 - INFO     - Repository meta-xilinx already contains a1c7db00727d02b8cd47d665fee86f75b0f83080 as commit
2024-02-28 00:03:46 - INFO     - Repository meta-skytem-xilinx cloned
2024-02-28 00:03:46 - INFO     - /app/yocto/layers/meta-skytem-xilinx$ git remote set-url origin git@github.com:luftkode/meta-skytem-xilinx.git
2024-02-28 00:03:46 - INFO     - /app/yocto/layers/meta-skytem-xilinx$ git cat-file -t e8cf7aaa8c9d4d72a702fa0577421446aa38b223
2024-02-28 00:03:46 - INFO     - Repository meta-skytem-xilinx already contains e8cf7aaa8c9d4d72a702fa0577421446aa38b223 as commit
2024-02-28 00:03:46 - INFO     - Repository meta-rust-bin cloned
2024-02-28 00:03:46 - INFO     - /app/yocto/layers/meta-rust-bin$ git remote set-url origin git@github.com:rust-embedded/meta-rust-bin.git
2024-02-28 00:03:46 - INFO     - /app/yocto/layers/meta-rust-bin$ git cat-file -t 019e3b0073510e6f39fac23d9a3c2dd6d793a2fe
2024-02-28 00:03:46 - INFO     - Repository meta-rust-bin already contains 019e3b0073510e6f39fac23d9a3c2dd6d793a2fe as commit
2024-02-28 00:03:48 - INFO     - Repository meta-airborne cloned
2024-02-28 00:03:48 - INFO     - /app/yocto/layers/meta-airborne$ git remote set-url origin git@github.com:luftkode/meta-airborne.git
2024-02-28 00:03:48 - INFO     - /app/yocto/layers/meta-airborne$ git cat-file -t fa6e5f001067ffe6f19e038a8a87cc06d409cafa
2024-02-28 00:03:48 - INFO     - Repository meta-airborne already contains fa6e5f001067ffe6f19e038a8a87cc06d409cafa as commit
2024-02-28 00:03:49 - INFO     - Repository meta-openembedded cloned
2024-02-28 00:03:49 - INFO     - /app/yocto/layers/meta-openembedded$ git remote set-url origin https://github.com/openembedded/meta-openembedded
2024-02-28 00:03:50 - INFO     - /app/yocto/layers/meta-openembedded$ git cat-file -t da9063bdfbe130f424ba487f167da68e0ce90e7d
2024-02-28 00:03:50 - INFO     - Repository meta-openembedded already contains da9063bdfbe130f424ba487f167da68e0ce90e7d as commit
2024-02-28 00:04:00 - INFO     - Repository poky cloned
2024-02-28 00:04:00 - INFO     - /app/yocto/poky/$ git remote set-url origin https://git.yoctoproject.org/poky
2024-02-28 00:04:00 - INFO     - /app/yocto/poky/$ git cat-file -t 1a5c00f00c14cee3ba5d39c8c8db7a9738469eab
2024-02-28 00:04:00 - INFO     - Repository poky already contains 1a5c00f00c14cee3ba5d39c8c8db7a9738469eab as commit
2024-02-28 00:04:00 - INFO     - /app/yocto/poky/$ git status -s
2024-02-28 00:04:00 - INFO     - /app/yocto/poky/$ git checkout -q 1a5c00f00c14cee3ba5d39c8c8db7a9738469eab
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-openembedded$ git status -s
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-openembedded$ git checkout -q da9063bdfbe130f424ba487f167da68e0ce90e7d
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-airborne$ git status -s
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-airborne$ git checkout -q fa6e5f001067ffe6f19e038a8a87cc06d409cafa
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-skytem-xilinx$ git status -s
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-skytem-xilinx$ git checkout -q e8cf7aaa8c9d4d72a702fa0577421446aa38b223
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-xilinx$ git status -s
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-xilinx$ git checkout -q a1c7db00727d02b8cd47d665fee86f75b0f83080
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-xilinx-tools$ git status -s
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-xilinx-tools$ git checkout -q 92b449c333e3a991735388f4cc0e38ec97e1f9ad
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-virtualization$ git status -s
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-virtualization$ git checkout -q ac125d881f34ff356390e19e02964f8980d4ec38
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-rust-bin$ git status -s
2024-02-28 00:04:01 - INFO     - /app/yocto/layers/meta-rust-bin$ git checkout -q 019e3b0073510e6f39fac23d9a3c2dd6d793a2fe
2024-02-28 00:04:01 - INFO     - /app/yocto/poky/$ /tmp/tmpm4x_iz34/get_bb_env /app/yocto/build
2024-02-28 00:04:01 - INFO     - To start the default build, run: bitbake -c build test-template-ci-xilinx-image package-index
Loading cache...done.
Loaded 0 entries from dependency cache.
Parsing recipes...ERROR: ParseError at /app/yocto/build/../layers/meta-skytem-xilinx/recipes-bundles/zynq-update-bundle/zynq-update-bundle.bb:1: Could not inherit file classes/bundle.bbclass
ERROR: Parsing halted due to errors, see error messages above

Summary: There were 2 ERROR messages, returning a non-zero exit code.
2024-02-28 00:05:18 - ERROR    - Shell returned non-zero exit status
2024-02-28 00:05:18 - ERROR    - Command "/bin/bash -c 'bitbake -c cleansstate virtual/bootloader virtual/kernel'" failed with error 1
error: Recipe `in-container-build-ci-image` failed on line 30 with exit code 1
error: Recipe `run-in-docker` failed with exit code 1
error: Recipe `build-ci-image` failed with exit code 1
##[error]Process completed with exit code 1.
##[group]Run cargo install gh-workflow-parser --profile release-ci && gh-workflow-parser --version
cargo install gh-workflow-parser --profile release-ci && gh-workflow-parser --version
failure_log_abs_path=$( gh-workflow-parser locate-failure-log --input-file="yocto_build.log" --kind=yocto )
failure_log_basename=$( basename "${failure_log_abs_path}" )
echo "failure_log_abs_path=${failure_log_abs_path}"
echo "failure_log_basename=${failure_log_basename}"
echo "YOCTO_FAILED_LOG_PATH=${failure_log_abs_path}" >> $GITHUB_ENV
echo "YOCTO_FAILED_LOG_BASENAME=${failure_log_basename}" >> $GITHUB_ENV
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  REGISTRY: ghcr.io
  CARGO_TERM_COLOR: always
  SSH_AUTH_SOCK: /tmp/ssh-XXXXXXJhUcQF/agent.2944549
  CLONE_TO_DIR: clone-to-dir
  YOCTO_BUILD_LOG: yocto_build.log
##[endgroup]
    Updating crates.io index
     Ignored package `gh-workflow-parser v0.5.3` is already installed, use --force to override
gh-workflow-parser 0.5.3
INFO Locating failure log for kind: Yocto
INFO Reading log file: "yocto_build.log"
ERROR No log file line found
##[error]Process completed with exit code 1.
##[group]Run actions/upload-artifact@v4
with:
  retention-days: 7
  if-no-files-found: warn
  compression-level: 6
  overwrite: false
env:
  REGISTRY: ghcr.io
  CARGO_TERM_COLOR: always
  SSH_AUTH_SOCK: /tmp/ssh-XXXXXXJhUcQF/agent.2944549
  CLONE_TO_DIR: clone-to-dir
  YOCTO_BUILD_LOG: yocto_build.log
##[endgroup]
##[error]Input required and not supplied: path
```"#;

    const ISSUE_FREQUENT_TIMESTAMPS_TEXT2: &'static str = r#"**Run ID**: 8057183947 [LINK TO RUN](https://github.com/luftkode/distro-template/actions/runs/8057183947)

**1 job failed:**
- **`Test template xilinx`**

### `Test template xilinx` (ID 22007767507)
**Step failed:** `📦 Build yocto image`
\
**Log:** https://github.com/luftkode/distro-template/actions/runs/8057183947/job/22007767507
\
*Best effort error summary*:
```
##[group]Run set -ou pipefail
set -ou pipefail
just --yes build-ci-image 2>&1 | tee "yocto_build.log"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  REGISTRY: ghcr.io
  CARGO_TERM_COLOR: always
  SSH_AUTH_SOCK: /tmp/ssh-XXXXXXooAvJr/agent.4134531
  CLONE_TO_DIR: clone-to-dir
  YOCTO_BUILD_LOG: yocto_build.log
##[endgroup]
ABS_KAS_FRAG_CFG_DIR: /opt/github_runner_yocto/_work/distro-template/distro-template/clone-to-dir/test-template-ci-xilinx-distro/distro-builder-common/kas-config-fragments
[[BEFORE RUN]] - copying kas config: build_ci.yml from: /opt/github_runner_yocto/_work/distro-template/distro-template/clone-to-dir/test-template-ci-xilinx-distro/distro-builder-common/kas-config-fragments to: /opt/github_runner_yocto/_work/distro-template/distro-template/clone-to-dir/test-template-ci-xilinx-distro/main-image
---
Setting bitbake environment variables: export BB_ENV_PASSTHROUGH_ADDITIONS=YOCTO_BRANCH; export YOCTO_BRANCH=nanbield;
---
Running command(s): just in-container-build-ci-image
---
Not in container, running command(s) through: "docker compose" with image=image
---
 Network distro-builder-common_default  Creating
 Network distro-builder-common_default  Created
~/kas/run-kas shell "main-image/image.yml:main-image/build_ci.yml" -c "bitbake -c cleansstate virtual/bootloader virtual/kernel"
2024-02-26 23:44:33 - INFO     - run-kas 4.2 started
2024-02-26 23:44:33 - INFO     - /app/main-image$ git rev-parse --show-toplevel
2024-02-26 23:44:33 - INFO     - /app/main-image$ git rev-parse --show-toplevel
2024-02-26 23:44:33 - INFO     - /app/main-image$ git rev-parse --show-toplevel
2024-02-26 23:44:33 - INFO     - /app/yocto$ git clone -q https://git.yoctoproject.org/poky /app/yocto/poky/
2024-02-26 23:44:33 - INFO     - /app/yocto$ git clone -q https://github.com/openembedded/meta-openembedded /app/yocto/layers/meta-openembedded
2024-02-26 23:44:33 - INFO     - /app/yocto$ git clone -q git@github.com:luftkode/meta-airborne.git /app/yocto/layers/meta-airborne
2024-02-26 23:44:33 - INFO     - /app/yocto$ git clone -q git@github.com:luftkode/meta-skytem-xilinx.git /app/yocto/layers/meta-skytem-xilinx
2024-02-26 23:44:33 - INFO     - /app/yocto$ git clone -q https://github.com/Xilinx/meta-xilinx /app/yocto/layers/meta-xilinx
2024-02-26 23:44:33 - INFO     - /app/yocto$ git clone -q https://github.com/Xilinx/meta-xilinx-tools /app/yocto/layers/meta-xilinx-tools
2024-02-26 23:44:33 - INFO     - /app/yocto$ git clone -q https://git.yoctoproject.org/meta-virtualization/ /app/yocto/layers/meta-virtualization
2024-02-26 23:44:33 - INFO     - /app/yocto$ git clone -q git@github.com:rust-embedded/meta-rust-bin.git /app/yocto/layers/meta-rust-bin
2024-02-26 23:44:33 - ERROR    - Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
2024-02-26 23:44:33 - ERROR    - Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
2024-02-26 23:44:33 - ERROR    - Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
2024-02-26 23:44:34 - INFO     - Repository meta-virtualization cloned
2024-02-26 23:44:34 - INFO     - /app/yocto/layers/meta-virtualization$ git remote set-url origin https://git.yoctoproject.org/meta-virtualization/
2024-02-26 23:44:34 - INFO     - /app/yocto/layers/meta-virtualization$ git cat-file -t ac125d881f34ff356390e19e02964f8980d4ec38
2024-02-26 23:44:34 - INFO     - Repository meta-virtualization already contains ac125d881f34ff356390e19e02964f8980d4ec38 as commit
2024-02-26 23:44:34 - INFO     - Repository meta-xilinx-tools cloned
2024-02-26 23:44:34 - INFO     - /app/yocto/layers/meta-xilinx-tools$ git remote set-url origin https://github.com/Xilinx/meta-xilinx-tools
2024-02-26 23:44:34 - INFO     - /app/yocto/layers/meta-xilinx-tools$ git cat-file -t 92b449c333e3a991735388f4cc0e38ec97e1f9ad
2024-02-26 23:44:34 - INFO     - Repository meta-xilinx-tools already contains 92b449c333e3a991735388f4cc0e38ec97e1f9ad as commit
2024-02-26 23:44:34 - INFO     - Repository meta-xilinx cloned
2024-02-26 23:44:34 - INFO     - /app/yocto/layers/meta-xilinx$ git remote set-url origin https://github.com/Xilinx/meta-xilinx
2024-02-26 23:44:35 - INFO     - /app/yocto/layers/meta-xilinx$ git cat-file -t a1c7db00727d02b8cd47d665fee86f75b0f83080
2024-02-26 23:44:35 - INFO     - Repository meta-xilinx already contains a1c7db00727d02b8cd47d665fee86f75b0f83080 as commit
2024-02-26 23:44:35 - INFO     - Repository meta-skytem-xilinx cloned
2024-02-26 23:44:35 - INFO     - /app/yocto/layers/meta-skytem-xilinx$ git remote set-url origin git@github.com:luftkode/meta-skytem-xilinx.git
2024-02-26 23:44:35 - INFO     - /app/yocto/layers/meta-skytem-xilinx$ git cat-file -t e8cf7aaa8c9d4d72a702fa0577421446aa38b223
2024-02-26 23:44:35 - INFO     - Repository meta-skytem-xilinx already contains e8cf7aaa8c9d4d72a702fa0577421446aa38b223 as commit
2024-02-26 23:44:35 - INFO     - Repository meta-rust-bin cloned
2024-02-26 23:44:35 - INFO     - /app/yocto/layers/meta-rust-bin$ git remote set-url origin git@github.com:rust-embedded/meta-rust-bin.git
2024-02-26 23:44:35 - INFO     - /app/yocto/layers/meta-rust-bin$ git cat-file -t 019e3b0073510e6f39fac23d9a3c2dd6d793a2fe
2024-02-26 23:44:35 - INFO     - Repository meta-rust-bin already contains 019e3b0073510e6f39fac23d9a3c2dd6d793a2fe as commit
2024-02-26 23:44:37 - INFO     - Repository meta-airborne cloned
2024-02-26 23:44:37 - INFO     - /app/yocto/layers/meta-airborne$ git remote set-url origin git@github.com:luftkode/meta-airborne.git
2024-02-26 23:44:37 - INFO     - /app/yocto/layers/meta-airborne$ git cat-file -t fa6e5f001067ffe6f19e038a8a87cc06d409cafa
2024-02-26 23:44:37 - INFO     - Repository meta-airborne already contains fa6e5f001067ffe6f19e038a8a87cc06d409cafa as commit
2024-02-26 23:44:38 - INFO     - Repository meta-openembedded cloned
2024-02-26 23:44:38 - INFO     - /app/yocto/layers/meta-openembedded$ git remote set-url origin https://github.com/openembedded/meta-openembedded
2024-02-26 23:44:38 - INFO     - /app/yocto/layers/meta-openembedded$ git cat-file -t da9063bdfbe130f424ba487f167da68e0ce90e7d
2024-02-26 23:44:38 - INFO     - Repository meta-openembedded already contains da9063bdfbe130f424ba487f167da68e0ce90e7d as commit
2024-02-26 23:44:49 - INFO     - Repository poky cloned
2024-02-26 23:44:49 - INFO     - /app/yocto/poky/$ git remote set-url origin https://git.yoctoproject.org/poky
2024-02-26 23:44:49 - INFO     - /app/yocto/poky/$ git cat-file -t 1a5c00f00c14cee3ba5d39c8c8db7a9738469eab
2024-02-26 23:44:49 - INFO     - Repository poky already contains 1a5c00f00c14cee3ba5d39c8c8db7a9738469eab as commit
2024-02-26 23:44:49 - INFO     - /app/yocto/poky/$ git status -s
2024-02-26 23:44:49 - INFO     - /app/yocto/poky/$ git checkout -q 1a5c00f00c14cee3ba5d39c8c8db7a9738469eab
2024-02-26 23:44:49 - INFO     - /app/yocto/layers/meta-openembedded$ git status -s
2024-02-26 23:44:49 - INFO     - /app/yocto/layers/meta-openembedded$ git checkout -q da9063bdfbe130f424ba487f167da68e0ce90e7d
2024-02-26 23:44:49 - INFO     - /app/yocto/layers/meta-airborne$ git status -s
2024-02-26 23:44:49 - INFO     - /app/yocto/layers/meta-airborne$ git checkout -q fa6e5f001067ffe6f19e038a8a87cc06d409cafa
2024-02-26 23:44:49 - INFO     - /app/yocto/layers/meta-skytem-xilinx$ git status -s
2024-02-26 23:44:49 - INFO     - /app/yocto/layers/meta-skytem-xilinx$ git checkout -q e8cf7aaa8c9d4d72a702fa0577421446aa38b223
2024-02-26 23:44:49 - INFO     - /app/yocto/layers/meta-xilinx$ git status -s
2024-02-26 23:44:50 - INFO     - /app/yocto/layers/meta-xilinx$ git checkout -q a1c7db00727d02b8cd47d665fee86f75b0f83080
2024-02-26 23:44:50 - INFO     - /app/yocto/layers/meta-xilinx-tools$ git status -s
2024-02-26 23:44:50 - INFO     - /app/yocto/layers/meta-xilinx-tools$ git checkout -q 92b449c333e3a991735388f4cc0e38ec97e1f9ad
2024-02-26 23:44:50 - INFO     - /app/yocto/layers/meta-virtualization$ git status -s
2024-02-26 23:44:50 - INFO     - /app/yocto/layers/meta-virtualization$ git checkout -q ac125d881f34ff356390e19e02964f8980d4ec38
2024-02-26 23:44:50 - INFO     - /app/yocto/layers/meta-rust-bin$ git status -s
2024-02-26 23:44:50 - INFO     - /app/yocto/layers/meta-rust-bin$ git checkout -q 019e3b0073510e6f39fac23d9a3c2dd6d793a2fe
2024-02-26 23:44:50 - INFO     - /app/yocto/poky/$ /tmp/tmpjxb_xapi/get_bb_env /app/yocto/build
2024-02-26 23:44:50 - INFO     - To start the default build, run: bitbake -c build test-template-ci-xilinx-image package-index
Loading cache...done.
Loaded 0 entries from dependency cache.
Parsing recipes...ERROR: ParseError at /app/yocto/build/../layers/meta-skytem-xilinx/recipes-bundles/zynq-update-bundle/zynq-update-bundle.bb:1: Could not inherit file classes/bundle.bbclass
ERROR: Parsing halted due to errors, see error messages above

Summary: There were 2 ERROR messages, returning a non-zero exit code.
2024-02-26 23:46:07 - ERROR    - Shell returned non-zero exit status
2024-02-26 23:46:07 - ERROR    - Command "/bin/bash -c 'bitbake -c cleansstate virtual/bootloader virtual/kernel'" failed with error 1
error: Recipe `in-container-build-ci-image` failed on line 30 with exit code 1
error: Recipe `run-in-docker` failed with exit code 1
error: Recipe `build-ci-image` failed with exit code 1
##[error]Process completed with exit code 1.
##[group]Run cargo install gh-workflow-parser --profile release-ci && gh-workflow-parser --version
cargo install gh-workflow-parser --profile release-ci && gh-workflow-parser --version
failure_log_abs_path=$( gh-workflow-parser locate-failure-log --input-file="yocto_build.log" --kind=yocto )
failure_log_basename=$( basename "${failure_log_abs_path}" )
echo "failure_log_abs_path=${failure_log_abs_path}"
echo "failure_log_basename=${failure_log_basename}"
echo "YOCTO_FAILED_LOG_PATH=${failure_log_abs_path}" >> $GITHUB_ENV
echo "YOCTO_FAILED_LOG_BASENAME=${failure_log_basename}" >> $GITHUB_ENV
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  REGISTRY: ghcr.io
  CARGO_TERM_COLOR: always
  SSH_AUTH_SOCK: /tmp/ssh-XXXXXXooAvJr/agent.4134531
  CLONE_TO_DIR: clone-to-dir
  YOCTO_BUILD_LOG: yocto_build.log
##[endgroup]
    Updating crates.io index
     Ignored package `gh-workflow-parser v0.5.3` is already installed, use --force to override
gh-workflow-parser 0.5.3
INFO Locating failure log for kind: Yocto
INFO Reading log file: "yocto_build.log"
ERROR No log file line found
##[error]Process completed with exit code 1.
##[group]Run actions/upload-artifact@v4
with:
  retention-days: 7
  if-no-files-found: warn
  compression-level: 6
  overwrite: false
env:
  REGISTRY: ghcr.io
  CARGO_TERM_COLOR: always
  SSH_AUTH_SOCK: /tmp/ssh-XXXXXXooAvJr/agent.4134531
  CLONE_TO_DIR: clone-to-dir
  YOCTO_BUILD_LOG: yocto_build.log
##[endgroup]
##[error]Input required and not supplied: path
```"#;
}