feat: add complete backward-compatible post search #285
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!285
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/task-ba500871-post-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
Adds
post find <query> [--type article|link|note] [--status draft|published|all] [--tag <slug>] [--json]with complete, backward-compatible search across articles, links, and notes.qwith full-field filtering before pagination, preserving existing filters, published-only/all-types defaults, ordering, authentication, response summaries, and pagination metadata. Missing/blank API queries retain the original listing path.q, and fetches details where summaries omit necessary search fields. Short pages do not truncate search; repeated/non-advancing pages, missing detail content, and failed requests fail instead of printing partial results.{ "data": [...] }without misleading single-page metadata. Existing post commands/output stay unchanged; no migration or mandatory site upgrade.Task: task-ba500871
Verification
./scripts/pre-pr.sh: all checks passed, including formatting, CSS consistency, lint, types, 314 CLI tests and 432 template-site tests.npm run build: all workspaces passed.q=post-find-smoke,publicationStatus=all,tag=post-find-smoke, with offset/result pairs0/100,100/6,106/0.q=hidden-note-needle&status=draft&limit=1&offset=0; offset 1 returned no matches. CLI detail fetching found the same post. Blank API query matched the unchanged baseline.Local evidence:
/tmp/slug-post-find-pre-pr.log,/tmp/slug-post-find-build.log,/tmp/slug-post-find-live.log,/tmp/slug-post-find-live-api.log. Local fixtures are identifiable by tag/slug prefixpost-find-smokeand remain available for manual checks. Fixtures were created through the local API without publish/update federation operations.Compatibility and tradeoffs
Search uses JavaScript lowercasing to preserve Unicode/literal semantics rather than SQLite LIKE/FTS. Nonblank API queries scan eligible rows in memory before paging; only matching-page records are hydrated. Older sites may require many CLI detail reads. Offset pagination is not a snapshot; avoid concurrent collection changes while searching. These tradeoffs are documented. Resource endpoints remain generated-site code; package-only upgrades and advisory
slug upgradedo not rewrite them. Publication of the CLI remains a separate step.Review update
task-ba500871.1b8783e1c991b78e956c4811d89ca0a7b217b625, confirmed byfj pr view 285 commits.fj pr view 285 diff, narrowly relevant existing helpers, regression tests, and supplied local verification/live evidence. No implementation changes or broad checks were performed.Acceptance criteria
runPostsFindCommandregisters the new command; its request defaults tostatus=publishedand omitstype. API filtering retains the established publication predicate. CLI/API fixtures cover articles, links, and notes; live default draft-content search returns zero and explicit draft search finds the note.toLowerCase().includes(), matching existing sources/account/contact conventions. Queries are trimmed before searching, optional/null fields are safely skipped, and omitted summary content triggers detail reads when needed. Tests and live evidence cover mixed-case École, content-only matches, excerpts, URLs with query characters, and literal%_ [rather than SQL wildcards or regular expressions.listPostsfilters eligible complete rows beforeslice(offset, offset + limit)for nonblank queries. The absent/blank branch keeps SQLLIMIT/OFFSET; both branches retain timestamp/ID ordering and hydrate only the returned page into existing content-free summaries. Route response metadata and bearer authentication remain unchanged. Tests compare blank-query responses to baseline, check later matches beyond 105 filler rows, paging, validation, authentication, and unchanged records. No migrations or endpoint/package relocation are introduced.findPostssends encodedq, requests up to 100 records, advances by actual returned length, and terminates only on an empty page, not a short page. Local verification handles older servers ignoringq; unresolved summaries fetch encoded-slug details. Repeated records and missing required detail content raise errors; request failures propagate before any results are printed. Tests cover both API versions, shortened pages, a content-only match after 100 records, repeated pages, failed details, and a later-page network failure. Live evidence confirms 106 aggregate matches and actual offset/count pairs0/100,100/6,106/0.(untitled), and publication status for follow-uppost show. JSON returns original matching summaries in{ "data": [...] }without misleading single-page metadata. Empty results produceNo posts found.or an empty data array with success. Requests are GET-only, detail content is not added to output summaries, and automated/live before-and-after evidence shows unchanged posts.cli/README.md, post command/API specifications, OpenAPI parameters, anddocs/package-updates.mdcover fields, literal semantics, defaults, combined filters, examples, full pagination/detail reads, aggregate JSON/no-match behavior, compatibility, and errors. Upgrade guidance explicitly requires reviewed per-file changes preserving customizations, adapted tests, build/test checks, redeployment, and live verification; package-only updates and advisoryslug upgradedo not rewrite copied endpoints.Quality and security assessment
Verification and CI state
/tmp/slug-post-find-pre-pr.log: full pre-PR checks passed, including 314 CLI and 432 site tests./tmp/slug-post-find-build.log: all-workspace build passed./tmp/slug-post-find-live.logand/tmp/slug-post-find-live-api.log: reviewed sanitized live searches, actual pagination/count logs, and reported unchanged before/after records.build-lint-testrun #477 at reviewed head1b8783e1c991b78e956c4811d89ca0a7b217b625. This worker'sfj pr status 285could not deserialize Forgejo's relative job URL; CI state relies on the explicitly supplied verified run/head evidence, not a successful status refresh. No CI rerun was requested or performed.Final verdict
approved — criteria 10/10 met, 0 missing, 0 blockers, 0 warnings. Review approval is not merge authorization.
Next: Wait for explicit human merge approval. Do not merge or close the task; CLI publication remains separate.