Skip to content

Commit

Permalink
Update to newer quarkus(-github-app) for features
Browse files Browse the repository at this point in the history
We'll need this to be able to use the ConfigFileProvider in the
StalledDiscussionFlow, since the @configfile annotation only seems to
work well for injection into event-listener methods.

The `org.jetbrains:annotations` dependency doesn't get pulled in
implicitly any longer, so I've just switched usage of the @NotNull &&
@nullable annotations from there to the SmallRye equivalents, which
are available.

Something that I'm not 100% sure about is the test changes here: I
guess the Jackson/SnakeYAML handling of null fields changed somewhere
along the way.
  • Loading branch information
grdryn committed Apr 5, 2023
1 parent 7ad587d commit ee93538
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>2.7.5.Final</quarkus.platform.version>
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
<quarkus-github-app.version>1.8.4</quarkus-github-app.version>
<quarkus.platform.version>2.16.6.Final</quarkus.platform.version>
<surefire-plugin.version>3.0.0</surefire-plugin.version>
<quarkus-github-app.version>1.16.0</quarkus-github-app.version>

</properties>
<dependencyManagement>
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/org/bf2/arch/bot/CreateDraftRecordFlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import io.quarkiverse.githubapp.ConfigFile;
import io.quarkiverse.githubapp.event.IssueComment;
import org.bf2.arch.bot.model.record.RecordPage;
import org.bf2.arch.bot.model.record.RecordId;
import org.bf2.arch.bot.model.record.RecordPage;
import org.bf2.arch.bot.model.record.RecordType;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.kohsuke.github.GHBranch;
import org.kohsuke.github.GHCommit;
import org.kohsuke.github.GHContent;
Expand All @@ -32,6 +28,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.quarkiverse.githubapp.ConfigFile;
import io.quarkiverse.githubapp.event.IssueComment;
import io.smallrye.common.constraint.NotNull;
import io.smallrye.common.constraint.Nullable;

/**
* Flow for creating a Draft record (AP, ADR, PADR), and possibly superseding an existing record.
*
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/bf2/arch/bot/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Set;
import java.util.stream.Collectors;

import org.jetbrains.annotations.NotNull;
import org.kohsuke.github.GHIssue;
import org.kohsuke.github.GHLabel;
import org.kohsuke.github.GHPullRequest;
Expand All @@ -30,6 +29,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.smallrye.common.constraint.NotNull;

/**
* Common helper functions
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public void renderTemplateTest() throws IOException {
"- \"me\"\n" +
"tags:\n" +
"- \"bar\"\n" +
"applies_padrs: null\n" +
"applies_patterns: null\n" +
"---\n" +
"Hello, world\n", rendered.toContentString());
}
Expand All @@ -92,6 +94,8 @@ public void renderSupersededTemplateTest() throws IOException {
"- \"me\"\n" +
"tags:\n" +
"- \"bar\"\n" +
"applies_padrs: null\n" +
"applies_patterns: null\n" +
"---\n" +
"Hello, world\n", rendered.toContentString());
}
Expand Down Expand Up @@ -137,4 +141,4 @@ public void testGetPage() throws IOException {

// TODO test supersededContent

}
}

0 comments on commit ee93538

Please sign in to comment.