Skip to content

feat: add more dc networks#849

Open
alexey-yarmosh wants to merge 1 commit into
masterfrom
add-dc-networks
Open

feat: add more dc networks#849
alexey-yarmosh wants to merge 1 commit into
masterfrom
add-dc-networks

Conversation

@alexey-yarmosh
Copy link
Copy Markdown
Member

Adding overrides so OVH or Hetzner probes are not marked as eyeball.

Also Baxet uses both Baxet and Baxet Group network name. It might make sense to either merge them, or make regex broader /baxet group/ -> /baxet/.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

Walkthrough

This pull request adds detection overrides for two hosting providers: Hetzner Online and OVH. The isHostingOverrides constant in src/lib/geoip/overrides.ts is extended with two new objects, each containing a regex pattern to match provider names and a flag marking them as hosting providers. Two unit test cases in the GeoIP client tests are updated to expect isHosting: true instead of null for these provider scenarios.

Suggested reviewers

  • MartinKolarik
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add more dc networks' accurately summarizes the main change: adding datacenter network overrides for Hetzner Online and OVH to the isHostingOverrides configuration.
Description check ✅ Passed The description is related to the changeset, explaining the purpose of adding OVH and Hetzner overrides to prevent these probes from being marked as eyeball networks.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-dc-networks

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/lib/geoip/overrides.ts

Oops! Something went wrong! :(

ESLint: 10.4.0

SyntaxError: Unexpected token ':'
at compileSourceTextModule (node:internal/modules/esm/utils:318:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:90:18)
at #translate (node:internal/modules/esm/loader:451:20)
at afterLoad (node:internal/modules/esm/loader:507:29)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:512:12)
at #getOrCreateModuleJobAfterResolve (node:internal/modules/esm/loader:555:36)
at afterResolve (node:internal/modules/esm/loader:603:52)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:609:12)
at node:internal/modules/esm/loader:628:32
at TracingChannel.tracePromise (node:diagnostics_channel:362:14)

test/tests/unit/geoip/client.test.ts

Oops! Something went wrong! :(

ESLint: 10.4.0

SyntaxError: Unexpected token ':'
at compileSourceTextModule (node:internal/modules/esm/utils:318:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:90:18)
at #translate (node:internal/modules/esm/loader:451:20)
at afterLoad (node:internal/modules/esm/loader:507:29)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:512:12)
at #getOrCreateModuleJobAfterResolve (node:internal/modules/esm/loader:555:36)
at afterResolve (node:internal/modules/esm/loader:603:52)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:609:12)
at node:internal/modules/esm/loader:628:32
at TracingChannel.tracePromise (node:diagnostics_channel:362:14)


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)
test/tests/unit/geoip/client.test.ts (1)

228-274: ⚡ Quick win

Add a dedicated OVH override test case.

These updates validate Hetzner override behavior, but the new OVH override path is still untested. Add one lookup() scenario with normalizedNetwork matching OVH and assert isHosting: true.

🤖 Prompt for 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.

In `@test/tests/unit/geoip/client.test.ts` around lines 228 - 274, Add a new unit
test alongside the existing Hetzner cases that calls client.lookup(MOCK_IP) with
nockGeoIpProviders configured to return a city and network that normalize to OVH
(use the same pattern as the Hetzner tests but set the provider response so
normalizedNetwork becomes 'ovh' or matches the OVH override), then assert the
returned object has normalizedNetwork: 'ovh' (or the exact normalized string
your override expects) and isHosting: true; locate the relevant test block near
the other lookup tests and mirror their structure (use client.lookup, MOCK_IP,
and expect(info).to.deep.equal({...})) so the OVH override path is covered.
🤖 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.

Nitpick comments:
In `@test/tests/unit/geoip/client.test.ts`:
- Around line 228-274: Add a new unit test alongside the existing Hetzner cases
that calls client.lookup(MOCK_IP) with nockGeoIpProviders configured to return a
city and network that normalize to OVH (use the same pattern as the Hetzner
tests but set the provider response so normalizedNetwork becomes 'ovh' or
matches the OVH override), then assert the returned object has
normalizedNetwork: 'ovh' (or the exact normalized string your override expects)
and isHosting: true; locate the relevant test block near the other lookup tests
and mirror their structure (use client.lookup, MOCK_IP, and
expect(info).to.deep.equal({...})) so the OVH override path is covered.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0d393fbb-ce41-434b-b42f-c186ed120451

📥 Commits

Reviewing files that changed from the base of the PR and between f2534b4 and a6fad73.

📒 Files selected for processing (2)
  • src/lib/geoip/overrides.ts
  • test/tests/unit/geoip/client.test.ts

@MartinKolarik
Copy link
Copy Markdown
Member

So are we sure these were mistagged and it wasn't a matching issue? Because I didn't see such probes at least in the current probe list.

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