feat(files): add file management commands#25
Conversation
Test & Lint Summary
|
noa-lucent
left a comment
There was a problem hiding this comment.
Clean, well-structured implementation that follows the existing codebase patterns closely. The file organization, output handling, streaming logic, and error handling are all solid and consistent with the expose/threads commands.
Two minor items flagged:
parseExpiryDurationshould reject non-positive durations (negative/zero) — straightforward boundary validation gap.TestFileOutputFromshould assert all mapped fields, not just ID and Filename.
Overall the PR meets the acceptance criteria from #23: all four subcommands are implemented per spec, proto codegen is updated, tests cover the pure functions, and smoke tests are extended. Nice work.
Test & Lint Summary
|
noa-lucent
left a comment
There was a problem hiding this comment.
Both prior comments addressed correctly:
parseExpiryDurationnow rejects non-positive durations with test coverage for"0s"and"-1h".TestFileOutputFromnow assertsContentTypeandSizeBytes.
All threads resolved. LGTM.
|
Updated Test & Lint Summary
|
noa-lucent
left a comment
There was a problem hiding this comment.
Good simplification. Replacing --output-path with a positional [destination] argument is a cleaner UX that neatly avoids the --output naming collision. The code is simpler (no args struct, no flag registration), the test coverage is extended with the whitespace-trim case, and resolveDownloadPath continues to handle the empty-destination fallback correctly.
One nit on the stale PR description — no code issues.
|
Removed tracked generated sources under gen/ and updated release workflow to install Buf + run buf generate before building binaries. Test & Lint Summary
|
239e1f6 to
6412bed
Compare
|
Rebased on main to resolve the gen/ delete vs. modify conflict, keeping generated sources removed. CI has restarted (build job pending). Test & Lint Summary
|
noa-lucent
left a comment
There was a problem hiding this comment.
Rebase and restructuring look clean. Reviewing the new changes:
Dropping committed gen/ sources: Good housekeeping. gen/ is properly gitignored, the Dockerfile's generate stage runs buf generate, and the release workflow's binary job now includes the Buf setup + generate steps. The image job correctly relies on the Dockerfile multi-stage build for codegen — no gap.
Threads refactor (threads.go + threads_test.go): The migration from splitParticipants (two-pass: create with IDs, then separately add nicknames) to participantIdentifiersFromValues (single-pass using the updated CreateThreadRequest.Participants field) is a clear improvement. Dedup uses a seen map instead of the old O(n²) appendUnique helper. The --organization-id flag is correctly wired as an optional proto field (*string). Dead code (appendUnique, splitParticipants) is fully removed. Tests updated with proper type assertions on the ParticipantIdentifier oneof variants.
Files command code: Unchanged from last approval — no regressions.
All prior threads resolved. LGTM.
Summary
files downloadaccepts optional positional[destination]to avoid clashing with global--output/-oformat flagTesting
Fixes #23