Skip to content

Move ranking_watcher from chombot-kcc to chombot-common and add to chombot#293

Open
Copilot wants to merge 6 commits intomasterfrom
copilot/move-ranking-watcher-to-chombot
Open

Move ranking_watcher from chombot-kcc to chombot-common and add to chombot#293
Copilot wants to merge 6 commits intomasterfrom
copilot/move-ranking-watcher-to-chombot

Conversation

Copy link

Copilot AI commented Jan 13, 2026

The ranking_watcher feature does not require KCC-specific integration and should be available to all chombot implementations as shared functionality.

Changes

  • Moved ranking_watcher module from chombot-kcc/src/ to chombot-common/src/ with all submodules (usma, notifier) and test data
  • Updated chombot-common/src/lib.rs to export the ranking_watcher module
  • Updated chombot-kcc/src/main.rs to import ranking_watcher from the chombot-common library crate
  • Fixed imports in ranking_watcher files to use crate:: instead of chombot_common:: for internal references
  • Configured workspace dependencies using workspace = true pattern for all three crates (chombot-common, chombot, chombot-kcc)
  • Removed chombot dependency from chombot-kcc as it's no longer needed
  • Added ranking_watcher functionality to chombot:
    • Added feature_ranking_watcher CLI flag to enable the feature
    • Added ranking_watcher_channel_id config field to GuildConfig for per-guild configuration
    • Implemented RankingWatcherChannelListProvider trait with support for multiple guilds
    • Integrated ranking_watcher into chombot's setup function with the same pattern as tournaments_watcher
    • Updated tests to include the new config field

Usage

// In chombot-kcc or any other implementation
use chombot_common::ranking_watcher::notifier::ChannelMessageNotifier;
use chombot_common::ranking_watcher::usma::get_ranking;

Chombot Configuration

Enable ranking watcher in chombot by setting the --feature-ranking-watcher flag and configuring ranking_watcher_channel_id in your guild config:

[guilds.123456789]
ranking_watcher_channel_id = 987654321
tournaments_watcher_channel_id = 111222333

Testing

  • ✅ All workspace tests pass (11 total tests across all crates)
  • ✅ ranking_watcher tests pass in chombot-common (2 tests)
  • ✅ Build succeeds for entire workspace
  • ✅ No compilation errors
  • ✅ Code formatted with nightly rustfmt

The feature is now properly located in the shared common library where it can be used by any chombot implementation, and is fully integrated into the chombot binary.

Original prompt

The ranking_watcher feature in chombot-kcc does not require kcc integration, so it should be moved to chombot crate to be useful outside chombo. Please move that feature and ensure everything still works.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 13, 2026 11:45
Co-authored-by: seqre <44679055+seqre@users.noreply.github.com>
Co-authored-by: seqre <44679055+seqre@users.noreply.github.com>
Copilot AI changed the title [WIP] Move ranking watcher feature to chombot crate Move ranking_watcher from chombot-kcc to chombot crate Jan 13, 2026
Copilot AI requested a review from seqre January 13, 2026 11:47
@seqre
Copy link
Contributor

seqre commented Jan 13, 2026

@copilot Add all 3 crates into workspace as dependencies, eg. chombot = { version = "0.1.0", path = "chombot" } and then in the crates itself use chombot.workspace = true. See if it compiles then, if not, stop proceeding and let me know.

Co-authored-by: seqre <44679055+seqre@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 13, 2026

@copilot Add all 3 crates into workspace as dependencies, eg. chombot = { version = "0.1.0", path = "chombot" } and then in the crates itself use chombot.workspace = true. See if it compiles then,...

Updated in commit 5118626. The workspace dependencies are now configured as suggested, but it still fails to compile with the same error - chombot-kcc cannot find ranking_watcher in the chombot crate. The module is exported in chombot/src/lib.rs as pub mod ranking_watcher; but cargo still can't resolve it.

@seqre
Copy link
Contributor

seqre commented Jan 13, 2026

@copilot Great, but actually, please move this feature to chombot-common, it's better suited for this shared functionality.

Co-authored-by: seqre <44679055+seqre@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 13, 2026

@copilot Great, but actually, please move this feature to chombot-common, it's better suited for this shared functionality.

Done in commit 76e66dc. The ranking_watcher module has been moved to chombot-common and all tests pass. The chombot crate no longer has a lib.rs since it was only created for exposing ranking_watcher.

Copilot AI changed the title Move ranking_watcher from chombot-kcc to chombot crate Move ranking_watcher from chombot-kcc to chombot-common crate Jan 13, 2026
@seqre seqre marked this pull request as ready for review January 13, 2026 12:14
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 13.79310% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.66%. Comparing base (9e952df) to head (ab15521).

Files with missing lines Patch % Lines
chombot/src/main.rs 0.00% 21 Missing ⚠️
chombot/src/config.rs 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #293      +/-   ##
==========================================
- Coverage   43.27%   42.66%   -0.62%     
==========================================
  Files          21       21              
  Lines        1368     1397      +29     
==========================================
+ Hits          592      596       +4     
- Misses        776      801      +25     
Flag Coverage Δ
rust 42.66% <13.79%> (-0.62%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@seqre
Copy link
Contributor

seqre commented Jan 13, 2026

@copilot Very well. Now with that done, please add the functionality of ranking watcher to chombot in similar fashion to how it's implemented in chombot-kcc. At the end, make sure to run rustfmt (with nightly toolchain) to ensure that formatting checks pass.

Co-authored-by: seqre <44679055+seqre@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 13, 2026

@copilot Very well. Now with that done, please add the functionality of ranking watcher to chombot in similar fashion to how it's implemented in chombot-kcc. At the end, make sure to run rustfmt (with...

Done in commit ab15521. Added ranking_watcher functionality to chombot with:

  • feature_ranking_watcher CLI flag to enable the feature
  • ranking_watcher_channel_id config field per guild in the TOML config
  • Support for multiple guilds via the RankingWatcherChannelListProvider trait pattern
  • All tests pass and code is formatted with nightly rustfmt

Copilot AI changed the title Move ranking_watcher from chombot-kcc to chombot-common crate Move ranking_watcher from chombot-kcc to chombot-common and add to chombot Jan 13, 2026
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