Skip to content

Backport to 1.8.x: MDX docs fixes, server v1.31.2, extension exit code (#1112, #1115, #1116)#1118

Merged
chaptersix merged 3 commits into
temporalio:release/1.8.xfrom
chaptersix:cherry-pick-1112-1115-1116-1.8.x
Jul 9, 2026
Merged

Backport to 1.8.x: MDX docs fixes, server v1.31.2, extension exit code (#1112, #1115, #1116)#1118
chaptersix merged 3 commits into
temporalio:release/1.8.xfrom
chaptersix:cherry-pick-1112-1115-1116-1.8.x

Conversation

@chaptersix

Copy link
Copy Markdown
Contributor

Backports the following PRs from main to release/1.8.x:

Cherry-picked in merge order with -x.

Notes

  • Bump go.temporal.io/server to v1.31.2 #1115 conflicted on go.mod/go.sum because release/1.8.x was on go.temporal.io/server v1.31.0. Resolved by taking v1.31.2 and regenerating go.sum via go mod tidy.
  • go build ./... passes; tests for internal/commandsgen, cmd/gen-docs, and the extension delegation tests pass locally.

chaptersix and others added 3 commits July 9, 2026 11:16
…temporalio#1112)

## Summary

This consolidates the excellent groundwork in temporalio#980, temporalio#1076, and temporalio#981 into
a single change, and verifies the result against a real Docusaurus
3.10.1 build. Huge thanks to @lennessyy — the approach here is entirely
built on those PRs; this just stitches them together and irons out a few
interactions between them.

gen-docs now escapes the patterns that break Docusaurus MDX (JSX)
compilation, on **every** path that writes a command description
(including the new split paths):

- bare angle-bracket placeholders in prose (e.g.
`<base64-encoded-cert>`, `<key>`) → `\<...\>`
- single-quoted JSON examples (e.g. `'{"a":"b"}'`, `'Key={"a":"b"}'`) →
braces escaped in body text, backticked in option tables
- custom heading IDs (e.g. `## Heading {#id}`) → `{/* #id */}`, the form
that compiles under Docusaurus 3.10 and still produces the custom anchor

Fenced code blocks and inline code spans are left untouched.

It also adds the `-subdir` flag (subcommands of the named command are
written to a subdirectory, e.g. `-subdir cloud` → `cloud/*.mdx`, with
deeper subcommands nested as headings), and a generic auto-generated
notice.

## What changed relative to the existing PRs

All three PRs were on the right track. The differences here are about
how they interact:

- **temporalio#1076 (MDX escaping):** kept as the core of this change, including
the `{#id}` → `{/* #id */}` heading conversion — which I confirmed is
exactly right for the 3.10 upgrade (see verification below). Escaping is
now also applied to the `-subdir` split output, so cloud docs get the
same treatment. Re-added unit tests for the escaping logic.
- **temporalio#980 (`-subdir`):** kept the split mechanism. Unified the
`encodeJSONExample` regex so it matches both `'{...}'` and `'Key={...}'`
(the standalone-vs-key-value cases the two PRs handled separately).
Intentionally did **not** carry over temporalio#980's index-page generation:
`command-reference/index.mdx` and `cloud/index.mdx` are hand-maintained
on the docs site (custom ordering, the `ReleaseNoteHeader` component),
so gen-docs deliberately does not emit them — generating them would
overwrite that curated content. The companion docs PR restores those
files after each regeneration.
- **temporalio#981 (generic notice):** folded in — the previous notice pointed at
paths that no longer exist and don't hold for cloud-cli inputs.

## Companion PR
temporalio/documentation#4836
(cherry picked from commit a38333d)
- Bumps server version for an OSS security release
- Dockerfile's Alpine is already up-to-date

(cherry picked from commit 1d8f321)
…n used (temporalio#1116)

## Related issues

CLDDX-141

## What changed?

When delegating to an extension (e.g. `temporal-cloud`, non-zero exit
codes don't make it back to the user, so there's no programmatic way to
know if the command succeeded. This change uses the exit code of the
extension as the exit command for the `temporal` command that wrapped
it.

## Checklist

**Stability**
- [ ] Breaking changes are marked with 💥 in the PR title and release
notes
- [ ] Changes to JSON output (`-o json` / `-o jsonl`) are treated as
breaking changes

**Design**
- [ ] This feature does not depend on Cloud-only APIs or behavior (it
works against an OSS server)
- [ ] New commands follow `temporal <noun> <verb>` structure (e.g.
`temporal workflow start`)
- [ ] New flags are named after the API concept, not the implementation
mechanism (good: `--search-attribute`, bad: `--index-field`)
- [ ] New flags don't duplicate an existing flag that serves the same
purpose
- [ ] New flags do not have short aliases without strong justification
- [ ] Experimental features are marked with `(Experimental)` in
`commands.yaml`

**Help text** (see style guide at the top of `commands.yaml`)
- [ ] All flags shown in help text and examples are implemented and
functional
- [ ] Summaries use sentence case and have no trailing period
- [ ] Long descriptions end with a period and include at least one
example invocation
- [ ] Examples use long flags (`--namespace`, not `-n`), one flag per
line
- [ ] Placeholder values use `YourXxx` form (`YourWorkflowId`,
`YourNamespace`)

**Behavior**
- [ ] Results go to stdout; errors and warnings go to stderr
- [ ] Error messages are lowercase with no trailing punctuation

**Tests**
- [ ] Added functional test(s) (`SharedServerSuite`)
- [ ] Added unit test(s) (`func TestXxx`) where applicable

## Manual tests

**Setup**
Create an executable file named `temporal-exit` somewhere on your PATH
```
#!/bin/bash
exit $1
```

**Happy path**
```
$ temporal exit 0; echo $?
0
```

**Error case**
```
$ temporal exit 1; echo $?
1
```

Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
(cherry picked from commit 99eb050)
@chaptersix chaptersix requested a review from a team as a code owner July 9, 2026 16:18
@chaptersix chaptersix marked this pull request as draft July 9, 2026 16:21
@chaptersix chaptersix marked this pull request as ready for review July 9, 2026 16:38
@chaptersix chaptersix merged commit 64f5072 into temporalio:release/1.8.x Jul 9, 2026
8 checks passed
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.

3 participants