CodeForPhilly / CodeForPhilly/codeforphilly-ng

laddr-import: tick the slug-reachability validation criterion now that read-api has landed

未关闭
#27 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
1
派生
1
平均合并
5 天 3 小时
30 天内合并 PR
9

描述

## Background

The [`laddr-import`](https://github.com/CodeForPhilly/codeforphilly-ng/blob/main/plans/laddr-import.md) plan (PR #24) left this Validation criterion unchecked:

> - [ ] All laddr slugs are accessible via `/projects/:slug` and `/members/:slug` after the import (verified via API test on a sample of 100 random records)

…with a Notes line claiming "those routes are owned by `read-api` and aren't built yet." That's not accurate at the time the PR was opened — `read-api` (PR #22) merged at 17:50 UTC; `laddr-import`'s PR opened at 22:29 UTC. The `/api/projects/:slug` and `/api/people/:slug` endpoints existed.

## What to do

Add an end-to-end test that:

1. Runs the importer against `apps/api/scripts/fixtures/laddr-fixture.sql` into a `createTestRepo()` + `createTestPrivateStore()`.
2. Boots `buildApp({ overrideEnv: { CFP_DATA_REPO_PATH: , ... } })`.
3. Picks 100 random imported records (or all of them if the fixture has fewer); for each, asserts `GET /api/projects/` and/or `GET /api/people/` returns the documented response shape.
4. Ticks the validation criterion in the plan.

Note: plans are frozen after merge, so the tick happens in this issue's PR via a small docs amendment under "Notes" rather than rewriting the criterion. Add a line like "Validation criterion 9 (slug reachability) closed out via Issue #N's tests; see [link]."

## Why bother

Closes the loop on a real validation gap. The import is one-shot — wrong slug → wrong URL forever. The test costs ~5min to write and pays for itself the first time it catches a slugify mistake.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start with apps/api/scripts/fixtures/laddr-fixture.sql, the importer, createTestRepo(), createTestPrivateStore(), and buildApp() to understand the test setup. Run the importer, boot the app with the test repository, and exercise /api/projects/:slug and /api/people/:slug for up to 100 imported records. Done means the documented response shapes are verified and the plan's Notes section records that the slug-reachability criterion was closed by this issue's tests.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
api, documentation, testing
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
描述清楚
新手友好度
74/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。