Repository navigation
test(api): cover the new /api/website-title route (DataSpaceFrontend#470) - #199
saqibmanan wants to merge 1 commit into
Conversation
…470) DataSpaceFrontend#470 added an unauthenticated API route that fetches a caller-supplied URL server-side and returns its <title>. Covers the param validation (missing url, non-http(s) protocol) and the happy path (valid url -> fetched title), gated with deployed_pr since the route isn't on main yet.
|
Update: this is a real regression, not a flake, and it's bigger than just Not this PR's either way: the only file this PR touches is Root cause — #470 bumped Root cause — No fix exists to port. Both need someone with credentials (consumer side could be fixed without them, actually — it's unauthenticated — but updating This PR's own change ( |
Covers CivicDataLab/DataSpaceFrontend#470 (merge commit
24149ee), merged 2026-10-14 and confirmed live on dev (X-Git-Sha=84f4b13af57e6f83c5657945665312faa5f86e8e, which is a descendant of the merge commit — DataSpaceFrontend#503 merged on top of it the same day).What changed
#470 ("Provider Flow Update") is a large provider-dashboard overhaul (168 files — dataset-edit stepper, publications, collaboratives, AI model editing). Almost all of it sits behind provider/org login, which this environment has no credentials for (see "Gaps" below). One piece is public and unauthenticated: a new Next.js route,
app/api/website-title/route.ts—GET /api/website-title?url=<url>fetches the given URL server-side and returns its<title>, after checking the param is present and its protocol ishttp/https.Category added:
api(+smokeso it runs)New API-visible behaviour, no UI. Per this repo's own gotcha list, a test needs
smoketo be selected on a plain push/PR event —apialone wouldn't run.Where it landed and why
New file
tests/api/smoke/test_api_028_website_title.py, next free number onCI. Uses the existingdev_frontend_clientfixture (same onetest_api_027_dev_noindex.pyuses) — no new fixtures needed.Proof (red → green)
Collection, under CI's real filter (
pytest tests/api/smoke -m "smoke" --collect-only): all 3 new tests collected, not deselected.Red — parent commit, local serve (§6 "stronger proof for frontend PRs"): built a worktree at
6e62549(dev's tip just before #470), rannext dev --webpacklocally, hit the route:Green — merge commit, local serve (same worktree, checked out to
24149ee):Green — against dev (
HOME_URL_DEV=https://dev.civicdataspace.in), where outbound fetch isn't sandboxed:The third test asserts the actual fetched title (
"Example Domain"), confirmed directly against dev first (curl https://dev.civicdataspace.in/api/website-title?url=https://example.com→{"title":"Example Domain"}) before being written into the test.Gate correctness — against prod (not yet on
main, verified viagit merge-base --is-ancestor):All three self-skip with the expected reason, confirming the
deployed_prgate is correctly wired — safe to merge now, turns on by itself once #470 reaches prod.Gaps — not covered
TEST_EMAIL_1/TEST_PASSWORD_1are local/CI-only secrets), so none of it can be exercised or proven here, not even red/green. Existing Page Objects underpages/provider/(e.g.create_dataset_page.py) predate this restructure (the dataset-edit flow moved todataset/[id]/edit/{access,metadata,publish,resources,review}) and are likely stale against the new wizard steps. This needs a human/local run with real credentials to assess Page Object drift and write authenticated coverage — flagging rather than guessing blind at a login-gated 168-file surface.http://169.254.169.254/latest/meta-data/and an unreachablelocalhostport against dev — both return200 {"title":null}, identical to a normal non-HTML response, so there's no behavioural signal here to assert on from outside, andCivicDataSpace-testhas nosecuritymarker to carry it anyway per this repo's category table). Worth a look from inside the repo (egress allow-list / IP-range check) rather than from this test suite.Also assessed this run, no new PRs
actions/setup-node), no application code — no test.devin the last 72h.devPRs crossed the 72h threshold since test(api): metadata export error messages stop echoing caller input (DataSpaceBackend#245) #198's run yesterday; the same set (DataSpaceFrontend#420,DataSpaceBackend#52/#224,ParakhAI-frontend#441-444already covered;ParakhAI-frontend#440,ParakhAI-Backend#55/#106,IDS-DRR-Frontend#531,IDS-DRR-Data-Management#103already assessed-and-skipped) is still accurate — all remain open, none closed unmerged.Run context: scheduled cloud routine, no test credentials available in this environment. Everything above is unauthenticated, read-only, and was actually executed (not reasoned about) — nothing in this PR is
UNVERIFIED.