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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/nightly_ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: nightly-ci is not happy
labels: ci-nightly
---
17 changes: 17 additions & 0 deletions .github/workflows/ci_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,20 @@ 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

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.

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
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?