Skip to content

Add block metadata flags to upload command - #29

Merged
dzucconi merged 5 commits into
aredotna:mainfrom
myles:adds-addtional-arguments-to-upload-command
Sep 8, 2026
Merged

Add block metadata flags to upload command#29
dzucconi merged 5 commits into
aredotna:mainfrom
myles:adds-addtional-arguments-to-upload-command

Conversation

@myles

@myles myles commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Brings upload to parity with add by exposing the remaining block-creation options.

New flags:

  • --alt-text
  • --original-source-url
  • --original-source-title
  • --insert-at
  • --metadata
  • --connection-metadata

Uploading a file previously accepted only --title and --description, so anything needing alt text, source attribution, or metadata had to be uploaded and then patched with a second command.

Switches the block payload from channel_ids to the channels array so per-connection position and metadata can be sent alongside the channel id. Both the interactive and --json paths take the same flags, reusing the existing intFlag and entityMetadataFlag helpers.

@dzucconi

dzucconi commented Sep 8, 2026

Copy link
Copy Markdown
Member

Fixed in 6dc0b82, now pushed to this PR branch.

The JSON upload path now validates --insert-at, --metadata, and --connection-metadata before looking up the channel or uploading the file. Previously, malformed values could be rejected only after the full S3 upload completed.

Added six regression cases covering invalid and missing values, asserting that rejection happens before any network access. All six failed before the fix and pass afterward. Typecheck, build, and all 26 targeted tests passed; live uploads were not tested.

@dzucconi
dzucconi merged commit d6eefb4 into aredotna:main Sep 8, 2026
1 check passed
@dzucconi

dzucconi commented Sep 8, 2026

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants