Skip to content

feat(issuegenerator): link to specific failing job instead of workflow run#1552

Open
vyagh wants to merge 1 commit intoopen-telemetry:mainfrom
vyagh:feat/issuegenerator-failed-job-link
Open

feat(issuegenerator): link to specific failing job instead of workflow run#1552
vyagh wants to merge 1 commit intoopen-telemetry:mainfrom
vyagh:feat/issuegenerator-failed-job-link

Conversation

@vyagh
Copy link
Contributor

@vyagh vyagh commented Jan 29, 2026

Description

Updates the issuegenerator to link directly to the failing job instead of the top-level workflow run summary. This saves maintainers time by taking them straight to the logs of the specific failure.

If a failing job cannot be found (e.g logs expired or API error) or if the run failed immediately, it safely falls back to the existing behavior (linking to the run summary).

Changes

  • Added getFailedJobURL to client.go to query the actions/runs/{id}/jobs API.
  • Updated templateHelper to use the deep link for ${linkToBuild}.
  • Added unit tests covering success, timeout, and fallback scenarios.

Issue

Fixes #1183

Testing

  • Unit tests pass (go test ./issuegenerator/...)
  • Verified API handles pagination correctly (implied by test logic)

@vyagh vyagh requested review from a team as code owners January 29, 2026 15:19
@vyagh vyagh requested a review from codeboten January 29, 2026 15:20
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 93.02326% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.45%. Comparing base (4c93dd4) to head (3c0494c).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
issuegenerator/internal/github/client.go 93.02% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1552      +/-   ##
==========================================
+ Coverage   64.13%   64.45%   +0.31%     
==========================================
  Files          66       66              
  Lines        3424     3463      +39     
==========================================
+ Hits         2196     2232      +36     
- Misses        990      992       +2     
- Partials      238      239       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vyagh vyagh force-pushed the feat/issuegenerator-failed-job-link branch from 2bd3c69 to 09d969e Compare January 29, 2026 15:48
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

We need to update the templates to reflect that we now have a list of failed issues instead of a single link

@vyagh vyagh requested a review from mx-psi February 10, 2026 04:25
return nil, err
}
for _, job := range jobs.Jobs {
if job.GetConclusion() == "failure" || job.GetConclusion() == "timed_out" {
Copy link
Member

Choose a reason for hiding this comment

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

Let's not add timed out as a reason, we know those are not the ones that caused a particular test case to fail

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Let's add helper text on the template itself

@mx-psi
Copy link
Member

mx-psi commented Feb 10, 2026

As in, here:

@vyagh vyagh requested a review from mx-psi February 11, 2026 04:53
@vyagh vyagh force-pushed the feat/issuegenerator-failed-job-link branch 2 times, most recently from f46599b to b1b217d Compare February 17, 2026 13:32
@vyagh
Copy link
Contributor Author

vyagh commented Feb 23, 2026

Hi @mx-psi
I pushed an update to address your feedback.
If I misunderstood how you wanted that helper text to look in the template, let me know.

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Apologies for the delay on this. The main reason I don't feel comfortable merging this PR is because I don't think the failing jobs are on the right place on the issue template. I also worry that there could be too many failing tests and that the message feels 'spammy'.

I would rather keep the original link and have the failing jobs at the bottom of the issue body/comment in a collapsible section.

Since we are changing the issue template, we can also rename linkToBuild (or, rather, add a new field), that really reflects the information we are adding on the issue template (which as a list of links to failing jobs)

@vyagh vyagh force-pushed the feat/issuegenerator-failed-job-link branch from b1b217d to c27856a Compare February 25, 2026 06:08
@vyagh
Copy link
Contributor Author

vyagh commented Feb 25, 2026

nw about the delay, here's what i did now:

  • linkToBuild kept as the workflow run url
  • a new failedJobs field that renders a collapsible < details > section at the bottom of the issue/comment
  • timed_out jobs are excluded, only failure conclusion is picked up

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Almost there!

PR: ${prNumber}

${failedTests}
${failedTests}${failedJobs}
Copy link
Member

Choose a reason for hiding this comment

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

Since the details HTML code is fixed I would put it on the template:

Suggested change
${failedTests}${failedJobs}
${failedTests}
<details>
<summary>Failing job(s)</summary>
${failedJobs}
</details>

(same in the other template)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated, failedJobs now just returns the list items.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw the < details > is in the template now, it'll render an empty collapsible even when there are no failed jobs. are you fine with that?

…c workflow run

This change modifies the issue generator to report individual failed jobs within a workflow run. This provides direct links to the relevant logs for faster debugging.

- Filters for strictly 'failure' conclusions, ignoring noise like 'timed_out'.
- Supports deterministic bulleted lists when multiple jobs fail.
- Adds explicit prefix text to reports for improved clarity.
- Includes unit tests for filtering logic and template rendering.
@vyagh vyagh force-pushed the feat/issuegenerator-failed-job-link branch from c27856a to 3c0494c Compare February 26, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[issuegenerator] Include link to failing job

2 participants