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

Issue 24 #201

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Fields to fill in:
- Go to [smee.io](https://smee.io/) and press `Start a new channel`
- Add this link to `Webhook URL`
4. Set up permissions
- `Actions` - `Access: Read and write`
- `Commit statuses` - `Access: Read and write`
- `Contents` - `Access Read-only`
- `Metadata` - `Access: Read-only`
Expand All @@ -49,6 +50,7 @@ Fields to fill in:
- `Pull requests`
- `Pull request review`
- `Pull request review comment`
- `Workflow run`
6. Create a private key

After creating the app scroll down and press `Generate a private key`
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<artifactId>wildfly-github-app</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<build-reporter.version>3.7.0</build-reporter.version>
<compiler-plugin.version>3.11.0</compiler-plugin.version>
<failsafe.useModulePath>false</failsafe.useModulePath>
<glob.version>0.9.0</glob.version>
Expand Down Expand Up @@ -56,6 +57,11 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus.bot</groupId>
<artifactId>build-reporter-github-actions</artifactId>
<version>${build-reporter.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/org/wildfly/bot/AnalyzeWorkflowResults.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.wildfly.bot;

import io.quarkiverse.githubapp.ConfigFile;
import io.quarkiverse.githubapp.event.WorkflowRun;
import io.quarkus.bot.buildreporter.githubactions.BuildReporterConfig;
import io.quarkus.bot.buildreporter.githubactions.BuildReporterEventHandler;
import io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClient;
import jakarta.inject.Inject;
import org.kohsuke.github.GHEventPayload;
import org.kohsuke.github.GitHub;
import org.wildfly.bot.config.WildFlyBotConfig;
import org.wildfly.bot.model.WildFlyConfigFile;

import java.io.IOException;
import java.util.Set;

import static org.wildfly.bot.model.RuntimeConstants.CONFIG_FILE_NAME;

public class AnalyzeWorkflowResults {
@Inject
BuildReporterEventHandler buildReporterEventHandler;

@Inject
WildFlyBotConfig wildFlyBotConfig;

void analyzeWorkflowResults(@WorkflowRun.Completed @WorkflowRun.Requested GHEventPayload.WorkflowRun workflowRunPayload,
@ConfigFile(CONFIG_FILE_NAME) WildFlyConfigFile wildFlyConfigFile,
GitHub gitHub, DynamicGraphQLClient gitHubGraphQLClient) throws IOException {
BuildReporterConfig buildReporterConfig = BuildReporterConfig.builder()
.dryRun(wildFlyBotConfig.isDryRun())
.workflowJobComparator((o1, o2) -> {
return 0;
})
.monitoredWorkflows(Set.of("Java CI with Maven"))
.build();

buildReporterEventHandler.handle(workflowRunPayload, buildReporterConfig, gitHub, gitHubGraphQLClient);
}
}
2 changes: 2 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ quarkus.openshift.resources.requests.memory=200Mi
quarkus.openshift.resources.limits.cpu=200m
quarkus.openshift.resources.limits.memory=250Mi

quarkus.qute.suffixes=md
quarkus.qute.content-types."md"=text/markdown

%test.quarkus.github-app.app-id=0
%test.quarkus.github-app.private-key=-----BEGIN RSA PRIVATE KEY-----\
Expand Down
Loading