Skip to content

Commit 65ada0b

Browse files
authored
Merge branch 'main' into docs/serverless-workers-local-development
2 parents a51e35c + 8e29914 commit 65ada0b

35 files changed

Lines changed: 1528 additions & 103 deletions

.github/workflows/notify-automation-failures.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- Snipsync
1414
- Screenshot Capture
1515
- Update Custom Role Permissions
16+
- Update SDK Versions
1617
- Check Metrics Against SDKs
1718
- CLI Docs Update
1819
- Delete Visual Tests Reports
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: 'Update SDK Versions'
2+
3+
on:
4+
schedule:
5+
- cron: '0 9 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
update:
10+
name: 'Check SDK registries and open PR if a version changed'
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
steps:
17+
- name: Generate token
18+
id: generate_token
19+
uses: actions/create-github-app-token@v3
20+
with:
21+
app-id: ${{ secrets.TEMPORAL_CICD_APP_ID }}
22+
private-key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }}
23+
24+
- name: Checkout docs repo
25+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26+
with:
27+
persist-credentials: true
28+
token: ${{ steps.generate_token.outputs.token }}
29+
30+
- name: Setup Node
31+
uses: actions/setup-node@v7.0.0
32+
with:
33+
node-version: '20'
34+
35+
- name: Fetch latest SDK versions
36+
run: node bin/update-sdk-versions.js --write
37+
38+
- name: Check for changes
39+
id: diff
40+
run: |
41+
if git diff --quiet src/data/sdk-versions.json; then
42+
echo "changed=false" >> "$GITHUB_OUTPUT"
43+
else
44+
echo "changed=true" >> "$GITHUB_OUTPUT"
45+
fi
46+
47+
- name: Create PR
48+
if: steps.diff.outputs.changed == 'true'
49+
env:
50+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
51+
run: |
52+
git config user.name "temporal-cicd[bot]"
53+
git config user.email "temporal-cicd[bot]@users.noreply.github.com"
54+
55+
branch_name="update-sdk-versions-$(date +%Y%m%d)"
56+
git checkout -b "$branch_name"
57+
git add src/data/sdk-versions.json
58+
git commit -m "Update SDK version chips"
59+
git push origin "$branch_name"
60+
61+
gh pr create \
62+
--title "Update SDK version chips" \
63+
--body "Automated update of the latest SDK versions shown on /develop (src/data/sdk-versions.json), sourced from each SDK's package registry." \
64+
--head "$branch_name" \
65+
--base "main"

COMPONENT_REGISTRY.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,48 @@
22

33
Generated by `scripts/audit-components.mjs`. Run to update.
44

5-
**Coverage: 34/40 (85%)**
5+
**Coverage: 36/44 (82%)**
66

