feat(conf): read polish — search text, space-view round-trip, attachment upload - #93
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three Confluence read-surface improvements (PR26 of the post-review improvement plan), plus a small shared-helper extraction:
search text <query>shorthand — buildstext ~ "<query>"CQL and appendsand type = "<type>"/and space = "<key>"when--type/--spaceare given, so common free-text lookups need no hand-written CQL. Values are quoted as CQL string literals with backslashes and embedded quotes escaped (cqlEscapedoubles\before escaping").space viewround-trip removal — previously it didFindSpaceByKeythen a secondGetSpaceby id. The keys-filtered list already returns the full space object, so a sharedfindSpaceRawrenders its first match directly (andresolveSpacedelegates to it).--jsonstill 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 theX-Atlassian-Token: no-checkheader.Dedup
Extracts
restutil.MultipartFile(builds the multipart upload body + content type, returnsrequest_encode_failedon failure), now used by bothjira.AddAttachmentand the newconf.CreateAttachment.Test plan
make check— greenmake lint— 0 issuesgo vet -tags=integration ./integration/...— cleanTestClientCreateAttachment;TestSearchTextBuildsCQL,TestSearchTextEscapesQuotes,TestSearchTextBuildCQLNoFlags,TestCQLEscapeBackslashAndQuote;TestAttachmentUploadSendsFile,TestAttachmentUploadRequiresFile; updatedspace viewtests assert the single round-trip🤖 Generated with Claude Code