Skip to content

Conversation

@SlayerOrnstein
Copy link
Member

@SlayerOrnstein SlayerOrnstein commented Oct 2, 2025

What did you fix?

Merges ExportNightwave into sortie rewards to pull in nightwave acts and images


Reproduction steps


Evidence/screenshot/link to line

Considerations

  • Does this contain a new dependency? No
  • Does this introduce opinionated data formatting or manual data entry? Yes
  • Does this pr include updated data files in a separate commit that can be reverted for a clean code-only pr? Yes
  • Have I run the linter? Yes
  • Is is a bug fix, feature request, or enhancement? Feature

Summary by CodeRabbit

  • New Features

    • Added Nightwave Challenge as a new item type for better support.
  • Data Updates

    • Large expansion of Nightwave challenge entries.
    • Added tracking for missing wiki thumbnails.
  • Improvements

    • Improved Nightwave image matching and naming so challenge images resolve more reliably.
    • Sortie/rewards now include Nightwave Challenge items where applicable.

✏️ Tip: You can customize this high-level summary in your review settings.

@SlayerOrnstein SlayerOrnstein requested a review from a team as a code owner October 2, 2025 22:33
@coderabbitai
Copy link

coderabbitai bot commented Oct 2, 2025

Walkthrough

Adds Nightwave Challenge support: new item type, scraper inclusion, parser/build image-name and manifest-lookup adjustments, hash helper refactor, large cache & warning data additions, and TypeScript type updates.

Changes

Cohort / File(s) Summary
Builder image handling
build/build.mjs
For items of type "Nightwave Act", derive a base uniqueName by stripping a 1–3 digit suffix before looking up imageBase in the manifest (changes manifest lookup source for Nightwave Act images).
Parser refactor & Nightwave logic
build/parser.mjs
Introduces hash(str) SHA-256 helper and replaces direct digest usage with calls to hash(). Adds Nightwave-specific image-name construction (strip roman-numeral suffix / trailing digits, encode + hashed suffix) and early-return guards in addDropRate / addPatchlogs for Nightwave Challenge items.
Scraper augmentation
build/scraper.mjs
fetchEndpoint for category SortieRewards now appends all items from raw.ExportNightwave.challenges into the fetched data.
Config & types
config/itemTypes.json, index.d.ts
Adds item type entry {"id": "Challenges/Seasons", "name": "Nightwave Challenge"} and introduces NightwaveChallenge and the literal 'Nightwave Challenge' into the TypeScript discriminated unions.
Cache & warnings data
data/cache/.images.json, data/warnings.json
Appends a large set of Nightwave challenge image cache entries to .images.json. Adds a new top-level missingWikiThumb array field to data/warnings.json.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Scraper
participant Parser
participant Builder
participant Manifest
participant Cache

Scraper->>Parser: return raw data (includes ExportNightwave.challenges)
Parser->>Parser: classify items as 'Nightwave Challenge', generate imageName using hash(nameSterilized)
Parser-->>Builder: emit parsed items with imageName and uniqueName
Builder->>Manifest: lookup imageBase (for Nightwave Act strip trailing digits first)
alt manifest entry found
    Builder->>Cache: save/append image entry
else not found
    Builder->>Cache: fallback/no-op or record missing
end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas to focus during review:

  • Consistency of hash(str) use and .slice(0,10) placements across parser and builder.
  • Nightwave name-sterilization: ensure same stripping rules (roman numerals vs digits) are applied everywhere (parser, builder, manifest lookup).
  • Large .images.json additions: check for duplicates, key collisions, and correct image name formats.
  • data/warnings.json schema change: ensure consumers handle new missingWikiThumb field.
  • Type definitions in index.d.ts: verify shape matches parser output.

Suggested reviewers

  • EricSihaoLin
  • TobiTenno

Poem

🐇 I hopped through code at break of dawn,
Trimmed digits, hashed names, and then was gone.
Nightwave mysteries tucked in cache and file,
I left a carrot-shaped debug smile. 🥕🌙

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: parse nightwave acts' accurately summarizes the main change: adding functionality to parse and process Nightwave acts from the ExportNightwave data source.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@SlayerOrnstein SlayerOrnstein marked this pull request as draft October 2, 2025 23:08
@SlayerOrnstein SlayerOrnstein marked this pull request as ready for review October 2, 2025 23:48
@SlayerOrnstein
Copy link
Member Author

oh whoops, Build check is running into cloudflare

@TobiTenno TobiTenno enabled auto-merge (squash) October 12, 2025 04:36
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
build/build.mjs (1)

237-237: Potential null reference for Nightwave Act items.

