Repository navigation
feat(aggregator): global search slice 2 — registry, DNS, services, tier items (#1212) #7331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,7 @@ import { | |
| type RoadmapReconciliation, | ||
| } from "./roadmap-reconcile.ts"; | ||
| import type { Comment, DashComment, GhItem, ProjectPoolItem, QuotaView, RefKey, UsageView } from "./model.ts"; | ||
| import { isValidRef } from "./model.ts"; | ||
| import { buildEpicRollups } from "./epics.ts"; | ||
| import { buildProgramData, programRefs } from "./program.ts"; | ||
| import { | ||
|
|
@@ -556,10 +557,27 @@ async function roadmapContext() { | |
| } | ||
|
|
||
| async function searchContext(query: string) { | ||
| const [board, rows] = await Promise.all([source.board(), source.roadmap()]); | ||
| const refs = [...new Set([...allRefs(board), ...allRefs(rows)])]; | ||
| // #1212 slice 2: registry, DNS, services, and tier items join the | ||
| // board/roadmap subjects. Each extra source fails soft (empty on | ||
| // error) so one broken source never takes search down with it. | ||
| const [board, rows, registry, dns, usage, orchestration] = await Promise.all([ | ||
| source.board(), | ||
| source.roadmap(), | ||
| source.registry().catch(() => []), | ||
| source.dns().catch(() => null), | ||
| source.usage().catch(() => null), | ||
| source.orchestration().catch(() => null), | ||
| ]); | ||
| const tierItems = orchestration ? [...orchestration.tiers.needsDrew, ...orchestration.tiers.needsOrchestrator] : []; | ||
| // Codex P2 on PR #7331: refs carried only by the slice-2 sources | ||
| // (registry taskRefs, tier-item refs) join the resolution set, or | ||
| // their search badges always render unresolved even when the live | ||
| // pool/projector could resolve them. | ||
| const extraRefs = [...registry.flatMap((record) => record.taskRefs), ...tierItems.map((item) => item.ref)].filter(isValidRef); | ||
| const refs = [...new Set([...allRefs(board), ...allRefs(rows), ...extraRefs])]; | ||
| const items = await source.items(refs); | ||
| return { query, results: searchWork(board, rows, items, query), items }; | ||
| const extras = { registry, dns, services: usage?.services ?? [], tierItems }; | ||
| return { query, results: searchWork(board, rows, items, query, extras), items }; | ||
|
Comment on lines
+571
to
+580
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a registry session or tier item references a GitHub issue that is absent from the board and roadmap, its search badge always renders as unresolved, even if the live project pool or projector can resolve it. Useful? React with 👍 / 👎.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 0ba2dc9 (task 12609, lane code-e): searchContext now adds registry taskRefs and valid tier-item refs to the resolution set passed to source.items(), so badges for refs carried only by the slice-2 sources resolve against the live pool/projector instead of always rendering unresolved. |
||
| } | ||
|
|
||
| // #3321: watchdog gap-sync passes run whole and in observation | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an accepted registry record contains a non-string optional field such as
model: 7, a query that does not match an earlier field reaches this value inincludesQueryand throws becausevalue?.toLowerCase()only guards against nullish values.isSessionRecorddoes not validate optionalmodel,title, ordirectory, so these values can survive ingestion even though the existing sessions renderer safely escapes them. The new DNS matching path has the same problem with fields such asregistrar, whose typeisDnsSectiondoes not check. One such record therefore breaks both/searchand/api/search.json, despite the source-fetch failure handlers. Check that searchable values are strings or sanitize these fields before matching.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 0ba2dc9 (task 12609, lane code-e): includesQuery now only matches values that are actually strings (typeof check), so a non-string optional field (registry model: 7, a numeric DNS registrar) is skipped instead of throwing on .toLowerCase(). Regression tests cover both the registry and DNS matching paths.