Add Wargaming.net plugin#87
Conversation
New low-code plugin covering World of Tanks, World of Warships and World of Warplanes via the Wargaming.net Public API, from a single datasource. - Object types: Player and Clan (cross-game), plus WoT Vehicle, WoWs Ship and WoWp Aircraft encyclopedias - 14 data streams: per-game player summaries, per-vehicle/ship stats, clan summary + members, encyclopedias, and nickname search - OOB dashboards: overview, per-game Player perspective, and Clan/Vehicle/ Ship/Aircraft perspectives - Multi-host: baseUrl is the scheme only (https://) with each stream's full host in endpointPath, so all three games work from one datasource - WoWs ship encyclopedia paginates (100/page); imported via one step per page Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds a complete Wargaming.net v1 plugin with metadata, UI configuration, authentication validation, custom types and scopes, player, clan, and encyclopedia data streams, response-processing scripts, index definitions, default dashboards, and documentation. ChangesWargaming.net v1 Plugin
Sequence Diagram(s)sequenceDiagram
participant Dashboard
participant DataStream
participant WargamingAPI
participant PostRequestScript
Dashboard->>DataStream: Request scoped player, clan, or encyclopedia data
DataStream->>WargamingAPI: Send authenticated HTTP GET
WargamingAPI-->>PostRequestScript: Return API payload
PostRequestScript->>DataStream: Normalize rows and calculate metrics
DataStream-->>Dashboard: Render stream results
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/Wargaming.net/v1/dataStreams/clanInfo.json`:
- Around line 7-19: The clanInfo stream is missing error mapping, so Wargaming
HTTP-200 error payloads can be treated as empty results. Update the clanInfo
data stream config to add an errorHandling section for the wgn/clans/info
endpoint, following the same pattern used by other Wargaming streams that
inspect clan_id responses. Make sure the new handling routes API error payloads
to a proper stream error instead of returning an empty set.
In `@plugins/Wargaming.net/v1/dataStreams/playerShipStats.json`:
- Around line 10-16: The getArgs in playerShipStats is requesting
last_battle_time even though playerShipStats.js does not use or surface it.
Either remove last_battle_time from the fields list in playerShipStats.json, or
update the playerShipStats.js metadata-building path to expose it as a “Last
Battle” date using the plugin’s existing epoch-to-ISO conversion pattern; use
the playerShipStats/getArgs and playerShipStats.js metadata symbols to locate
the change.
In `@plugins/Wargaming.net/v1/dataStreams/scripts/playerShipStats.js`:
- Around line 4-13: In playerShipStats.js, the result mapping in the ship stats
transform reads p.wins and p.damage_dealt directly while other fields use
defaults, so winRate and avgDamage can become NaN when those subfields are
missing. Update the mapping inside the arr.map callback to apply the same
fallback pattern used for battles/frags, using the existing pvp object and
battles guard to compute winRate and avgDamage safely even when wins or
damage_dealt are absent.
In `@plugins/Wargaming.net/v1/dataStreams/scripts/playerVehicleStats.js`:
- Around line 4-17: The playerVehicleStats mapping has inconsistent default
handling because winRate and avgDamage read raw s.wins and s.damage_dealt while
wins is already normalized, and the wins field itself is not part of the
expected metadata. Update the transformation in playerVehicleStats.js so the
computed values all use the same normalized defaults from the same source
object, and remove the unused wins property if it is not declared in
playerVehicleStats.json metadata. Keep the logic centered around the arr.map
callback and the s/battles calculations.
In `@plugins/Wargaming.net/v1/indexDefinitions/default.json`:
- Around line 36-156: The ships_p1 through ships_p11 index definitions hardcode
a fixed WoWs encyclopedia page count, which will miss any ships beyond the
current last page. Update the Wargaming.net v1 default index setup so the page
count is derived dynamically from the API or generated by iterating until no
more results are returned, and make the change in the
shipsEncyclopedia/page-based index definition block rather than keeping a static
list of pages.
In `@plugins/Wargaming.net/v1/metadata.json`:
- Around line 2-3: The metadata entry has a naming mismatch between the plugin
identifier and its display name; update the `name` field in `metadata.json` to a
lowercase kebab-style value that matches `displayName`’s kebab form, and keep
the `displayName` as-is. Use the `name` and `displayName` fields in
`metadata.json` for the Wargaming plugin to make the identifiers consistent.
In `@plugins/Wargaming.net/v1/ui.json`:
- Line 6: The `applicationId` help text in `ui.json` has a broken markdown link
because the `developers.wargaming.net/applications/` href is missing the
`https://` scheme. Update the help string so the link target is an absolute URL
while keeping the existing link text and surrounding wording intact, using the
`applicationId` help entry as the locator.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 285a2344-123b-4265-9184-ea65c9bf88ed
⛔ Files ignored due to path filters (1)
plugins/Wargaming.net/v1/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (40)
plugins/Wargaming.net/v1/configValidation.jsonplugins/Wargaming.net/v1/custom_types.jsonplugins/Wargaming.net/v1/dataStreams/accountInfo.jsonplugins/Wargaming.net/v1/dataStreams/clanInfo.jsonplugins/Wargaming.net/v1/dataStreams/clanMembers.jsonplugins/Wargaming.net/v1/dataStreams/clanSummary.jsonplugins/Wargaming.net/v1/dataStreams/encyclopediaInfo.jsonplugins/Wargaming.net/v1/dataStreams/encyclopediaVehicles.jsonplugins/Wargaming.net/v1/dataStreams/planesEncyclopedia.jsonplugins/Wargaming.net/v1/dataStreams/playerSearch.jsonplugins/Wargaming.net/v1/dataStreams/playerShipStats.jsonplugins/Wargaming.net/v1/dataStreams/playerSummary.jsonplugins/Wargaming.net/v1/dataStreams/playerVehicleStats.jsonplugins/Wargaming.net/v1/dataStreams/playerWarplanesSummary.jsonplugins/Wargaming.net/v1/dataStreams/playerWarshipsSummary.jsonplugins/Wargaming.net/v1/dataStreams/scripts/accountInfo.jsplugins/Wargaming.net/v1/dataStreams/scripts/clanInfo.jsplugins/Wargaming.net/v1/dataStreams/scripts/clanMembers.jsplugins/Wargaming.net/v1/dataStreams/scripts/clanSummary.jsplugins/Wargaming.net/v1/dataStreams/scripts/encyclopediaVehicles.jsplugins/Wargaming.net/v1/dataStreams/scripts/planesEncyclopedia.jsplugins/Wargaming.net/v1/dataStreams/scripts/playerShipStats.jsplugins/Wargaming.net/v1/dataStreams/scripts/playerSummary.jsplugins/Wargaming.net/v1/dataStreams/scripts/playerVehicleStats.jsplugins/Wargaming.net/v1/dataStreams/scripts/playerWarplanesSummary.jsplugins/Wargaming.net/v1/dataStreams/scripts/playerWarshipsSummary.jsplugins/Wargaming.net/v1/dataStreams/scripts/shipsEncyclopedia.jsplugins/Wargaming.net/v1/dataStreams/shipsEncyclopedia.jsonplugins/Wargaming.net/v1/defaultContent/aircraft.dash.jsonplugins/Wargaming.net/v1/defaultContent/clan.dash.jsonplugins/Wargaming.net/v1/defaultContent/manifest.jsonplugins/Wargaming.net/v1/defaultContent/overview.dash.jsonplugins/Wargaming.net/v1/defaultContent/player.dash.jsonplugins/Wargaming.net/v1/defaultContent/scopes.jsonplugins/Wargaming.net/v1/defaultContent/ship.dash.jsonplugins/Wargaming.net/v1/defaultContent/vehicle.dash.jsonplugins/Wargaming.net/v1/docs/README.mdplugins/Wargaming.net/v1/indexDefinitions/default.jsonplugins/Wargaming.net/v1/metadata.jsonplugins/Wargaming.net/v1/ui.json
- clanInfo: add errorHandling for HTTP-200 error payloads, matching the pattern used by every other stream on this endpoint family - ui.json: fix inverted markdown link (URL was in the label, not the href) - playerShipStats/playerVehicleStats scripts: default wins/damage_dealt before dividing, matching the existing battles/frags fallback pattern; drop the unused computed `wins` field from playerVehicleStats (dead output, not declared in its stream metadata) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replaces the 11 hardcoded ships_p1..p11 index steps with a single "ships" step that drives its own pagination via a postRequestScript pagingContext override, since the platform's built-in offset/token paging can't count rows in the API's keyed-object response body. Stops on any of: a short page (count !== limit), the total already covered (page * limit >= total, guarding the case where the real total is an exact multiple of the page size), or the API's own PAGE_NO_NOT_FOUND error past the last page. No longer silently caps out at 1,100 ships if Wargaming's catalog grows. Verified against a real import: 983/983 ships received and written, no overshoot, no stray objects. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The field was already requested from the API but never exposed, per CodeRabbit review feedback on #87. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🧩 Plugin PR Summary📦 Modified Plugins
📋 Results
🔍 Validation Details✅
|
Summary
New low-code plugin for the Wargaming.net Public API, covering World of Tanks, World of Warships, and World of Warplanes from a single datasource. A Wargaming account is shared across all three games, so one tracked Player surfaces tank, ship, and aircraft stats side by side.
What's included
Player,Clan(cross-game), plusWoT Vehicle,WoWs Ship,WoWp Aircraftencyclopedias.playerSummary,playerWarshipsSummary,playerWarplanesSummary), per-vehicle/ship stats (playerVehicleStats,playerShipStats),clanSummary+clanMembers, the three encyclopedias,accountInfo/clanInfo(import),encyclopediaInfo(config validation), andplayerSearch.configValidationprobes the API on setup.Design notes
baseUrlis the scheme only (https://); each stream carries its full host inendpointPath(api.worldof<game>.{{dataSource.realm}}/...), so all three games work from one datasource.errorHandlingonerror.message), object-keyeddataflattened in scripts, epoch-seconds → ISO dates, config fields referenced as{{dataSource.*}}.Testing
All 14 data streams were tested live against an authenticated datasource (EU realm) — correct per-game host and real data for each. Import verified: WoWs Ship 983, WoWp Aircraft 332, WoT Vehicle 1000, plus tracked Player/Clan.
squaredup validatepasses.Notes / limitations
x-api-deprecatedby Wargaming — still functional.🤖 Generated with Claude Code
Summary by CodeRabbit