feat: add backward-compatible source search #283
No reviewers
Labels
No labels
activitypub
admin
api
architecture
articles
auth
bug
cleanup
cli
comments
compatibility
config
contacts
content
database
deployment
design
dev-env
diagnostics
docs
documentation
email
enhancement
feature
federation
feed
health
homepage
implementation
integration
logging
mastodon
media
navigation
npm-packages
openapi
opengraph
packages
passkeys
preview
priority:high
priority:low
priority:medium
production
proof
proxy
public-routes
public-ui
release
safety
slug-api
slug-auth
slug-core
slug-federation
slug-media
slug-template
social
sources
status:active
status:canceled
status:done
status:inprogress
status:waiting
syndication
tailwind
template
test
web
webauthn
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
erik/slugkit!283
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/task-4c9e432c-sources-find"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Task: task-4c9e432c — Add a sources find command to the Slug CLI
slug --site <name> sources find <query> [--json]with case-insensitive literal substring matching on names and URLs, complete source results, and successful empty-result handling.qtoGET /api/v1/sources; absent/blank queries preserve the existing list shape, authentication, ordering, and relationships.qstill return correct matches. No site upgrade or database migration is required to use the command.slug-apiis included.Sources listedlogs containing the effective query and returned count, without credentials, unrelated query parameters, or result contents.Verification
./scripts/pre-pr.sh— passed (generated CSS, formatting, linting, all workspace typechecks and tests, including integration tests).npm run build— passed.q=FIND DEMO,results=2and a no-match query withresults=0.--helplistssources find <query> [--json].%,_, brackets and query-string characters, null URLs, multiple/no results, usage validation, authentication/network/API errors, and read-only behavior.Compatibility
Existing source commands and unfiltered API requests are unchanged. CLI queries must be nonblank; API
qmay be absent or blank for an unfiltered list. Server-side filtering requires a reviewed generated-site source update and redeployment, not merely aslug-apipackage update.No release or merge is included. Await CI and independent review, then explicit human merge approval.
Review update
cbf8a955756b9fca1b8a8be5c127eee591f6d3eb.task-4c9e432c.Acceptance criteria
runSourcesFindCommand; CLI cases cover both fields and absent URLs.qtolistSources; CLI and service use trimmed queries, JavaScript lowercasing, and literal substring comparison.No sources found.or an empty data array.@evcraddock/slug-api.criteria_missing=1counts the incomplete criterion.Blocking issues
cli/src/commands.ts:76adds onlysources find <query> [--json]toHELP_TEXT; the help ends at line 113 without search semantics, examples or compatibility guidance. Add a concise help section explaining case-insensitive literal name/URL matching and local filtering for older sites, with a--siteexample (and JSON usage), and extend the help assertion incli/src/__tests__/commands.test.ts:235to cover that content. The detailed external docs do not fulfill the separate requirement to expose this information in CLI help.Warnings
Verification and pipeline state
build-lint-test, forcbf8a95575. Did not invoke the known-brokenfj pr statuscommand./tmp/slug-sources-pre-pr.log(all checks passed),/tmp/slug-sources-build.log(build completed),/tmp/slug-sources-focused.log(164 tests passed).Final verdict
Review update
c6744a6a27531485e3d622a7c26f2616356f49b9.task-4c9e432c.c6744a6resolves the prior CLI-help blocker with matching semantics, older-site compatibility, human/JSON examples, and regression assertions.Acceptance criteria
runSourcesFindCommandmatches partial names and URLs case-insensitively and explicitly handles absent URLs; tests cover both fields and null URLs.qtolistSources; both paths trim queries, use JavaScript lowercasing, and perform literal substring matching.qretain the existing SQL ordering, hydration, response envelope, and authentication middleware. Existing CLI source command implementations remain unchanged.qand always filters returned records locally; regression cases cover updated sites and older sites returning unfiltered records.No sources found.or an empty data array.slug upgradedo not rewrite endpoints.@evcraddock/slug-apiis introduced.criteria_missing=0.Blocking issues
Warnings
Verification and pipeline state
build-lint-test, forc6744a6a27. Used this resolved CI signal rather than the known-broken relative-URL parsing infj pr status./tmp/slug-sources-pre-pr.log: generated CSS, formatting, lint, workspace typechecks, and all workspace tests passed, including 212 CLI tests and 376 template-site tests./tmp/slug-sources-build.log: workspace build completed successfully./tmp/slug-sources-review-283-comment.md. Review scope included implementation, regression coverage, documentation, compatibility, and relevant security/error-handling concerns; no broad checks were rerun.Final verdict
Review update
47a76fdff758add8b0b80a650180308bf7370b30.task-4c9e432c.c6744a6; this review includes follow-up47a76fd.Acceptance criteria
qto the existing service; both CLI and service use trimmed queries, JavaScript lowercasing, and literal substring matching.qand always filters returned records locally; tests cover updated filtering sites and older sites ignoringq.No sources found.or an empty data array.slug upgradeare correctly distinguished from rewriting copied endpoints. API docs now describe successful source-query/count logging.@evcraddock/slug-api.criteria_missing=0.User-required logging correction
Sources listedat info level using the injected logger or existingconsoleApiLogger. Its allowlisted context contains method, path, effective trimmedq, status, and actual returnedresultscount, including zero; it excludes authorization headers, unrelated query parameters, and result contents.FIND DEMOreturns IDs 1 and 2,FIND-DEMO-URLreturns ID 3, and no match returns an empty collection; observed logs now expose queries and result counts. This live evidence was supplied, not rerun during review.Blocking issues
Warnings
Verification and pipeline state
build-lint-test, for47a76fdff7. Used this resolved signal without invoking the known-brokenfj pr statusparser./tmp/slug-sources-pre-pr.log: generated CSS, formatting, lint, workspace typechecks, and all tests passed, including 212 CLI and 379 template-site tests./tmp/slug-sources-build.log: workspace build passed./tmp/slug-sources-logging-tests.log: 20 source API tests passed./tmp/slug-sources-rereview-283-comment.md, and directly relevant logger wiring against all task criteria and the logging correction. No broad tests rerun.Final verdict