forked from oracle/graal
-
Notifications
You must be signed in to change notification settings - Fork 15
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
[CI] Enhance comments in "managed" github issues v2 #630
Merged
zakkak
merged 1 commit into
graalvm:default
from
zakkak:2023-12-05-better-comments-from-bot
Dec 8, 2023
Merged
[CI] Enhance comments in "managed" github issues v2 #630
zakkak
merged 1 commit into
graalvm:default
from
zakkak:2023-12-05-better-comments-from-bot
Dec 8, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oracle-contributor-agreement
bot
added
the
OCA Verified
All contributors have signed the Oracle Contributor Agreement.
label
Dec 8, 2023
zakkak
force-pushed
the
2023-12-05-better-comments-from-bot
branch
3 times, most recently
from
December 8, 2023 19:48
f0fff36
to
c967c43
Compare
Unfortunately the simple first take in graalvm#628 didn't work since it looks like the GitHub API doesn't allow us to access the workflow runs while the workflow is still running. To work around this, this new approach introduces and runs a new "GitHub Issue Updater" workflow which runs after the "Nightly CI" and "Weekly CI" workflows. This comes with the following complication. The reporter is run once for all jobs in the matrix, so it needs to figure out which failure should be reported to which issue in which repository. For details about the implementation please see the following comment also available in the jbang script: // Unfortunately it's not possible to pass information from a triggering // workflow to the triggered workflow (in this case Nightly/Weekly CI to // the Github Issue Updater). As a result, to work around this, we parse // the logs of the jobs of the workflow that triggered this workflow, in // these logs we can find information like the inputs "issue-number", // "issue-repo" etc. But we still need to somehow group the jobs // corresponding to the detected issue-numbers. To do so, we first parse // the logs of the "Set distribution" job, which is the first job of each // configuration. This job contains the issue-number and issue-repo inputs // which we use to get the github issue and map it to the job name prefix // of jobs that are part of the same configuration. // // We then check the status of the jobs of the triggered workflow, and // if any of them failed, we check if the job name starts with one of the // job name prefixes we found earlier. If it does, we add it to the list // of failed jobs for the corresponding issue. // // Finally, we process the list of failed jobs for each issue, and if // the issue is still open, we add a comment with the list of failed jobs // and the filtered logs of the first failed job. // // Mandrel integration tests are treated specially, as they have a fixed // issue repository, we can directly get the issue number from the logs // of the job, and we don't need to group the jobs by issue number, since // the structure of the workflow is simpler. The resulting comment in the GitHub issue will look like this: The build is still failing! * [Q main M 22 latest / Q IT Data5](https://github.com/graalvm/mandrel/actions/runs/7108970473/job/19353697276) * Step: Build with Maven Filtered Logs: ``` 2023-12-06T02:12:48.3045067Z Error: Class initialization of io.vertx.pgclient.impl.codec.DataTypeCodec failed. Use the option 2023-12-06T02:17:23.8202565Z Error: Class initialization of io.vertx.pgclient.impl.codec.DataTypeCodec failed. Use the option 2023-12-06T02:20:25.5812579Z [INFO] Quarkus - Integration Tests - JPA - PostgreSQL ..... FAILURE [04:01 min] 2023-12-06T02:20:25.5815363Z [INFO] Quarkus - Integration Tests - Hibernate Reactive - PostgreSQL FAILURE [01:09 min] 2023-12-06T02:20:25.5818516Z [INFO] Quarkus - Integration Tests - Reactive Pg Client ... FAILURE [ 58.794 s] ``` * [Q main M 22 latest / Q IT Data7](https://github.com/graalvm/mandrel/actions/runs/7108970473/job/19353697645) * Step: Build with Maven Filtered Logs: ``` 2023-12-06T02:21:35.5488777Z Error: Class initialization of io.vertx.pgclient.impl.codec.DataTypeCodec failed. Use the option 2023-12-06T02:23:24.7112818Z Error: Class initialization of io.vertx.pgclient.impl.codec.DataTypeCodec failed. Use the option 2023-12-06T02:34:32.8654383Z [INFO] Quarkus - Integration Tests - Hibernate Reactive with Panache FAILURE [01:29 min] 2023-12-06T02:34:32.8655349Z [INFO] Quarkus - Integration Tests - Hibernate Reactive with Panache and Kotlin FAILURE [01:49 min] ``` * [Q main M 22 latest / Q IT Security3](https://github.com/graalvm/mandrel/actions/runs/7108970473/job/19353698616) * Step: Build with Maven Filtered Logs: ``` 2023-12-06T02:19:21.8703399Z Error: Class initialization of io.vertx.pgclient.impl.codec.DataTypeCodec failed. Use the option 2023-12-06T02:26:58.5434481Z [INFO] Quarkus - Integration Tests - Security WebAuthn .... FAILURE [01:36 min] ``` * [Q main M 22 latest / Q IT Misc2](https://github.com/graalvm/mandrel/actions/runs/7108970473/job/19353699213) * Step: Build with Maven Filtered Logs: ``` 2023-12-06T02:11:17.0198258Z Error: Class initialization of com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl failed. Use the option 2023-12-06T02:21:35.8962084Z [INFO] Quarkus - Integration Tests - Test Extension - Tests FAILURE [ 32.070 s] ``` * [Q main M 22 latest / Q IT AWT, ImageIO and Java2D](https://github.com/graalvm/mandrel/actions/runs/7108970473/job/19353700284) * Step: Build with Maven Filtered Logs: ``` 2023-12-06T02:05:32.5303045Z Error: Error loading a referenced type: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method jdk.internal.loader.NativeLibrary.findEntry0(long, String) is reachable 2023-12-06T02:07:51.7787718Z [INFO] Quarkus - Integration Tests - AWT .................. FAILURE [01:24 min] ``` Link to failing CI run: https://github.com/graalvm/mandrel/actions/runs/7108970473
zakkak
force-pushed
the
2023-12-05-better-comments-from-bot
branch
from
December 8, 2023 23:45
c967c43
to
a041a02
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unfortunately the simple first take in
#628 didn't work since it looks
like the GitHub API doesn't allow us to access the workflow runs while
the workflow is still running.
To work around this, this new approach introduces and runs a new "GitHub
Issue Updater" workflow which runs after the "Nightly CI" and "Weekly
CI" workflows.
This comes with the following complication. The reporter is run once for
all jobs in the matrix, so it needs to figure out which failure should
be reported to which issue in which repository.
For details about the implementation please see the following comment
also available in the jbang script:
// Unfortunately it's not possible to pass information from a triggering
// workflow to the triggered workflow (in this case Nightly/Weekly CI to
// the Github Issue Updater). As a result, to work around this, we parse
// the logs of the jobs of the workflow that triggered this workflow, in
// these logs we can find information like the inputs "issue-number",
// "issue-repo" etc. But we still need to somehow group the jobs
// corresponding to the detected issue-numbers. To do so, we first parse
// the logs of the "Set distribution" job, which is the first job of each
// configuration. This job contains the issue-number and issue-repo inputs
// which we use to get the github issue and map it to the job name prefix
// of jobs that are part of the same configuration.
//
// We then check the status of the jobs of the triggered workflow, and
// if any of them failed, we check if the job name starts with one of the
// job name prefixes we found earlier. If it does, we add it to the list
// of failed jobs for the corresponding issue.
//
// Finally, we process the list of failed jobs for each issue, and if
// the issue is still open, we add a comment with the list of failed jobs
// and the filtered logs of the first failed job.
//
// Mandrel integration tests are treated specially, as they have a fixed
// issue repository, we can directly get the issue number from the logs
// of the job, and we don't need to group the jobs by issue number, since
// the structure of the workflow is simpler.
The resulting comment in the GitHub issue will look like this:
The build is still failing!
Filtered Logs:
Filtered Logs:\n```
2023-12-06T02:21:35.5488777Z Error: Class initialization of io.vertx.pgclient.impl.codec.DataTypeCodec failed. Use the option
2023-12-06T02:23:24.7112818Z Error: Class initialization of io.vertx.pgclient.impl.codec.DataTypeCodec failed. Use the option
2023-12-06T02:34:32.8654383Z [INFO] Quarkus - Integration Tests - Hibernate Reactive with Panache FAILURE [01:29 min]
2023-12-06T02:34:32.8655349Z [INFO] Quarkus - Integration Tests - Hibernate Reactive with Panache and Kotlin FAILURE [01:49 min]
Filtered Logs:\n```
2023-12-06T02:11:17.0198258Z Error: Class initialization of com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl failed. Use the option
2023-12-06T02:21:35.8962084Z [INFO] Quarkus - Integration Tests - Test Extension - Tests FAILURE [ 32.070 s]
Link to failing CI run: https://github.com/graalvm/mandrel/actions/runs/7108970473