77
| Component | File Count | Strategy | Covered |
88
|-----------|------------|----------|---------|
9-
| `TabItem` | 79 | `tabitem` ||
10-
| `Tabs` | 78 | `tabs` ||
9+
| `TabItem` | 82 | `tabitem` ||
10+
| `Tabs` | 81 | `tabs` ||
11+
| `ReleaseNoteHeader` | 72 | `release-note-header` ||
1112
| `NoZoom` | 60 | `UNKNOWN` ||
12-
| `ReleaseNoteHeader` | 48 | `release-note-header` ||
13-
| `ViewSourceCodeNotice` | 24 | `view-source-code-notice` ||
1413
| `RelatedReadContainer` | 23 | `related-read-container` ||
14+
| `ViewSourceCodeNotice` | 23 | `view-source-code-notice` ||
1515
| `RelatedReadItem` | 20 | `related-read-item` ||
1616
| `SetupSteps` | 14 | `setup-steps` ||
1717
| `SetupStep` | 14 | `setup-step` ||
1818
| `CodeSnippet` | 14 | `code-snippet` ||
1919
| `PatternCards` | 13 | `cards` ||
20-
| `SdkTabs` | 8 | `sdk-tabs` ||
20+
| `SdkTabs` | 9 | `sdk-tabs` ||
2121
| `CallToAction` | 8 | `call-to-action` ||
2222
| `CaptionedImage` | 7 | `captioned-image` ||
2323
| `IntegrationsGrid` | 6 | `integrations-grid` ||
2424
| `ToolTipTerm` | 4 | `tooltip-term` ||
2525
| `JsonTable` | 3 | `json-table` ||
2626
| `AWSRegions` | 2 | `transclude` ||
2727
| `GCPRegions` | 2 | `transclude` ||
28+
| `SdkGuideLinks` | 2 | `sdk-guide-links` ||
2829
| `CustomRolePermissionsTable` | 1 | `transclude` ||
2930
| `InvitationContent` | 1 | `strip-block` ||
3031
| `RetrySimulator` | 1 | `strip-block` ||
32+
| `PriorityFairnessWalkthrough` | 1 | `UNKNOWN` ||
3133
| `ServerlessWorkerDemo` | 1 | `strip-block` ||
3234
| `StandaloneActivityDemo` | 1 | `UNKNOWN` ||
3335
| `SayHelloWorkflow` | 1 | `UNKNOWN` ||
3436
| `ISayHelloNexusService` | 1 | `UNKNOWN` ||
3537
| `CallerWorkflow` | 1 | `UNKNOWN` ||
36-
| `SdkGuideLinks` | 1 | `sdk-guide-links` ||
38+
| `SdkOverviewCards` | 1 | `sdk-overview-cards` ||
39+
| `TemporalLifecycleDemo` | 1 | `UNKNOWN` ||
3740
| `CloudRegionCount` | 1 | `strip-block` ||
3841
| `GuidesGrid` | 1 | `UNKNOWN` ||
3942
| `HeroWrapper` | 1 | `strip-tag` ||
4043
| `HeroHeader` | 1 | `strip-tag` ||
4144
| `HeroSection` | 1 | `strip-tag` ||
4245
| `HeroContent` | 1 | `strip-tag` ||
46+
| `HeroHeadline` | 1 | `hero-headline` ||
4347
| `HeroCta` | 1 | `strip-tag` ||
4448
| `HeroActions` | 1 | `strip-tag` ||
4549
| `ActionCard` | 1 | `hero-card` ||

