Repository navigation
feat(metadata): list Confluence labels and content statuses - #1274
Open
BenjaminShinar wants to merge 11 commits into
Open
BenjaminShinar wants to merge 11 commits into
BenjaminShinar wants to merge 11 commits into
Conversation
BenjaminShinar
marked this pull request as ready for review
November 15, 2026 08:58
BenjaminShinar
force-pushed
the
metadata_listing_label_statuses
branch
2 times, most recently
from
November 18, 2026 09:09
735a1bd to
8da1082
Compare
BenjaminShinar
force-pushed
the
metadata_listing_label_statuses
branch
from
November 24, 2026 08:21
8da1082 to
eb460f3
Compare
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.
Feature request: #1307
This PR lays the groundwork for letting
markset Confluence page statuses, similar to how it sets labels.It adds API methods and CLI commands for reading and listing labels and content statuses.
These commands are useful independently: they let users inspect labels and statuses before choosing what to apply.
Summary
metadata labels listandmetadata statuses listcommands.--jsonfor scripting.--page,--blogpost,--attachment, and--custom-content.--in-space KEY) from labels attached to the space itself (--space KEY).confluencepackage.How to read this PR
docs/metadata_cli.mddescribes the selectors and output formats;util/metadata.goimplements the commands.confluence/metadata.gocontains the listing API methods and their result types.confluence/contenturl.goparses URLs;confluence/content.goresolves references that require an API lookup.ListLabelscalls upstream’swalkV2directly and returns an error on a first-page404.Approach
Selectors must be explicit command-line arguments.
Configured publishing-space settings do not silently narrow a metadata listing.
URL selectors supply the instance when no base URL is configured.
A conflicting configured instance is rejected before resolving credentials or making requests.
Browser attachment download URLs supply the parent content ID and filename.
The resolver uses the existing attachment-listing method to look up the ID.
API download URLs supply the attachment ID directly.
Title-based page and blog URLs use a lookup constrained to the selected content type.
Files changed
util/metadata.godefines the commands, validates selectors, prepares authentication, and writes tables or JSON.util/cli.goregistersmetadataand uses the shared parser for export URLs.confluence/metadata.goadds label queries and methods for space, personal, and assigned content statuses.confluence/contenturl.gocontainsPageRefandParsePageURL, moved fromexport, plus content URL parsing.confluence/content.goaddsAPI.ResolveContentIDfor title-based and attachment-filename lookups.confluence/v2pages.goshares label decoding and the label page size.export/url.goretains export-specific rules for rewriting page links;export/page.gouses the relocated reference type.util/page.gouses the relocated parser for page commands.confluence/instance.goand its example and tests reference the parser in its shared location.confluence/contenturl_test.gocontains the moved page URL tests and additional content URL tests.export/convert_test.gouses the shared reference type; its parser tests move with the parser.confluence/metadata_test.gocovers invalid collections and missing IDs without sending requests.util/metadata_test.gocovers selectors, URL resolution, credentials, pagination, gateway paths, output, and failures.cmd/mark/metadata_test.gochecks production-entry-point exit codes and output streams on request failures.docs/metadata_cli.mddocuments the interface;README.mdlinks to it and includesmetadatain root help.Interfaces
Content selectors accept IDs or URLs:
--page,--blogpost,--attachment, and--custom-content.Label space selectors take space keys:
--in-spacesearches content labels, while--spacelists space-object labels.Status listings retain
--space,--personal, and--page.export.PageRefandexport.ParsePageURLmove toconfluence.PageRefandconfluence.ParsePageURL.Their page URL parsing behavior is preserved.
Automated tests
Validation
f5a596f, including the full race-enabled suite and the standard Docker image build. CI runThe personal-status listing reports user-created statuses returned by Confluence's API.
It may differ from the web UI's custom-status list; UI removal and API deletion semantics have not been established.
Design questions
metadataoverlaps with Mark's term for metadata inside Markdown files.--jsonserves scripts; feedback on consistency with other Mark commands is welcome.prefixterminology and values.Out of scope
Setting page statuses is planned as a separate follow-up.
AI assistance
This PR was developed with Codex assistance using GPT 6.1 Sol with medium reasoning effort.