For Nightwave Act items, the imageBase lookup at line 229 uses the modified uniqueName (digits stripped), but this line still uses item.uniqueName (original). If the manifest doesn't contain an entry with the original uniqueName, manifest.find(...) returns undefined, and accessing .fileTime throws.

Consider using the modified uniqueName variable consistently, or guard against undefined:

-    const hash = manifest.find((i) => i.uniqueName === item.uniqueName).fileTime || imageHash[1] || undefined;
+    const hash = manifest.find((i) => i.uniqueName === uniqueName)?.fileTime || imageHash[1] || undefined;

Or for clarity, reuse imageBase:

-    const hash = manifest.find((i) => i.uniqueName === item.uniqueName).fileTime || imageHash[1] || undefined;
+    const hash = imageBase.fileTime || imageHash[1] || undefined;
🧹 Nitpick comments (1)
build/parser.mjs (1)

552-552: Consider hoisting the hash helper outside addImageName.

The hash function is recreated on every call to addImageName. While the performance impact is minimal, moving it to module scope (near title at line 27) would avoid redundant function allocations during the parsing loop.

+const hash = (str) => createHash('sha256').update(str).digest('hex');
+
 /**
  * Titlecase a string

Then remove line 552 inside addImageName.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cb531b and 87d66cd.

📒 Files selected for processing (4)
  • build/build.mjs (1 hunks)
  • build/parser.mjs (3 hunks)
  • build/scraper.mjs (2 hunks)
  • config/itemTypes.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
build/scraper.mjs (1)
build/network.mjs (2)
  • getJSON (22-29)
  • getJSON (22-29)
build/build.mjs (2)
build/parser.mjs (2)
  • item (159-159)
  • i (311-311)
build/scraper.mjs (2)
  • manifest (170-170)
  • i (140-140)
build/parser.mjs (1)
build/build.mjs (3)
  • hash (237-237)
  • item (84-84)
  • item (224-224)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (3)
config/itemTypes.json (1)

1060-1064: LGTM!

The new "Nightwave Act" item type entry is correctly structured and appropriately placed at the end of the array. The simple string match on "Challenges/Seasons" will correctly identify Nightwave challenge items.

build/scraper.mjs (2)

96-98: Add a guard for ExportNightwave to prevent runtime errors.

If the API response doesn't include ExportNightwave or challenges, this will throw. Other similar blocks (like line 100 for ExportRailjackWeapons) don't guard either, but Nightwave data may be more volatile.

Verify that ExportNightwave.challenges is always present in the SortieRewards endpoint response. If uncertain, consider adding a defensive check:

   if (category === 'SortieRewards') {
-    data.push(...raw.ExportNightwave.challenges);
+    if (raw.ExportNightwave?.challenges) {
+      data.push(...raw.ExportNightwave.challenges);
+    }
   }

185-188: LGTM!

The data source change to GitHub's raw URL for the WFCD/warframe-drop-data repository is a reasonable alternative to avoid Cloudflare issues with drops.warframestat.us. Both sources are maintained by WFCD.

Was meant to only be my machine to bypass cloudflare while I was testing. Was not supposed to be commited
nightwave stuff might need some changes to how their parsed in pathlogs instead of here
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fef9bf9 and 9252247.

📒 Files selected for processing (3)
  • build/parser.mjs (5 hunks)
  • config/itemTypes.json (1 hunks)
  • index.d.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/itemTypes.json
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-items PR: 778
File: build/parser.mjs:568-574
Timestamp: 2025-11-28T01:41:19.901Z
Learning: In the WFCD/warframe-items repository, for Nightwave Act processing, the regex difference between `build/parser.mjs` (using `/[0-9]{1,3}$/` with anchor) and `build/build.mjs` (using `/[0-9]{1,3}/` without anchor) is intentional and serves different purposes in each file.
📚 Learning: 2025-11-28T01:41:19.901Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-items PR: 778
File: build/parser.mjs:568-574
Timestamp: 2025-11-28T01:41:19.901Z
Learning: In the WFCD/warframe-items repository, for Nightwave Act processing, the regex difference between `build/parser.mjs` (using `/[0-9]{1,3}$/` with anchor) and `build/build.mjs` (using `/[0-9]{1,3}/` without anchor) is intentional and serves different purposes in each file.

Applied to files:

  • build/parser.mjs
📚 Learning: 2024-12-03T23:47:24.677Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-items PR: 663
File: config/masterableCategories.json:1-2
Timestamp: 2024-12-03T23:47:24.677Z
Learning: In the 'warframe-items' repository, when suggesting changes to regex patterns in 'config/masterableCategories.json', ensure that added patterns only include items relevant to the current PR context, and avoid adding items not present in the context.

Applied to files:

  • build/parser.mjs
🪛 GitHub Actions: Pull Request Checks
build/parser.mjs

[error] 758-758: prettier/prettier: Insert ·

🪛 GitHub Check: Lint
build/parser.mjs

[failure] 758-758:
Insert ·


[failure] 848-848:
Expected '===' and instead saw '=='

🔇 Additional comments (6)
index.d.ts (3)

96-97: LGTM!

The NightwaveChallenge type is correctly added to the Item union, enabling proper type discrimination for Nightwave items.


189-192: LGTM!

The NightwaveChallenge interface is well-defined with appropriate fields for challenge tracking (required and standing). It correctly extends MinimalItem, consistent with other specialized item types in the codebase.


854-854: LGTM!

The 'Nightwave Challenge' type literal is correctly added to the Type union, enabling proper type checking for Nightwave items.

build/parser.mjs (3)

552-552: LGTM!

The hash function refactor from precomputed digests to an on-demand functional helper is clean and maintains the same SHA-256 hashing behavior while improving flexibility.


568-574: LGTM!

The Nightwave Challenge special-case logic correctly handles image naming by:

  • Stripping trailing Roman numerals from the display name
  • Sterilizing the uniqueName to group similar challenges
  • Generating a short hash-based identifier for uniqueness

The early return appropriately bypasses standard image-name processing for these items. Based on learnings, the regex pattern used here is intentionally different from other files and serves a specific purpose.


613-613: LGTM!

The hash usage is correctly updated to use the new functional helper, maintaining consistency with the refactored approach.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
build/parser.mjs (1)

552-618: Nightwave imageName hashing and helper extraction look solid; only tiny optional nit

The hash helper and Nightwave-specific imageName logic (Roman numeral stripping + trailing-digit sanitization + 10‑char SHA‑256 suffix) are consistent and should give stable, deduped filenames without interfering with the generic component/relic logic thanks to the early return. If you expect to reuse this hashing elsewhere, you could optionally hoist hash (and even encode) out of addImageName to avoid recreating them per call, but that’s not required. Not re‑raising any regex alignment concerns with build.mjs, since the differing digit‑stripping regexes are already confirmed to be intentional.
Based on learnings, the current regex usage is intentional.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9252247 and a818ab2.

📒 Files selected for processing (1)
  • build/parser.mjs (5 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-items PR: 778
File: build/parser.mjs:568-574
Timestamp: 2025-11-28T01:41:19.901Z
Learning: In the WFCD/warframe-items repository, for Nightwave Act processing, the regex difference between `build/parser.mjs` (using `/[0-9]{1,3}$/` with anchor) and `build/build.mjs` (using `/[0-9]{1,3}/` without anchor) is intentional and serves different purposes in each file.
📚 Learning: 2025-11-28T01:41:19.901Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-items PR: 778
File: build/parser.mjs:568-574
Timestamp: 2025-11-28T01:41:19.901Z
Learning: In the WFCD/warframe-items repository, for Nightwave Act processing, the regex difference between `build/parser.mjs` (using `/[0-9]{1,3}$/` with anchor) and `build/build.mjs` (using `/[0-9]{1,3}/` without anchor) is intentional and serves different purposes in each file.

Applied to files:

  • build/parser.mjs
📚 Learning: 2024-12-03T23:47:24.677Z
Learnt from: SlayerOrnstein
Repo: WFCD/warframe-items PR: 663
File: config/masterableCategories.json:1-2
Timestamp: 2024-12-03T23:47:24.677Z
Learning: In the 'warframe-items' repository, when suggesting changes to regex patterns in 'config/masterableCategories.json', ensure that added patterns only include items relevant to the current PR context, and avoid adding items not present in the context.

Applied to files:

  • build/parser.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (2)
build/parser.mjs (2)

752-812: Nightwave guard in addDropRate matches the feature intent

Early‑returning for item.type === 'Nightwave Challenge' cleanly keeps Nightwave acts out of the general drop‑table machinery and previous‑build migration logic, which aligns with them not being conventional droppable items. No issues here.


846-865: Skipping patchlogs for Nightwave challenges is reasonable

Extending the existing “no patchlogs for components” guard to also cover Nightwave Challenge items avoids unnecessary patchlog lookups for these synthetic tasks and keeps their surface minimal. The condition is clear and low‑risk.

@TobiTenno TobiTenno merged commit 70675c0 into WFCD:master Nov 28, 2025
10 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jan 5, 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