Skip to content

fix(#860): filter out empty strings for endpoints#866

Merged
TobiTenno merged 4 commits intoWFCD:masterfrom
DopiGFX:fix-for-860
Feb 23, 2026
Merged

fix(#860): filter out empty strings for endpoints#866
TobiTenno merged 4 commits intoWFCD:masterfrom
DopiGFX:fix-for-860

Conversation

@DopiGFX
Copy link
Copy Markdown
Contributor

@DopiGFX DopiGFX commented Feb 22, 2026

What did you fix?

closes #860
I think the Issue behavior changed between https://github.com/WFCD/warframe-items/actions/runs/22107055430/job/63892686833 and https://github.com/WFCD/warframe-items/actions/runs/22112879116/job/63913381682

I've looked into it and now it is not caused by a bad control character anymore, but by an empty string getting passed into the endpoint concatenation causing and invalid url


Reproduction steps

Build cannot proceed, because an empty string is passed to the endpoint


Evidence/screenshot/link to line

return decompressed.replace(manifestRegex, '').split(/\r?\n/g);

the .replace results in an empty string which gets passed to the endpoint and results in an invalid url.
I added a .filter to get rid of any empty strings.

Considerations

  • Does this contain a new dependency? No
  • Does this introduce opinionated data formatting or manual data entry? No
  • 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? Bug Fix

Summary by CodeRabbit

  • Bug Fixes

    • Prevented empty/blank endpoint entries from being returned.
    • Fixed typographic error in an item description.
  • Data Updates

    • Increased item counts for Karkina Antenna, Lunar Pitcher, and Sharrac Teeth.
    • Added release dates, wiki links/thumbnails, and other metadata for multiple items.
    • Minor description formatting adjustments.
  • Chores

    • Refreshed cached data hashes and updated CI/build environment targets and install steps.

@DopiGFX DopiGFX requested a review from a team as a code owner February 22, 2026 04:42
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 22, 2026

📝 Walkthrough

Walkthrough

This PR filters empty lines from the scraper's endpoint parsing, refreshes many export cache hashes, updates item metadata and counts in data/json/All.json, adjusts data/warnings.json, updates .nvmrc to a different LTS tag, and changes install/needs behavior in .github/workflows/static.yaml.

Changes

Cohort / File(s) Summary
Scraper
build/scraper.mjs
In fetchEndpoints, when manifest isn't requested, remove empty lines from the decompressed endpoint list after splitting by newline to avoid emitting empty entries.
Cache hashes
data/cache/.export.json
Refreshed many locale-specific export hashes (string replacements only; no key additions/removals).
Item dataset
data/json/All.json
Typo fix (Boar’s→Boar's), increased several itemCount values, added introduced/releaseDate/wiki fields for Primed Ammo Chain, added wikiaThumbnail/URLs for some entries, and minor metadata/description tweaks.
Warnings
data/warnings.json
Replaced/reordered the missingWikiThumb array (semantic no-op).
Environment
.nvmrc
Changed Node LTS pointer from lts/jod to lts/krypton.
CI workflow
.github/workflows/static.yaml
Switched some jobs to use npm ci for installs, removed lint as a prerequisite for build, adjusted test job needs, and left a comment explaining an npm install exception for older Node/npm in the test job.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Scope: Scraper, Scope: Data, Type: Bug, Severity3: Minor

Suggested reviewers

  • SlayerOrnstein

Poem

🐰 I nibbled lines and left the blanks behind,
Polished hashes, counts, and a typo I did find.
Node hopped lanes, workflows tuned, data dressed anew—
A little hop, a tidy fix, from me to you. 🎋

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Multiple unrelated changes present: Node.js version upgrade, workflow modifications, data hash updates, and JSON metadata changes beyond the stated endpoint filtering fix. Separate out-of-scope changes into independent commits: keep endpoint filtering fix isolated, move .nvmrc version change and workflow updates to separate PRs, and address data file updates distinctly.
Linked Issues check ❓ Inconclusive The PR addresses issue #860 by fixing the root cause of invalid endpoints, but the linked issue describes a JSON parsing error rather than the endpoint filtering solution. Verify that filtering empty strings in endpoint construction actually resolves the JSON parsing error reported in #860, as the connection between the fix and the stated problem needs validation.
✅ 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 accurately reflects the main change: filtering empty strings in endpoint processing to fix build failure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 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.

Copy link
Copy Markdown

@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.

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

70-73: Fix is correct — .filter((d) => d !== '') cleanly removes the trailing/stray empty entries.

The chained call correctly handles all line-ending variants (\r\n / \n) and manifest positions (start, middle, end of file). The empty endpoint that produced the invalid URL is reliably dropped before any downstream URL construction.

One cosmetic nit: the g flag on the split regex at line 72 is ignored by String.prototype.split(), which always splits on all occurrences regardless of flags. It's harmless but misleading.

♻️ Drop the redundant `g` flag
-        .split(/\r?\n/g)
+        .split(/\r?\n/)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@build/scraper.mjs` around lines 70 - 73, The split call uses a regex with a
redundant 'g' flag which is ignored by String.prototype.split; update the chain
that currently calls .split(/\r?\n/g) to use .split(/\r?\n/) instead so the
pattern remains the same but the misleading global flag is removed (locate the
expression that returns decompressed.replace(manifestRegex,
'').split(...).filter(...)).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@build/scraper.mjs`:
- Around line 70-73: The split call uses a regex with a redundant 'g' flag which
is ignored by String.prototype.split; update the chain that currently calls
.split(/\r?\n/g) to use .split(/\r?\n/) instead so the pattern remains the same
but the misleading global flag is removed (locate the expression that returns
decompressed.replace(manifestRegex, '').split(...).filter(...)).

@DopiGFX DopiGFX changed the title fix(#837): filter out empty strings for endpoints fix(#860): filter out empty strings for endpoints Feb 22, 2026
@TobiTenno TobiTenno enabled auto-merge (squash) February 23, 2026 02:38
Copy link
Copy Markdown

@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: 1

🧹 Nitpick comments (3)
.github/workflows/static.yaml (3)

83-83: Tests can now pass while lint is still running or failing.

Dropping lint from needs means test and lint run concurrently. The types job at line 67 still retains needs: [build, lint], so there's an asymmetry: a PR with lint failures shows ✅ tests but ❌ types. This is fine if branch-protection rules still require the lint job to pass before merging; otherwise, the lint gate is effectively weakened for test consumers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/static.yaml at line 83, The workflow currently runs the
test job without waiting for lint, causing tests to pass while lint can still be
running or failing; update the test job's needs to include lint (make the test
job depend on [build, lint], matching the types job) so lint must complete
before test finishes—look for the workflow job named "test" in
.github/workflows/static.yaml and add "lint" to its needs array alongside
"build".

100-101: Clarify the npm ci bug with a specific issue reference.

The comment "bug on lower versions of node/npm with the current manifest version" is vague. There are legitimate known bugs — for example, npm ci intermittently refuses to install because the lockfile generated by a prior npm install is not considered "in-sync", and npm ci can fail unexpectedly when a new version of a transitive dependency is published. Both were reported against the latest npm as recently as late 2025, so the workaround may well be justified.

However, without linking to the upstream issue (e.g., npm/cli#8726 or npm/cli#8693), future maintainers have no way to know when it's safe to revert. Please add a reference so the workaround can be removed when the upstream bug is fixed.

✏️ Suggested comment improvement
-      # have to use install due to bug on lower versions of node/npm with the current manifest version
+      # npm ci is unreliable with certain lockfile states on npm 10.x (npm/cli#8726, npm/cli#8693);
+      # revert to npm ci once those issues are resolved upstream
       run: npm install
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/static.yaml around lines 100 - 101, Update the inline
comment before the "run: npm install" step to cite the specific upstream npm
issue(s) that justify using npm install instead of npm ci (for example reference
issues like npm/cli#8726 or npm/cli#8693); replace the vague phrase "bug on
lower versions of node/npm with the current manifest version" with a short note
pointing to the exact GitHub issue(s) and date so future maintainers know when
to reevaluate reverting to "npm ci".

83-83: Tests can now pass while lint is still failing.

Removing lint from needs lets the test job run concurrently with lint. The types job at line 67 still has needs: [build, lint], so there's an asymmetry: a PR with lint errors will show ✅ tests but ❌ types. If the intent is purely a speed improvement (get test signal earlier), this is fine, but it's worth confirming that branch protection rules still require the lint job to pass before merging, or the lint gate is effectively weakened.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/static.yaml at line 83, The workflow allows the test job
to run without waiting for lint (needs: [build]) which can yield passing tests
while lint fails; either add "lint" back into the test job's needs array so the
"test" job uses needs: [build, lint], or if the intention is to surface tests
earlier, explicitly document/configure branch protection to require the "lint"
job before merge; update the "test" job's needs (or the branch protection rules)
and ensure the "types" job dependency remains consistent with the chosen
behavior (job names: test, lint, types, build).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/static.yaml:
- Around line 100-101: Replace the vague comment and the CI command "run: npm
install" with the standard CI behavior: use "npm ci" to ensure reproducible
installs and fail-fast on lockfile drift; if there really is a known
incompatibility, replace the comment with a concise note linking to the upstream
npm issue/PR and list the affected Node/npm version range instead of the current
vague text, and update the workflow step (the CI run step currently shown as
"run: npm install") accordingly.

---

Nitpick comments:
In @.github/workflows/static.yaml:
- Line 83: The workflow currently runs the test job without waiting for lint,
causing tests to pass while lint can still be running or failing; update the
test job's needs to include lint (make the test job depend on [build, lint],
matching the types job) so lint must complete before test finishes—look for the
workflow job named "test" in .github/workflows/static.yaml and add "lint" to its
needs array alongside "build".
- Around line 100-101: Update the inline comment before the "run: npm install"
step to cite the specific upstream npm issue(s) that justify using npm install
instead of npm ci (for example reference issues like npm/cli#8726 or
npm/cli#8693); replace the vague phrase "bug on lower versions of node/npm with
the current manifest version" with a short note pointing to the exact GitHub
issue(s) and date so future maintainers know when to reevaluate reverting to
"npm ci".
- Line 83: The workflow allows the test job to run without waiting for lint
(needs: [build]) which can yield passing tests while lint fails; either add
"lint" back into the test job's needs array so the "test" job uses needs:
[build, lint], or if the intention is to surface tests earlier, explicitly
document/configure branch protection to require the "lint" job before merge;
update the "test" job's needs (or the branch protection rules) and ensure the
"types" job dependency remains consistent with the chosen behavior (job names:
test, lint, types, build).

@TobiTenno TobiTenno merged commit 7cf52b7 into WFCD:master Feb 23, 2026
10 checks passed
@wfcd-bot-boi
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.1272.120 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Build presently broken by bad control character in DE's data

3 participants