Repository navigation
feat(adf): render Jira's document format as Markdown - #39
Merged
Merged
Conversation
internal/adf turns the Atlassian Document Format, the JSON of a Jira ticket's description and comments, into Markdown for the orchestrator and the user to read: the walk over a document's nodes, and the inline text with its marks, mentions, emoji, dates, cards and attachments. A node without a rule of its own shows its content, or the text that stands in for it, so the blocks that adf-blocks adds already come through as plain text. Decision 57 and fact 39 in docs/plan.md; the Jira row becomes adf, adf-blocks and jira.
|
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.



Step
adf(plan row 62): the first half of the Jira work.internal/adfrenders the Atlassian Document Format (ADF), the JSON in which Jira's REST API v3 gives a ticket's description and comments, as Markdown for the orchestrator and the user to read.What changes
adf.Markdown(node)walks a document's nodes. A run of inline nodes makes one block, blocks stand a blank line apart, and an empty block makes none.[**the docs**](…)). Other marks, such as underline and colours, leave the text plain. Code that holds backticks gets a longer fence, and a backtick at either end gets a space inside the fence.timestampis in milliseconds, though the docs' example reads as seconds (fact 39). A file or an image becomes[attachment: <alt or url>], or[attachment].adf-blockswill format.jirarow now comes afteradf(In review (feat(adf): render Jira's document format as Markdown #39)) andadf-blocks(Todo).Flagged: decision 57 (lead's call)
|in a table's cell will get one (adf-blocks).adf-blocks(headings, lists and task lists, code blocks, quotes and panels, rules, tables and expands), ahead ofjira.Checks
mise run check: green. Coverage 99.4%;internal/adf100%.testdata, each beside the Markdown that it should make. Their node set and attributes follow ADF's JSON schema (@atlaskit/adf-schema).TestMainputs the tests in a zone east of UTC, so that a date shown in the machine's zone fails them in CI too, which runs in UTC.TZ=UTCtoo), and attachments.adf-blockswill format show as plain paragraphs for now.Not in this PR
adf-blocksandjira(baton jira <KEY>, the token in the Keychain).jira: the Keychain read's G204 handling, and a live check against one real ticket. Neither blocksadforadf-blocks.