MARKDOWN_PIPELINE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ docusaurus-plugin-llms ───────────────────
6969
| `scripts/mdx-to-md.mjs` | **The transformer.** Exports `transformMdx()` + parsing helpers and `COMPONENT_REGISTRY`. Zero-dependency ES module. |
7070
| `scripts/component-handlers/data-tables.mjs` | Handler for `<JsonTable>` — resolves a `static/json/*.json` file into a Markdown table. |
7171
| `scripts/component-handlers/integrations.mjs` | Handler for `<IntegrationsGrid>` — reads `src/components/IntegrationsGrid/integrations-data.json`, filters by the `defaultSdks` prop, and emits a Markdown list. |
72+
| `scripts/component-handlers/sdk-overview-cards.mjs` | Handler for `<SdkOverviewCards>` — reads `src/data/sdk-versions.json` for version numbers and emits a Markdown list, one bullet per SDK. |
7273
| `scripts/component-handlers/hero.mjs` | Handler for the homepage hero cards (`<ActionCard>` / `<CommunityCard>`) — parses `title`/`href` props and children into a Markdown link-list item. Copy lives in `docs/index.mdx`; layout wrappers strip generically. |
7374
| `scripts/component-handlers/cards.mjs` | Handler for `<QuickstartCards>` / `<PatternCards>` — parses the inline `items={[{href,title,description}]}` prop into a Markdown link list. |
7475
| `scripts/audit-components.mjs` | Inventory/coverage tool. Scans all docs, reports per-component coverage, writes `COMPONENT_REGISTRY.md` at the repo root. |
@@ -119,6 +120,7 @@ Each component maps to a strategy in `COMPONENT_REGISTRY` (in `scripts/mdx-to-md
119120
| `SetupSteps` / `SetupStep` | `setup-steps` / `setup-step` | Prose children plus code extracted from the `code={…}` JSX prop |
120121
| `JsonTable` | `json-table` | Markdown table resolved from the referenced `static/json/*.json` |
121122
| `IntegrationsGrid` | `integrations-grid` | Markdown list resolved from `integrations-data.json`, filtered by the `defaultSdks` prop |
123+
| `SdkOverviewCards` | `sdk-overview-cards` | Markdown list — one bullet per SDK with its version (from `src/data/sdk-versions.json`), developer guide link, and API reference link |
122124
| `ActionCard` / `CommunityCard` | `hero-card` | Homepage hero cards → `- [title](href): description` link-list item (copy authored in `docs/index.mdx`) |
123125
| `HeroWrapper`, `HeroHeader`, `HeroSection`, `HeroContent`, `HeroActions`, `HeroCta`, `CommunityCards` | `strip-tag` | Homepage hero layout wrappers — stripped to their inner Markdown (headline + intro prose) |
124126
| `QuickstartCards`, `PatternCards` | `cards` | Markdown link list parsed from the inline `items={[{href,title,description}]}` prop |
@@ -165,6 +167,11 @@ cross-reference comments above are an interim guard, not the fix.
165167
`src/components/IntegrationsGrid/index.tsx`. The intended fix is to extract that filtering into
166168
a shared, framework-agnostic module that both import (the pattern already used by
167169
`src/constants/featureReleaseTypes.js`).
170+
- **`SdkOverviewCards` — duplicated SDK metadata.** Version numbers are shared
171+
(`src/data/sdk-versions.json`), but the id/label/API-reference-href list in
172+
`scripts/component-handlers/sdk-overview-cards.mjs` duplicates `SDKS` in
173+
`src/constants/sdks.js`, because that file's icon imports aren't plain-Node-importable from an
174+
`.mjs` script. Update both if a label or API reference link changes.
168175

169176
Not affected: `JsonTable` (shared JSON data; only the render *format* differs) and
170177
`QuickstartCards`/`PatternCards` (content lives in the MDX `items` prop — a single source).

bin/check-metrics-reference.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ const SDKS = ['Core', 'Go', 'Java'];
2727
// against this, so a hyphen/underscore slip in either place is a failure.
2828
const TAGS = [
2929
'activity_type',
30+
'cause',
3031
'failure_reason',
3132
'namespace',
3233
'nexus_operation',
3334
'nexus_service',
3435
'operation',
3536
'poller_type',
37+
'status_code',
3638
'task_queue',
3739
'worker_type',
3840
'workflow_type',

bin/metrics-baseline.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@
2626
"sdks": "Go, Java",
2727
"note": "Deprecated in both SDKs. Superseded by local_activity_execution_failed."
2828
},
29-
{
30-
"name": "long_request_resource_exhausted",
31-
"sdks": "Go",
32-
"note": ""
33-
},
34-
{
35-
"name": "request_resource_exhausted",
36-
"sdks": "Go",
37-
"note": ""
38-
},
3929
{
4030
"name": "resource_slots_cpu_pid_output",
4131
"sdks": "Core, Java",

bin/update-sdk-versions.js

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
#!/usr/bin/env node
2+
3+
// Fetches the latest published version of each Temporal SDK from its package
4+
// registry and writes src/data/sdk-versions.json. Powers the version chips on
5+
// the /develop overview page (src/components/elements/Sdk/SdkOverviewCards).
6+
//
7+
// Each SDK's registry is queried independently: one registry being down,
8+
// renamed, or rate-limiting doesn't block updating the other seven. A failed
9+
// fetch keeps the previously recorded version rather than clearing it. The
10+
// file is only rewritten when a version actually changed, so a scheduled run
11+
// that finds nothing new produces no diff (and no PR).
12+
//
13+
// node bin/update-sdk-versions.js # report to stdout
14+
// node bin/update-sdk-versions.js --write # write src/data/sdk-versions.json
15+
16+
const https = require("https");
17+
const fs = require("fs");
18+
const path = require("path");
19+
20+
const OUT_PATH = path.join(__dirname, "..", "src", "data", "sdk-versions.json");
21+
const USER_AGENT = "temporal-docs-sdk-version-bot (+https://github.com/temporalio/documentation)";
22+
23+
function fetchText(url) {
24+
return new Promise((resolve, reject) => {
25+
https
26+
.get(url, { headers: { "User-Agent": USER_AGENT, Accept: "application/json" } }, (res) => {
27+
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
28+
res.resume();
29+
fetchText(res.headers.location).then(resolve, reject);
30+
return;
31+
}
32+
let data = "";
33+
res.on("data", (chunk) => (data += chunk));
34+
res.on("end", () => {
35+
if (res.statusCode !== 200) {
36+
reject(new Error(`HTTP ${res.statusCode} for ${url}`));
37+
return;
38+
}
39+
resolve(data);
40+
});
41+
})
42+
.on("error", reject);
43+
});
44+
}
45+
46+
async function fetchJSON(url) {
47+
return JSON.parse(await fetchText(url));
48+
}
49+
50+
// Strips a leading "v" so chips read e.g. "1.31.0" consistently — Go and PHP
51+
// tag releases as "v1.2.3"; the other registries don't.
52+
function stripV(version) {
53+
return version.replace(/^v/, "");
54+
}
55+
56+
const STABLE_SEMVER = /^v?\d+\.\d+\.\d+$/;
57+
58+
// One fetcher per SDK in src/constants/sdks.js. Keep the id keys in sync with
59+
// that file's SDKS[].id.
60+
const FETCHERS = {
61+
async go() {
62+
const data = await fetchJSON("https://proxy.golang.org/github.com/temporalio/sdk-go/@latest");
63+
return stripV(data.Version);
64+
},
65+
async java() {
66+
const xml = await fetchText(
67+
"https://repo1.maven.org/maven2/io/temporal/temporal-sdk/maven-metadata.xml"
68+
);
69+
const match = xml.match(/<release>([^<]+)<\/release>/);
70+
if (!match) throw new Error("no <release> in maven-metadata.xml");
71+
return match[1];
72+
},
73+
async dotnet() {
74+
const data = await fetchJSON("https://api.nuget.org/v3-flatcontainer/temporalio/index.json");
75+
const stable = data.versions.filter((v) => STABLE_SEMVER.test(v));
76+
if (stable.length === 0) throw new Error("no stable NuGet version found");
77+
return stable[stable.length - 1];
78+
},
79+
async php() {
80+
const data = await fetchJSON("https://repo.packagist.org/p2/temporal/sdk.json");
81+
const versions = data.packages["temporal/sdk"];
82+
const stable = versions.find((v) => STABLE_SEMVER.test(v.version));
83+
if (!stable) throw new Error("no stable Packagist version found");
84+
return stripV(stable.version);
85+
},
86+
async python() {
87+
const data = await fetchJSON("https://pypi.org/pypi/temporalio/json");
88+
return data.info.version;
89+
},
90+
async ruby() {
91+
const data = await fetchJSON("https://rubygems.org/api/v1/gems/temporalio.json");
92+
return data.version;
93+
},
94+
async rust() {
95+
const data = await fetchJSON("https://crates.io/api/v1/crates/temporalio-sdk");
96+
const version = data.crate.max_stable_version || data.crate.newest_version;
97+
if (!version) throw new Error("no version in crates.io response");
98+
return version;
99+
},
100+
async typescript() {
101+
const data = await fetchJSON("https://registry.npmjs.org/@temporalio/client/latest");
102+
return data.version;
103+
},
104+
};
105+
106+
async function main() {
107+
const existing = fs.existsSync(OUT_PATH)
108+
? JSON.parse(fs.readFileSync(OUT_PATH, "utf-8"))
109+
: { updatedAt: null, versions: {} };
110+
const previousVersions = existing.versions || {};
111+
112+
const versions = { ...previousVersions };
113+
const failures = [];
114+
115+
for (const [id, fetchVersion] of Object.entries(FETCHERS)) {
116+
try {
117+
versions[id] = await fetchVersion();
118+
} catch (err) {
119+
failures.push(`${id}: ${err.message}`);
120+
}
121+
}
122+
123+
if (failures.length > 0) {
124+
console.error(
125+
`Kept previous version for ${failures.length} SDK(s) after a fetch error:\n ${failures.join("\n ")}`
126+
);
127+
}
128+
if (failures.length === Object.keys(FETCHERS).length) {
129+
console.error("Every registry fetch failed — leaving sdk-versions.json unchanged.");
130+
process.exit(1);
131+
}
132+
133+
// Only bump the timestamp when a version actually changed, so a no-op run
134+
// (the common case) produces a byte-identical file and no git diff.
135+
const changed = JSON.stringify(versions) !== JSON.stringify(previousVersions);
136+
const output = {
137+
updatedAt: changed ? new Date().toISOString() : existing.updatedAt,
138+
versions,
139+
};
140+
141+
if (process.argv.includes("--write")) {
142+
fs.writeFileSync(OUT_PATH, JSON.stringify(output, null, 2) + "\n");
143+
console.error(`Wrote ${OUT_PATH}`);
144+
} else {
145+
console.log(JSON.stringify(output, null, 2));
146+
}
147+
}
148+
149+
main().catch((err) => {
150+
console.error(err);
151+
process.exit(1);
152+
});

0 commit comments

Comments
 (0)