Skip to content

Warn when enabled top-voter awards lack leaderboard loading - #1780

Merged
BenCodez merged 5 commits into
masterfrom
fix/top-voter-award-loading-warning
Nov 28, 2026
Merged

BenCodez merged 5 commits into
masterfrom
fix/top-voter-award-loading-warning

Conversation

@BenCodez

@BenCodez BenCodez commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Warn at startup and reload when enabled monthly, weekly, or daily top-voter awards have configured rewards and the matching leaderboard is disabled.
  • Identify the affected award period and exact LoadTopVoter key. Keep shipped defaults quiet and existing configuration intact. Monthly awards using dated totals already compute their own rankings and stay quiet.

Verification

  • mvn -B -o -f VotingPlugin/pom.xml -Dtest=TopVoterAwardConfigHealthTest test
  • mvn -B -f VotingPlugin/pom.xml clean package

The focused tests exercise the three periods, inline and named rewards, missing or empty rewards, enabled leaderboard loading, the packaged defaults, monthly awards using dated totals, and the precedence of overlapping award ranks, including entries with empty reward names.

Summary by CodeRabbit

  • Bug Fixes
    • Startup and reload checks now report when enabled daily, weekly, or monthly awards have configured rewards but their voter rankings are unavailable.
    • Checks account for unreadable configuration files and skip monthly award warnings when month-date totals are used.
    • Reward checks now handle different reward formats and ignore invalid or fully covered rank ranges.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The health check now includes main and special-rewards config read failures and checks enabled top-voter awards when their rankings are not loaded. It warns when an uncovered rank has configured rewards. Tests cover warning and no-warning conditions.

Changes: Top-voter award health checks

Layer / File(s) Summary
Reward detection and rank coverage
VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java, VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java
Reward values and rank ranges determine whether an uncovered rank has configured rewards. Tests cover warning cases, invalid ranks, and ranges covered by later entries.
Configuration checks and award gating
VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java, VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java
The check combines config read failures and gates award checks based on config availability, enabled periods, loaded rankings, and monthly total settings. Tests cover these conditions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: Minimal · up to 9b6a8

This change adds a startup and reload warning when top-voter awards are configured but leaderboard loading is disabled. It does not alter award behavior or existing configuration, and no concrete merge risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Warn when enabled top-voter awards lack leaderboard loading" matches the main change. The raw summary shows VotingPluginConfigHealth.check() now warns when monthly, weekly, or daily top-vot…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Warn when enabled top-voter awards lack leaderboard loading" matches the main change. The raw summary shows VotingPluginConfigHealth.check() now warns when monthly, weekly, or daily top-voter awards have configured rewards but the matching LoadTopVoter leaderboard is not loaded. The new TopVoterAwardConfigHealthTest checks the same warning cases. The title is specific, concise, and has no file list, emoji, or vague wording. It does not mention the rank-precedence logic or the monthly dated-totals exclusion, but it does not need to cover every detail.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d235f697-98de-48d7-b007-4d7a46be3512
Commits

Reviewing files that changed from the base of the PR and between d9d6456 and 9b6a864.

Files selected for processing: 2

  • VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java
  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Recent review details

Context from checks skipped due to timeout: 3

  • GitHub Check: build
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (java-kotlin)
Additional context used

Code guidelines: 1

AGENTS.md — auto-discovered
Path-based instructions: 1

Source excerpt: All Java project tests and test-only helpers belong under `VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/`, with package `com.bencodez.votingplugin.tests` or a meaningful subpackage.

CodeRabbit inference engine (AGENTS.md)

Files:

  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java
Learnings: 2

Learning: 2026-11-16T03:12:12.291Z

Learnt from: CR
Repo: BenCodez/VotingPlugin PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-11-16T03:12:12.291Z
Learning: Source excerpt:
# Maintainer and AI-agent guide

## Build and verification

All Java project tests and test-only helpers belong under `VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/`, with package `com.bencodez.votingplugin.tests` or a meaningful subpackage. Keep paths and package declarations aligned, and update cross-test imports, resources, and build selectors when moving tests. Preserve package-phase artifact checks and test discovery. Do not widen production APIs to make tests accessible; use narrowly scoped test-only reflection for non-public seams. Platform API fixtures that must retain an external runtime class identity (such as `net.minecraft.network.chat.Component`) stay in that platform package and must not contain test cases.

Applied to files:

  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java
Learning: 2026-11-16T03:12:12.291Z

Learnt from: CR
Repo: BenCodez/VotingPlugin PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-11-16T03:12:12.291Z
Learning: Applies to VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/** : Source excerpt:
# Maintainer and AI-agent guide

## Build and verification

All Java project tests and test-only helpers belong under `VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/`, with package `com.bencodez.votingplugin.tests` or a meaningful subpackage. Keep paths and package declarations aligned, and update cross-test imports, resources, and build selectors when moving tests. Preserve package-phase artifact checks and test discovery. Do not widen production APIs to make tests accessible; use narrowly scoped test-only reflection for non-public seams. Platform API fixtures that must retain an external runtime class identity (such as `net.minecraft.network.chat.Component`) stay in that platform package and must not contain test cases.

Applied to files:

  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/topvoter/TopVoterAwardConfigHealthTest.java
Additional comments: 1

VotingPlugin/src/main/java/com/bencodez/votingplugin/config/VotingPluginConfigHealth.java: 1

76-77: Functional Correctness

The coverage merge preserves later-entry precedence. A rank that a later reward-free entry overwrites does not receive the earlier reward, so skipping it is correct. A rewarded rank that no later entry covers still triggers the warning, including for partial coverage, adjacent ranges, and gaps. The inspected code does not hide a rank that still has an effective configured reward.

@BenCodez
BenCodez marked this pull request as ready for review November 28, 2026 00:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T00:09:29.673467Z 9b6a864 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-28T00:09:55.082002Z 9b6a864 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@BenCodez
BenCodez merged commit 1fb9bf5 into master Nov 28, 2026
6 checks passed
@BenCodez
BenCodez deleted the fix/top-voter-award-loading-warning branch November 28, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants