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

[CI] Enhance comments in "managed" github issues v2 #630

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

zakkak
Copy link
Collaborator

@zakkak zakkak commented Dec 8, 2023

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!

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
    • Step: Build with Maven
      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]
* [Q main M 22 latest / Q IT Security3](https://github.com/graalvm/mandrel/actions/runs/7108970473/job/19353698616)
  * Step: Build with Maven
    Filtered Logs:\n```
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
    • Step: Build with Maven
      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]
* [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:\n```
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

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 8, 2023
@zakkak zakkak force-pushed the 2023-12-05-better-comments-from-bot branch 3 times, most recently from f0fff36 to c967c43 Compare December 8, 2023 19:48
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 zakkak force-pushed the 2023-12-05-better-comments-from-bot branch from c967c43 to a041a02 Compare December 8, 2023 23:45
@zakkak zakkak merged commit 99bcf75 into graalvm:default Dec 8, 2023
9 checks passed
@zakkak zakkak deleted the 2023-12-05-better-comments-from-bot branch December 8, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant