Skip to content

Warn instead of blocking when a spider name differs from its domain#7

Open
MirjamOdile wants to merge 1 commit into
mainfrom
pr/02-spider-name-warn
Open

Warn instead of blocking when a spider name differs from its domain#7
MirjamOdile wants to merge 1 commit into
mainfrom
pr/02-spider-name-warn

Conversation

@MirjamOdile

Copy link
Copy Markdown

Problem

spiders import hard-rejects any config whose spider name doesn't equal the
domain-derived name whenever source_url is set. But a domain can legitimately
host more than one spider — a second template on the same site (e.g.
noaa_gov + noaa_gov_gc), or a sub-domain grouped under the main site
(ncei.noaa.gov as noaa_gov_ncei). The check forced those legit sub-spiders
to drop source_url just to get imported, losing the provenance field.

Change

The mismatch is now a warning instead of a rejection. It states exactly where
the data will live: crawls under data/<project>/<spider_name>/, while the
inspector's analysis folder stays domain-derived. Everything downstream
(crawl output paths, DeltaFetch cache, checkpoint, exports, DB attribution)
keys off the spider NAME consistently, so nothing scatters; the honest
mismatch-shaped-folder split (crawls vs analysis) is named in the warning.

Verification

Full unit suite green. Exercised live: importing a secondary spider for an
already-covered domain now succeeds with the warning, with source_url kept.

The importer hard-rejected any spider whose name didn't equal the
domain-derived folder name whenever source_url was set. But a domain
can legitimately host more than one spider (a second template, a
sub-domain grouped under the main site), and crawls + analysis both key
off the spider NAME consistently — nothing actually scatters. The check
forced legit sub-spiders to drop source_url just to get imported.

Keep the check as a warning that states where the data will live.

See docs/requests/05-spider-name-domain-warn.md (ships with the quality
tool PR) for the full write-up.
@iRanadheer iRanadheer force-pushed the pr/02-spider-name-warn branch from 8447b59 to c9cae66 Compare July 10, 2026 06:03
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.

1 participant