Skip to content

Commit

Permalink
2.2.10 (#624)
Browse files Browse the repository at this point in the history
* chore(deps): bump org.apache.logging.log4j:log4j-slf4j2-impl (#614)

Bumps org.apache.logging.log4j:log4j-slf4j2-impl from 2.20.0 to 2.21.0.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-slf4j2-impl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump org.apache.logging.log4j:log4j-core (#615)

Bumps org.apache.logging.log4j:log4j-core from 2.20.0 to 2.21.0.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thomas <1688389+Rakambda@users.noreply.github.com>

* 🔄 synced file(s) with RakambdaOrg/rakambda-github-files (#616)

Co-authored-by: undefined <zerderr@gmail.com>

* chore(deps): bump com.codeborne:selenide from 6.19.0 to 6.19.1 (#617)

Bumps [com.codeborne:selenide](https://github.com/selenide/selenide) from 6.19.0 to 6.19.1.
- [Release notes](https://github.com/selenide/selenide/releases)
- [Changelog](https://github.com/selenide/selenide/blob/main/CHANGELOG.md)
- [Commits](selenide/selenide@v6.19.0...v6.19.1)

---
updated-dependencies:
- dependency-name: com.codeborne:selenide
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump org.xerial:sqlite-jdbc from 3.43.2.0 to 3.43.2.1 (#618)

Bumps [org.xerial:sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) from 3.43.2.0 to 3.43.2.1.
- [Release notes](https://github.com/xerial/sqlite-jdbc/releases)
- [Changelog](https://github.com/xerial/sqlite-jdbc/blob/master/CHANGELOG)
- [Commits](xerial/sqlite-jdbc@3.43.2.0...3.43.2.1)

---
updated-dependencies:
- dependency-name: org.xerial:sqlite-jdbc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump org.springframework.boot from 3.1.4 to 3.1.5 (#619)

Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.1.4...v3.1.5)

---
updated-dependencies:
- dependency-name: org.springframework.boot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix: Send more data to MinuteWatched to make drops progress & Unrecognized field "count_by_md" (#622)

* Fix: send more data to minute watched event

See: rdavydov/Twitch-Channel-Points-Miner-v2#378

* tests

* Refactor

* Fix for #623

* Bump version

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thomas <thomas.couchoud@prestataire.sihm.fr>
  • Loading branch information
3 people committed Oct 23, 2023
1 parent 6dbcd7e commit 4b4f933
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ updates:
timezone: "Europe/Paris"
pull-request-branch-name:
separator: "-"
groups:
log4j:
patterns:
- "org.apache.logging.log4j:log4j-core"
- "org.apache.logging.log4j:log4j-slf4j2-impl"
# Disable while paths can't be ignored as it'd update all 'auto-approve-sync-files.yml', Renovate will handle exclusion
# - package-ecosystem: "github-actions"
# directory: "/"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2.2.9
version=2.2.10
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
slf4j-version = "2.0.9"
log4j2-version = "2.20.0"
log4j2-slf4j-version = "2.20.0"
log4j2-version = "2.21.0"
log4j2-slf4j-version = "2.21.0"
unirest-version = "4.1.0"
picocli-version = "4.7.5"
jackson-version = "2.15.3"
Expand All @@ -20,19 +20,19 @@ json-unit-version = "3.2.2"
kitteh-irc-version = "8.0.0"
hikari-cp-version = "5.0.1"
mariadb-version = "3.2.0"
sqlite-version = "3.43.2.0"
sqlite-version = "3.43.2.1"
mysql-version = "8.1.0"
rerunner-jupiter-version = "2.1.6"
flyway-version = "9.22.3"
selenide-version = "6.19.0"
selenide-version = "6.19.1"
lombok-version = "1.18.30"
jacocoVersion = "0.8.10"

shadow-version = "8.1.1"
names-version = "0.49.0"
jib-version = "3.4.0"
git-properties-version = "2.4.1"
springboot-version = "3.1.4"
springboot-version = "3.1.5"
springboot-dependencies-version = "1.1.3"
test-logger-version = "4.0.0"
git-version-plugin-version = "3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,26 @@
@Builder
@EqualsAndHashCode
public class MinuteWatchedProperties{
@JsonProperty("channel_id")
@NotNull
private String channelId;
@JsonProperty("broadcast_id")
@NotNull
private String broadcastId;
@JsonProperty("channel")
@NotNull
private String channel;
@JsonProperty("channel_id")
@NotNull
private String channelId;
@JsonProperty("game")
@Nullable
private String game;
@JsonProperty("game_id")
@Nullable
private String gameId;
@JsonProperty("live")
private boolean live;
@JsonProperty("player")
@NotNull
private String player;
@JsonProperty("user_id")
private int userId;
@JsonProperty("game")
@Nullable
private String game;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import fr.rakambda.channelpointsminer.miner.util.json.ISO8601ZonedDateTimeDeserializer;
import fr.rakambda.channelpointsminer.miner.util.json.UnknownDeserializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
Expand All @@ -29,4 +30,8 @@ public class Summary{
@JsonDeserialize(using = ISO8601ZonedDateTimeDeserializer.class)
@Nullable
private ZonedDateTime lastSeen;
@JsonProperty("count_by_md")
@Nullable
@JsonDeserialize(using = UnknownDeserializer.class)
private Object countByMd;
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ public void start(){
scheduledExecutor.schedule(streamerConfigurationReload, 0, MINUTES);
}

listenTopic(COMMUNITY_POINTS_USER_V1, getTwitchLogin().fetchUserId(gqlApi));
listenTopic(USER_DROP_EVENTS, getTwitchLogin().fetchUserId(gqlApi));
listenTopic(ONSITE_NOTIFICATIONS, getTwitchLogin().fetchUserId(gqlApi));
var connectedUserId = getTwitchLogin().fetchUserId(gqlApi);
listenTopic(COMMUNITY_POINTS_USER_V1, connectedUserId);
listenTopic(USER_DROP_EVENTS, connectedUserId);
listenTopic(ONSITE_NOTIFICATIONS, connectedUserId);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ private boolean send(Streamer streamer){
var request = MinuteWatchedEvent.builder()
.properties(MinuteWatchedProperties.builder()
.channelId(streamer.getId())
.channel(streamer.getUsername())
.broadcastId(streamId.get())
.player(SITE_PLAYER)
.userId(miner.getTwitchLogin().getUserIdAsInt(miner.getGqlApi()))
.gameId(streamer.getGame().map(Game::getId).orElse(null))
.game(streamer.getGame().map(Game::getName).orElse(null))
.live(true)
.build())
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public String deserialize(@NotNull JsonParser jsonParser, @NotNull Deserializati
var currentLocation = jsonParser.getCurrentLocation();
var treeNode = jsonParser.readValueAsTree();
var treeNodeStr = treeNode == null ? null : treeNode.toString();
log.warn("Got actual value for field {} (l:{},c:{}) : {}", jsonParser.getCurrentName(), currentLocation.getLineNr(), currentLocation.getColumnNr(), treeNodeStr);
log.warn("Got actual value for unknown field {} (l:{},c:{}) : {}", jsonParser.getCurrentName(), currentLocation.getLineNr(), currentLocation.getColumnNr(), treeNodeStr);
return treeNodeStr;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ class TwitchApiTest{
private static final int USER_ID = 123456789;
private static final String BROADCAST_ID = "broadcast-id";
private static final String CHANNEL_ID = "channel-id";
private static final String CHANNEL_NAME = "channel-name";
private static final String PLAYER = "player";
private static final String GAME = "game";
private static final String GAME_ID = "game-id";
private static final String STREAMER_URL = "https://google.com/streamer";
private static final String CONFIG_URL = "https://static.twitchcdn.net/config/settings.sq5d4q6s54ds854c84qs.js";
private static final String CONFIG_BODY = "<script src=\"%s\" crossorigin=\"anonymous\"></script>".formatted(CONFIG_URL);
Expand All @@ -56,8 +58,8 @@ void setUp(UnirestMock unirestMock) throws MalformedURLException{

@Test
void sendMinutesWatched(UnirestMock unirest){
var json = "[{\"event\":\"minute-watched\",\"properties\":{\"broadcast_id\":\"%s\",\"channel_id\":\"%s\",\"player\":\"%s\",\"user_id\":%d}}]"
.formatted(BROADCAST_ID, CHANNEL_ID, PLAYER, USER_ID);
var json = "[{\"event\":\"minute-watched\",\"properties\":{\"broadcast_id\":\"%s\",\"channel\":\"%s\",\"channel_id\":\"%s\",\"live\":true,\"player\":\"%s\",\"user_id\":%d}}]"
.formatted(BROADCAST_ID, CHANNEL_NAME, CHANNEL_ID, PLAYER, USER_ID);
var expectedData = new String(Base64.getEncoder().encode(json.getBytes(UTF_8)));

unirest.expect(POST, SPADE_URL)
Expand All @@ -70,7 +72,9 @@ void sendMinutesWatched(UnirestMock unirest){
.userId(USER_ID)
.broadcastId(BROADCAST_ID)
.channelId(CHANNEL_ID)
.channel(CHANNEL_NAME)
.player(PLAYER)
.live(true)
.build())
.build();
assertThat(tested.sendPlayerEvents(spadeUrl, request)).isTrue();
Expand All @@ -80,8 +84,8 @@ void sendMinutesWatched(UnirestMock unirest){

@Test
void sendMinutesWatchedWithGame(UnirestMock unirest){
var json = "[{\"event\":\"minute-watched\",\"properties\":{\"broadcast_id\":\"%s\",\"channel_id\":\"%s\",\"game\":\"%s\",\"player\":\"%s\",\"user_id\":%d}}]"
.formatted(BROADCAST_ID, CHANNEL_ID, GAME, PLAYER, USER_ID);
var json = "[{\"event\":\"minute-watched\",\"properties\":{\"broadcast_id\":\"%s\",\"channel\":\"%s\",\"channel_id\":\"%s\",\"game\":\"%s\",\"game_id\":\"%s\",\"live\":true,\"player\":\"%s\",\"user_id\":%d}}]"
.formatted(BROADCAST_ID, CHANNEL_NAME, CHANNEL_ID, GAME, GAME_ID, PLAYER, USER_ID);
var expectedData = new String(Base64.getEncoder().encode(json.getBytes(UTF_8)));

unirest.expect(POST, SPADE_URL)
Expand All @@ -93,9 +97,12 @@ void sendMinutesWatchedWithGame(UnirestMock unirest){
.properties(MinuteWatchedProperties.builder()
.userId(USER_ID)
.broadcastId(BROADCAST_ID)
.channelId(CHANNEL_ID)
.player(PLAYER)
.channelId(CHANNEL_ID)
.channel(CHANNEL_NAME)
.player(PLAYER)
.game(GAME)
.gameId(GAME_ID)
.live(true)
.build())
.build();
assertThat(tested.sendPlayerEvents(spadeUrl, request)).isTrue();
Expand All @@ -105,8 +112,8 @@ void sendMinutesWatchedWithGame(UnirestMock unirest){

@Test
void sendMinutesWatchedNotSuccess(UnirestMock unirest){
var json = "[{\"event\":\"minute-watched\",\"properties\":{\"broadcast_id\":\"%s\",\"channel_id\":\"%s\",\"player\":\"%s\",\"user_id\":%d}}]"
.formatted(BROADCAST_ID, CHANNEL_ID, PLAYER, USER_ID);
var json = "[{\"event\":\"minute-watched\",\"properties\":{\"broadcast_id\":\"%s\",\"channel\":\"%s\",\"channel_id\":\"%s\",\"live\":true,\"player\":\"%s\",\"user_id\":%d}}]"
.formatted(BROADCAST_ID, CHANNEL_NAME, CHANNEL_ID, PLAYER, USER_ID);
var expectedData = new String(Base64.getEncoder().encode(json.getBytes(UTF_8)));

unirest.expect(POST, SPADE_URL)
Expand All @@ -119,7 +126,9 @@ void sendMinutesWatchedNotSuccess(UnirestMock unirest){
.userId(USER_ID)
.broadcastId(BROADCAST_ID)
.channelId(CHANNEL_ID)
.channel(CHANNEL_NAME)
.player(PLAYER)
.live(true)
.build())
.build();
assertThat(tested.sendPlayerEvents(spadeUrl, request)).isFalse();
Expand All @@ -139,7 +148,9 @@ void sendMinutesWatchedJsonError(){
.userId(USER_ID)
.broadcastId(BROADCAST_ID)
.channelId(CHANNEL_ID)
.channel(CHANNEL_NAME)
.player(PLAYER)
.live(true)
.build())
.build();
assertThat(tested.sendPlayerEvents(spadeUrl, request)).isFalse();
Expand Down
Loading

0 comments on commit 4b4f933

Please sign in to comment.