Skip to content

feat(conf): read polish — search text, space-view round-trip, attachment upload - #93

Merged
aurokin merged 1 commit into
mainfrom
feat/conf-read-polish
May 24, 2026
Merged

feat(conf): read polish — search text, space-view round-trip, attachment upload#93
aurokin merged 1 commit into
mainfrom
feat/conf-read-polish

Conversation

@aurokin

@aurokin aurokin commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

Three Confluence read-surface improvements (PR26 of the post-review improvement plan), plus a small shared-helper extraction:

  • search text <query> shorthand — builds text ~ "<query>" CQL and appends and type = "<type>" / and space = "<key>" when --type/--space are given, so common free-text lookups need no hand-written CQL. Values are quoted as CQL string literals with backslashes and embedded quotes escaped (cqlEscape doubles \ before escaping ").
  • space view round-trip removal — previously it did FindSpaceByKey then a second GetSpace by id. The keys-filtered list already returns the full space object, so a shared findSpaceRaw renders its first match directly (and resolveSpace delegates to it). --json still emits the raw space object.
  • attachment upload <page-id> --file <path> — uploads a file as an attachment. Confluence v2 has no attachment-create endpoint, so it uses REST v1 (POST /content/{page-id}/child/attachment) with a multipart body and the X-Atlassian-Token: no-check header.

Dedup

Extracts restutil.MultipartFile (builds the multipart upload body + content type, returns request_encode_failed on failure), now used by both jira.AddAttachment and the new conf.CreateAttachment.

Test plan

  • make check — green
  • make lint — 0 issues
  • go vet -tags=integration ./integration/... — clean
  • New tests: TestClientCreateAttachment; TestSearchTextBuildsCQL, TestSearchTextEscapesQuotes, TestSearchTextBuildCQLNoFlags, TestCQLEscapeBackslashAndQuote; TestAttachmentUploadSendsFile, TestAttachmentUploadRequiresFile; updated space view tests assert the single round-trip

🤖 Generated with Claude Code

…ent upload

Three Confluence read-surface improvements (PR26):

- search text <query> [--space <key>] [--type <type>]: builds
  text ~ "<query>" CQL (plus type/space clauses) so common free-text
  lookups need no hand-written CQL. Values are quoted as CQL string
  literals with backslashes and quotes escaped.
- space view: drop the redundant second GetSpace round-trip. The
  keys-filtered list already returns the full space object, so a shared
  findSpaceRaw renders its first match directly (and resolveSpace
  delegates to it).
- attachment upload <page-id> --file <path>: upload a file as an
  attachment via the REST v1 endpoint (v2 has none), with the multipart
  body and X-Atlassian-Token: no-check header.

Also extracts restutil.MultipartFile, the shared multipart upload-body
builder, now used by both jira.AddAttachment and conf.CreateAttachment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aurokin
aurokin merged commit 09646fb into main May 24, 2026
3 checks passed
@aurokin
aurokin deleted the feat/conf-read-polish branch May 24, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant