You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Adding-a-New-API-Version.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
**Document Purpose**: Step-by-step guide for adding support for a new API version (e.g., `v20300101`) to the mx-platform-node repository.
4
4
5
-
**Last Updated**: January 29, 2026
5
+
**Last Updated**: February 18, 2026
6
6
**Time to Complete**: 30-45 minutes
7
7
**Prerequisites**: Familiarity with the multi-version architecture (see [Multi-Version-SDK-Flow.md](Multi-Version-SDK-Flow.md))
8
8
@@ -152,6 +152,8 @@ version_directory:
152
152
153
153
This workflow is automatically triggered by the OpenAPI repository to generate and push SDKs for all versions in parallel.
154
154
155
+
**Note**: The existing infrastructure handles config file artifact upload/download between Generate and Process-and-Push jobs automatically. You only need to add the version-to-config mapping below — the artifact pipeline will pick up your new config file without additional changes.
156
+
155
157
**Location 1: Version-to-config mapping**
156
158
157
159
In the `Setup` job's `Set up matrix` step, find the section with the version-to-config mapping and add an `elif` branch for your new version:
@@ -228,9 +230,11 @@ on:
228
230
- 'v20111101/**'
229
231
- 'v20250224/**'
230
232
- 'v20300101/**' # NEW
233
+
repository_dispatch:
234
+
types: [automated_push_to_master] # No changes needed here
231
235
```
232
236
233
-
This ensures the workflow triggers when changes to your version directory are pushed to master.
237
+
This ensures the workflow triggers when changes to your version directory are pushed to master. The `repository_dispatch` trigger does not need modification — it is used by `openapi-generate-and-push.yml` to trigger this workflow after automated pushes, and works regardless of which version directories changed.
Copy file name to clipboardExpand all lines: docs/Multi-Version-SDK-Flow.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
**Document Purpose**: Quick-reference guide to the multi-version SDK generation, publishing, and release system. This is your entry point to understanding how the system works.
4
4
5
-
**Last Updated**: January 28, 2026
5
+
**Last Updated**: February 18, 2026
6
6
**Read Time**: 5-10 minutes
7
7
**Audience**: Anyone joining the team or needing a system overview
1.`openapi-generate-and-push.yml` generates all specified versions in parallel
39
39
2. All generated files committed to master
40
-
3.`on-push-master.yml`automatically triggered by the push
40
+
3.`openapi-generate-and-push.yml` sends a `repository_dispatch` event (`automated_push_to_master`) to trigger `on-push-master.yml`(required because `GITHUB_TOKEN` pushes don't trigger other workflows)
41
41
4.`on-push-master.yml` handles serial publish/release with version gating
42
42
43
43
**Key Details**: See [Workflow-and-Configuration-Reference.md](Workflow-and-Configuration-Reference.md#flow-1-automatic-multi-version-generation-repository-dispatch)
@@ -83,7 +83,7 @@ sequenceDiagram
83
83
Gen->>Push: Commit to master<br/>Update CHANGELOG.md
@@ -289,6 +289,33 @@ fatal: A release with this tag already exists
289
289
290
290
---
291
291
292
+
### Generated Files Placed in Nested Subdirectory
293
+
294
+
**Symptom**: After automated generation, SDK files appear at `v20111101/generated-v20111101/api.ts` instead of `v20111101/api.ts`
295
+
296
+
**Cause**: The `Process-and-Push` job in `openapi-generate-and-push.yml` downloads generated artifacts and moves them into the version directory. If the version directory already exists (from a prior commit), `mv` places the source *inside* the existing directory as a subdirectory rather than replacing it.
297
+
298
+
**Solution**: Already fixed in `openapi-generate-and-push.yml`. The workflow now runs `rm -rf ./$VERSION` before `mv` to ensure the target directory doesn't exist, so the move replaces rather than nests. If you see this issue, verify the workflow includes the `rm -rf` step before the `mv` command in the Process-and-Push job.
299
+
300
+
---
301
+
302
+
### Version Bump Not Applied During Automated Generation
303
+
304
+
**Symptom**: Automated generation completes but the version in `package.json` didn't increment (stays at the previous version)
305
+
306
+
**Cause**: The `version.rb` script argument was quoted incorrectly in the workflow. Passing `"$VERSION"` (with surrounding quotes in the shell script) causes bash to pass the literal string `$VERSION` instead of its value, so `version.rb` receives an unrecognized bump type and silently fails.
307
+
308
+
**Solution**: Already fixed in `openapi-generate-and-push.yml`. The `$VERSION` variable is now passed unquoted to `version.rb`. If you see this issue, verify the workflow calls `version.rb` with `$VERSION` (not `"$VERSION"`):
5. **For automated flows**: Verify that `openapi-generate-and-push.yml` sends a `repository_dispatch` event after pushing. The `push` trigger only works for manual PR merges. Automated pushes from workflows use `GITHUB_TOKEN`, which does not trigger other workflows — the generate workflow must send an explicit `repository_dispatch` (type: `automated_push_to_master`) using a GitHub App token.
**Symptom**: The `check-skip-publish` step in `on-push-master.yml` errors with something like `SDK: command not found` (exit code 127), and downstream jobs skip unexpectedly
384
+
385
+
**Cause**: The commit message contains double quotes (e.g., `Revert "Generated SDK versions: v20111101"`). If the workflow uses inline `${{ }}` interpolation to assign the commit message, the inner quotes close the outer quotes in bash, causing the remaining text to be interpreted as commands.
386
+
387
+
**Example of broken pattern**:
388
+
```yaml
389
+
# BROKEN - double quotes in commit message break this
if [[ "$COMMIT_MSG" == *"[skip-publish]"* ]]; then
401
+
echo "skip_publish=true" >> $GITHUB_OUTPUT
402
+
else
403
+
echo "skip_publish=false" >> $GITHUB_OUTPUT
404
+
fi
405
+
```
406
+
407
+
This fix is already applied to `on-push-master.yml`. If you see this error, verify that the workflow is using the `env:` block pattern and not inline interpolation.
Copy file name to clipboardExpand all lines: docs/Workflow-and-Configuration-Reference.md
+57-11Lines changed: 57 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
**Document Purpose**: Detailed technical reference for the multi-version SDK generation, publishing, and release workflows. Covers implementation details, configuration files, and system architecture.
4
4
5
-
**Last Updated**: January 29, 2026
5
+
**Last Updated**: February 18, 2026
6
6
**Audience**: Developers who need to understand or modify the implementation
7
7
8
8
---
@@ -81,14 +81,21 @@ strategy:
81
81
82
82
6. **Upload Artifacts**
83
83
- Upload generated SDK to workflow artifact storage
84
+
- Upload bumped config file as separate artifact (config file version bump happens on Generate runner, but Process-and-Push runs on a different runner with a fresh checkout — without this, the version bump would be lost)
84
85
- Allows atomic multi-version commit after all matrix jobs complete
85
86
86
87
#### Step 3: Post-Generation Processing (After All Matrix Jobs Complete)
87
88
88
89
1. **Download Artifacts**
89
90
- Retrieve generated SDKs for all versions from artifact storage
91
+
- Retrieve config file artifacts and restore them to `openapi/` directory
92
+
- Clean up config artifact directories (`rm -rf ./generated/config-*`) to prevent them from being committed
90
93
91
-
2. **Track Generated Versions**
94
+
2. **Move Generated Files to Version Directories**
95
+
- Remove existing version directory contents before moving: `rm -rf ./$VERSION` then `mv` generated files into place
96
+
- This prevents the generated files from being placed in a nested subdirectory (e.g., `v20111101/generated-v20111101/` instead of `v20111101/`)
97
+
98
+
3. **Track Generated Versions**
92
99
- Record which directories were actually generated
93
100
- Used by CHANGELOG automation to add entries only for generated versions
94
101
@@ -129,15 +136,19 @@ strategy:
129
136
130
137
#### Step 5: Automatic Publish and Release (via on-push-master.yml)
131
138
132
-
**Architecture**: After `Process-and-Push` completes and pushes to master, the automatic `on-push-master.yml` workflow is triggered by GitHub's push event.
139
+
**Architecture**: After `Process-and-Push` completes and pushes to master, it explicitly triggers `on-push-master.yml` via a `repository_dispatch` event (type: `automated_push_to_master`).
140
+
141
+
**Why `repository_dispatch` instead of relying on the push event?** GitHub's security model prevents workflows triggered by `GITHUB_TOKEN` from triggering other workflows. Since `openapi-generate-and-push.yml` pushes to master using `GITHUB_TOKEN`, that push does **not** trigger `on-push-master.yml`'s `push` event. To solve this, `openapi-generate-and-push.yml` generates a GitHub App token (via `tibdex/github-app-token@v1`) and uses it to send a `repository_dispatch` event (via `peter-evans/repository-dispatch@v2`), which does trigger `on-push-master.yml`.
142
+
143
+
**Note**: The `push` trigger on `on-push-master.yml` still exists and works for manual PR merges — only automated pushes from workflows need the `repository_dispatch` workaround.
- Enables consistent publish logic: All publishes (whether from automated generation or manual PR merge) go through the same workflow
137
148
- Prevents duplicate publishes: Manual generate.yml + PR merge only triggers publish once (via on-push-master.yml)
138
149
139
150
**Process** (handled by `on-push-master.yml`):
140
-
1. Detect-changes job uses `dorny/paths-filter@v2` to identify which version directories changed (v20111101/**, v20250224/**)
151
+
1. Detect-changes job uses `dorny/paths-filter@v2` to identify which version directories changed (v20111101/**, v20250224/**). For `repository_dispatch` events, uses `base: HEAD~1` to compare against the previous commit (push events use default `before`/`after` automatically).
141
152
2. Check-skip-publish job detects if `[skip-publish]` flag is in commit message
142
153
3. For each version with path changes (output by detect-changes):
143
154
- Publish job: Call `publish.yml` with version-specific directory (only if paths modified)
@@ -339,8 +350,13 @@ publish-v20250224:
339
350
340
351
341
352
342
-
### Trigger
343
-
Push to `master` branch with changes in version-specific directories (`v20111101/**` or `v20250224/**`)
353
+
### Triggers
354
+
355
+
`on-push-master.yml` responds to two trigger types:
356
+
1. **`push`** — activated when changes are pushed to `master` (e.g., PR merges)
357
+
2. **`repository_dispatch`** (type: `automated_push_to_master`) — activated by `openapi-generate-and-push.yml` after it pushes generated SDK files to master (needed because `GITHUB_TOKEN` pushes don't trigger `push` events for other workflows)
358
+
359
+
Both triggers require changes in version-specific directories (`v20111101/**` or `v20250224/**`) to proceed to publishing.
344
360
345
361
### Skip-Publish Safety Mechanism
346
362
Include `[skip-publish]` in commit message to prevent publish/release for this push.
@@ -358,15 +374,21 @@ Include `[skip-publish]` in commit message to prevent publish/release for this p
358
374
**Job**: `check-skip-publish`
359
375
360
376
```yaml
361
-
- name: Check for skip-publish flag
377
+
- name: Check for [skip-publish] flag in commit message
@@ -454,6 +476,22 @@ If v20250224 jobs depended directly on v20111101's publish job, the workflow wou
454
476
455
477
---
456
478
479
+
## Slack Failure Notifications
480
+
481
+
All workflows send Slack notifications on failure to the channel configured via `SLACK_WEBHOOK_URL`. Notifications include a clickable link to the specific failed workflow run URL for quick diagnosis.
| `on-push-master.yml` | Orchestration job failures (check-skip-publish, detect-changes, delay). Publish/release jobs have their own notifications via `publish.yml` and `release.yml`. |
487
+
| `generate.yml` | Generation failures |
488
+
| `publish.yml` | Publish failures |
489
+
| `release.yml` | Release failures |
490
+
491
+
**Message format**: The workflow name in Slack messages links directly to the failed run URL, making it easy to jump straight to the failing step without navigating through the GitHub Actions UI.
492
+
493
+
---
494
+
457
495
## Supporting Scripts
458
496
459
497
### version.rb - Multi-Version Support
@@ -643,8 +681,12 @@ on:
643
681
# - 'openapi/**' (config changes alone)
644
682
# - 'docs/**' (documentation changes)
645
683
# - 'README.md' (root documentation)
684
+
repository_dispatch:
685
+
types: [automated_push_to_master] # Triggered by openapi-generate-and-push.yml
646
686
```
647
687
688
+
The `repository_dispatch` trigger is required because automated pushes from `openapi-generate-and-push.yml` use `GITHUB_TOKEN`, which does not trigger `push` events for other workflows (GitHub security feature). The generate workflow sends this dispatch explicitly using a GitHub App token.
0 commit comments