feat: add backward-compatible account and contact search #284
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!284
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/task-8532b75d-account-contact-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
accounts find <query> [--owner-type contact|source|site] [--owner-id <id>] [--json]and singularcontact find <query> [--json], consistent with the merged sources-find feature.qon existing authenticated list APIs; CLI filters locally too so older sites remain compatible without a mandatory upgrade.Task: task-8532b75d
Verification
./scripts/pre-pr.sh: passed formatting, generated CSS, lint, typecheck, and all workspace tests, including 274 CLI and 409 template-site tests.npm run build: passed all workspaces.node cli/dist/index.js --site slugkit-dev: contact name/null URL and URL searches, account labels/URLs, source owner filters, literal%_ [query, JSON/human output, zero matches, direct authenticated HTTP requests, and unchanged records before/after searches all passed.Contacts listedwithq=ÉCOLE, results=1,Accounts listedwithq=FIND-DEMO-URL, ownerType=source, ownerId=1, results=1, and zero-result queries. No credentials were captured in the evidence.Local evidence:
/tmp/slug-account-contact-pre-pr.log,/tmp/slug-account-contact-build.log,/tmp/slug-account-contact-live.log,/tmp/slug-account-contact-live-api.log.Compatibility
Existing list/show/create/edit/delete commands and requests without
qremain unchanged. Blank APIqstays unfiltered; blank CLI queries fail before requests. Resource routes remain in generated-site code rather than moving intoslug-api. Package updates alone do not rewrite copied endpoints; optional server-side filtering/logging requires reviewed site changes and redeployment. CLI publication is separate from this PR.Review update
fj pr view 284.task-8532b75d.55efa67eac24d2f2e5fa6b4f0cb474911a4dcaba, verified throughfj pr view 284 commits; reviewed the actual Forgejo PR diff.Acceptance criteria
cli/src/commands.tsaddsaccounts find, trims the query, URL-encodesq, and matches literal substrings using JavaScript lowercasing against both fields. CLI/API tests cover mixed case, partial labels, URLs, Unicode, and literal special characters.contact finduses the same matching and explicitly handles null/absent URLs with optional chaining. Tests and live evidence include a matching contact with a null URL.q. Empty/absent queries remain unfiltered; services retain existing SQL ordering and response mappings. API tests verify complete records, order, blank/absent queries, and authentication failures.qand locally filter successful responses without discarding metadata. Parameterized CLI tests exercise both server-filtered and older unfiltered responses; account compatibility retains existing server-side owner filters. No website upgrade is required for CLI correctness.cli/src/__tests__/find-commands.test.tsandtemplate/site/src/api/__tests__/account-contact-search.test.tscover matching fields, Unicode lowercasing, literal%_ [and URL characters, absent URLs, multiple/zero matches, invalid input, independent/combined owner filters, JSON, errors, ordering, unchanged records, and older-site compatibility. OpenAPI assertions are extended inroutes.test.ts; existing suites remain green in the supplied pre-PR evidence.q, method/path/status, result count, and supplied account owner filters, not request headers, arbitrary parameters, or record contents. Tests assert exact contexts, zero counts, excluded credentials/unrelated parameters/record URLs, and absence of success logs on failures. Sanitized live logs showÉCOLEwith 1 contact,FIND-DEMO-URLwithownerType=source,ownerId=1, and 1 account, blank-query full counts, and zero-result searches including the site-plus-ID case.docs/package-updates.mdgives customization-safe reviewed-file changes, test/build, redeployment, and verification steps, explicitly explaining that package-only updates andslug upgradedo not rewrite copied endpoints. Existing handlers remain unchanged apart from a behavior-preserving shared sources/contact query parser; regression suites and live list output provide compatibility evidence.Verification and pipeline state
fj actions tasksreports Forgejo build-lint-test #475, pull_request, successful for55efa67eac(the reviewed full head above), duration 2m13s./tmp/slug-account-contact-pre-pr.log:./scripts/pre-pr.shpassed generated CSS, formatting, lint, typecheck, and all workspace tests, including 274 CLI tests and 409 template-site tests./tmp/slug-account-contact-build.log: all-workspacenpm run buildcompleted successfully./tmp/slug-account-contact-live.log: successful development CLI and direct HTTP checks, human/JSON output, Unicode/literal matching, owner filters, empty results, and unchanged records./tmp/slug-account-contact-live-api.log: actual effective query/filter/count log entries, including zero, without secret credentials.fj.Findings and verdict
pr=open,review=approved,blocking_issues=0,warnings=0,criteria_total=10,criteria_met=10,criteria_missing=0./tmp/slug-account-contact-review-284-result.txtafter posting both matching comments.