Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an issue when nightly-ci fails #3080

Merged
merged 3 commits into from
Feb 3, 2025
Merged

Create an issue when nightly-ci fails #3080

merged 3 commits into from
Feb 3, 2025

Conversation

JurajSadel
Copy link
Contributor

closes #3068

I've tested this with another repo, works fine there, hopefully I haven't missed anything. I'm volunteering to work on those nightly issues (I will assign them to myself), I also created a new label ci-nightly that should be assigned to the issue, also already existing issue should be updated automatically so we don't have duplicates - this is at least the theory behind this PR 😆

@JurajSadel JurajSadel added the skip-changelog No changelog modification needed label Jan 31, 2025
@@ -51,3 +51,19 @@ jobs:
device: ${{ matrix.device.soc }}
target: ${{ matrix.device.target }}
toolchain: nightly

create-issue-on-failure:
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't need to be a completely new job I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to play with it but couldn't figure out how to do that without a separate job so I went with easier option :D

Copy link
Member

Choose a reason for hiding this comment

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

IIRC, you could set continue-on-error and then transform your issue job into a steps that checks if: failure() something like that should do the trick I think

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/ISSUE_TEMPLATE/nightly_ci.md
update_existing: true
Copy link
Member

Choose a reason for hiding this comment

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

Have you tried this? From their docs:

The update_existing param can be passed and set to true when you want to update an open issue with the exact same title when it exists and false if you don't want to create a new issue, but skip updating an existing one.

What is exactly updated? It would be very cool if we had the error message in the issue body, and this update feature added the new errors either in the description or in a new comment, but this doesn't look simple enough to be worth the time.

Comment on lines 55 to 70
create-issue-on-failure:
name: Create Issue on Failure
runs-on: ubuntu-latest
needs: esp-hal-nightly
if: failure()
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Ensures the repo is cloned before accessing the issue template

- name: Create GitHub Issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/ISSUE_TEMPLATE/nightly_ci.md
update_existing: true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
create-issue-on-failure:
name: Create Issue on Failure
runs-on: ubuntu-latest
needs: esp-hal-nightly
if: failure()
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Ensures the repo is cloned before accessing the issue template
- name: Create GitHub Issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/ISSUE_TEMPLATE/nightly_ci.md
update_existing: true
- if: failure()
name: Create GitHub Issue
uses: JasonEtco/create-an-issue@v2
with:
filename: .github/ISSUE_TEMPLATE/nightly_ci.md
update_existing: true

I think this should work?

@bjoernQ
Copy link
Contributor

bjoernQ commented Feb 3, 2025

I imagined the created issue could contain a bit more useful information about the problems or at least a link to the failed run?

@JurajSadel
Copy link
Contributor Author

I've changed the approach a bit here - instead of an action (I couldn't linked the failed job in the issue description), I'm using GitHub CLI instead and do "my own" check for avoid creating new issues.

@bjoernQ
Copy link
Contributor

bjoernQ commented Feb 3, 2025

I've changed the approach a bit here - instead of an action (I couldn't linked the failed job in the issue description), I'm using GitHub CLI instead and do "my own" check for avoid creating new issues.

Looks good to me - do you have a repo where this approach is tested?

@JurajSadel
Copy link
Contributor Author

I've changed the approach a bit here - instead of an action (I couldn't linked the failed job in the issue description), I'm using GitHub CLI instead and do "my own" check for avoid creating new issues.

Looks good to me - do you have a repo where this approach is tested?

Yes, I do have a private repo, here is the output of 2 runs:

image

Both links are valid :D

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Thank you!

@MabezDev MabezDev added this pull request to the merge queue Feb 3, 2025
Merged via the queue into esp-rs:main with commit 8ba212c Feb 3, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue creation when nightly runs fail
6 participants