Skip to content

Enhance flaky job rerun summary with detailed logs for failed tests#3885

Open
duanemay wants to merge 4 commits intodevelopfrom
show_flaky_tests
Open

Enhance flaky job rerun summary with detailed logs for failed tests#3885
duanemay wants to merge 4 commits intodevelopfrom
show_flaky_tests

Conversation

@duanemay
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 29, 2026 23:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the .github/workflows/rerun-flaky-jobs.yml workflow so that when flakiness is detected (some jobs failed and some passed), the workflow summary includes per-failed-job excerpts intended to help diagnose failing tests.

Changes:

  • Initializes a FAILED_DETAILS variable so the summary section can reference it unconditionally.
  • For each failed job, attempts to download job logs and extract FAILED-block excerpts (capped) into a collapsible <details> section.
  • Appends a new “Failed test details” section to the GITHUB_STEP_SUMMARY output when excerpts are present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/rerun-flaky-jobs.yml Outdated
Comment thread .github/workflows/rerun-flaky-jobs.yml Outdated
Comment thread .github/workflows/rerun-flaky-jobs.yml Outdated
Comment thread .github/workflows/rerun-flaky-jobs.yml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.

Comment thread .github/workflows/rerun-flaky-jobs.yml
Comment on lines +235 to +242
done < <(echo "$JOBS_JSON" | jq -r '
.jobs[]
| select(.conclusion != null and
(.conclusion == "failure" or
.conclusion == "cancelled" or
.conclusion == "timed_out"))
| [(.id | tostring), .name]
| @tsv')
Comment thread .github/workflows/rerun-flaky-jobs.yml Outdated
else
FAILED_DETAILS="${FAILED_DETAILS}
<details>
<summary><b>${ESCAPED_JOB_NAME}</b> _(truncated — global size cap reached)_</summary>
Comment thread .github/workflows/rerun-flaky-jobs.yml
@duanemay duanemay marked this pull request as ready for review May 2, 2026 21:36
@strehle strehle requested a review from Copilot May 3, 2026 10:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +133 to +140
JOBS_JSON=$(gh api "repos/${{ github.repository }}/actions/runs/${RUN_ID}/attempts/${RUN_ATTEMPT}/jobs" 2>&1)
GH_STATUS=$?
if [ "$GH_STATUS" -ne 0 ]; then
echo "Error fetching jobs (exit code: $GH_STATUS)." >&2
echo "$JOBS_JSON" >&2
exit "$GH_STATUS"
fi

Comment on lines +212 to +213
CURRENT_SIZE=${#FAILED_DETAILS}
BLOCK_SIZE=${#JOB_BLOCK}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants