@postman-cse/onboarding-bootstrap 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. package/README.md +104 -18
  2. package/action.yml +43 -5
  3. package/dist/action.cjs +64092 -0
  4. package/dist/cli.cjs +5393 -6061
  5. package/dist/index.cjs +16097 -14979
  6. package/package.json +16 -16
package/README.md CHANGED
@@ -1,27 +1,28 @@
1
1
  # postman-bootstrap-action
2
2
 
3
- Public open-alpha GitHub Action for Postman workspace bootstrap from a registry-backed OpenAPI spec.
3
+ Public customer preview GitHub Action for Postman workspace bootstrap from a registry-backed OpenAPI spec.
4
4
 
5
5
  ## Scope
6
6
 
7
7
  This action preserves the bootstrap slice of the API Catalog demo flow:
8
8
 
9
9
  - create or reuse a Postman workspace
10
- - assign the workspace to a governance group through the current Bifrost and internal path
10
+ - assign the workspace to a configured governance group when a group name and `postman-access-token` are provided
11
11
  - invite the requester and add workspace admins
12
12
  - upload or update a remote spec in Spec Hub (after normalizing operation summaries — see below)
13
+ - optionally check for OpenAPI breaking changes before any Postman mutations
13
14
  - lint the uploaded spec by UID with the Postman CLI
14
15
  - generate missing baseline, smoke, and contract collections or reuse existing ones
15
16
  - optionally refresh current collections from the latest spec or create release-scoped spec and collection assets
16
17
  - inject generated tests and apply collection tags
17
18
  - reuse committed `.postman/resources.yaml` state from the checked-out ref when present
18
19
 
19
- The public open-alpha contract uses kebab-case inputs and outputs and defaults `integration-backend` to `bifrost`.
20
+ The public customer preview contract uses kebab-case inputs and outputs and defaults `integration-backend` to `bifrost`.
20
21
 
21
22
  ### Git provider support
22
23
 
23
24
  Workspace-to-repository linking via Bifrost supports both **GitHub** and **GitLab** (cloud and self-hosted) repository URLs. The `repo-url` value (or the auto-derived URL from CI environment variables) is stored as-is by Bifrost without provider-specific validation. URL normalization handles HTTPS, SSH (`git@`), and `.git` suffix variants for both providers.
24
- The public open-alpha contract uses kebab-case inputs and outputs and defaults `integration-backend` to `bifrost`.
25
+ The public customer preview contract uses kebab-case inputs and outputs and defaults `integration-backend` to `bifrost`.
25
26
 
26
27
  For existing services, pass `workspace-id`, `spec-id`, and any existing collection IDs to rerun the bootstrap safely without creating duplicate Postman assets. When `.postman/resources.yaml` is present in the checked-out ref, the action also reuses its workspace/spec/collection mappings automatically.
27
28
 
@@ -87,6 +88,30 @@ postman-bootstrap --workspace-team-id 132319 ...
87
88
  Or via environment variable: `export POSTMAN_WORKSPACE_TEAM_ID=132319`
88
89
 
89
90
  Non-org accounts (single team) are unaffected and do not need this input.
91
+
92
+ ### Governance group assignment
93
+
94
+ Governance assignment is optional and customer-configured:
95
+
96
+ 1. Set the repository custom property `postman-governance-group` to the Postman governance group name.
97
+ 2. Set `postman-access-token` so the action can perform workspace enrichment after the workspace exists.
98
+
99
+ Example:
100
+
101
+ ```yaml
102
+ with:
103
+ github-token: ${{ github.token }}
104
+ postman-access-token: ${{ secrets.POSTMAN_ACCESS_TOKEN }}
105
+ ```
106
+
107
+ For one-off runs, `governance-group` can be passed directly and overrides the
108
+ repository custom property. `governance-mapping-json` remains supported as a
109
+ domain-map fallback for older workflows.
110
+
111
+ If the group configuration is missing, the group is not found, or the access token is
112
+ expired, bootstrap logs a warning and continues with the created workspace,
113
+ spec, and collections.
114
+
90
115
  ### OpenAPI operation summaries (normalization)
91
116
 
92
117
  Before upload to Spec Hub, the action parses JSON or YAML OpenAPI documents and adjusts **path operations** so collection generation is less likely to fail:
@@ -100,6 +125,54 @@ This runs in `src/index.ts` before upload. If nothing under `paths` needs changi
100
125
 
101
126
  The root `spec-url` must be HTTPS and is fetched with pinned DNS resolution. The action blocks credential-bearing URLs, localhost/private/link-local/internal destinations, unsafe redirects, DNS rebinding attempts, and oversized OpenAPI resources before uploading content to Spec Hub. Root fetches are capped at 25 MiB, and fetch errors redact URL credentials, query strings, and fragments before logging.
102
127
 
128
+ ### Loading the spec from the workspace (`spec-path`)
129
+
130
+ For Git-first workflows the spec is usually checked into the same repo that runs the action, so an HTTPS URL is redundant (or impossible without making the repo public). Pass `spec-path` instead of `spec-url` to read the document directly from the checked-out workspace:
131
+
132
+ ```yaml
133
+ - uses: actions/checkout@v5
134
+ - uses: postman-cs/postman-bootstrap-action@v0
135
+ with:
136
+ project-name: core-payments
137
+ spec-path: apis/core-payments/openapi.yaml
138
+ postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
139
+ ```
140
+
141
+ Only one of `spec-url` or `spec-path` may be set. When `spec-path` is used the action reads the file from disk, skips the URL-safety machinery, and still resolves any external HTTPS `$ref`s through the same hardened fetcher. Local-file `$ref`s are not followed.
142
+
143
+ ### OpenAPI breaking-change check
144
+
145
+ Breaking-change detection is disabled by default. Enable it with `breaking-change-mode` when you want bootstrap to compare the incoming OpenAPI contract before creating or updating Postman resources.
146
+
147
+ Modes:
148
+
149
+ - `off`: default. No comparison runs and `openapi-changes` is not installed.
150
+ - `previous-spec`: compares the incoming Spec Hub upload content with the existing `spec-id` content. If there is no previous spec, the check is marked `skipped`.
151
+ - `pr-native`: compares `breaking-target-ref` or the detected PR target branch version of `spec-path` against the checked-out working tree. If no target-branch spec is available, it falls back to `breaking-baseline-spec-path` when configured.
152
+ - `baseline-only`: compares `breaking-baseline-spec-path` against the incoming spec. If the baseline file is missing, the check is marked `skipped`.
153
+
154
+ The action installs a pinned `pb33f/openapi-changes` release into the runner temp directory, verifies the archive checksum, validates archive paths before extraction, and runs the binary by absolute path. It does not require customers to preinstall the tool, and it does not use `npx`, global npm installs, or `curl | sh`.
155
+
156
+ Summary and log files default to `$RUNNER_TEMP/postman-bootstrap/`, so they are runner files, not committed repo changes. The markdown summary is also appended to the GitHub job summary when `$GITHUB_STEP_SUMMARY` is available. Pass `breaking-summary-path` or `breaking-log-path` only if your workflow wants explicit file locations for later `actions/upload-artifact` steps.
157
+
158
+ Example:
159
+
160
+ ```yaml
161
+ - uses: actions/checkout@v5
162
+ with:
163
+ fetch-depth: 0
164
+ - uses: postman-cs/postman-bootstrap-action@v0
165
+ with:
166
+ project-name: core-payments
167
+ spec-path: apis/core-payments/openapi.yaml
168
+ breaking-change-mode: pr-native
169
+ breaking-target-ref: ${{ github.base_ref }}
170
+ breaking-baseline-spec-path: apis/core-payments/openapi.baseline.yaml
171
+ postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
172
+ ```
173
+
174
+ If breaking changes are detected, bootstrap fails before workspace, spec, or collection mutation. Missing comparison sources are reported as `skipped` and do not fail the run.
175
+
103
176
  ## Usage
104
177
 
105
178
  ```yaml
@@ -110,7 +183,7 @@ jobs:
110
183
  actions: write
111
184
  contents: read
112
185
  steps:
113
- - uses: actions/checkout@v4
186
+ - uses: actions/checkout@v5
114
187
  - uses: postman-cs/postman-bootstrap-action@v0
115
188
  with:
116
189
  project-name: core-payments
@@ -119,14 +192,14 @@ jobs:
119
192
  requester-email: owner@example.com
120
193
  workspace-admin-user-ids: 101,102
121
194
  spec-url: https://example.com/openapi.yaml
122
- governance-mapping-json: '{"core-banking":"Core Banking"}'
195
+ github-token: ${{ github.token }}
123
196
  postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
124
197
  postman-access-token: ${{ secrets.POSTMAN_ACCESS_TOKEN }}
125
198
 
126
199
  bootstrap-existing:
127
200
  runs-on: ubuntu-latest
128
201
  steps:
129
- - uses: actions/checkout@v4
202
+ - uses: actions/checkout@v5
130
203
  - uses: postman-cs/postman-bootstrap-action@v0
131
204
  with:
132
205
  project-name: core-payments
@@ -190,6 +263,7 @@ Rollback behavior:
190
263
  | `CONTRACT_REF_DEPTH_EXCEEDED` | Ref nesting exceeded the configured limit. | Flatten recursive/deep ref chains. |
191
264
  | `CONTRACT_REF_SIZE_EXCEEDED` | A fetched resource or total fetched bytes exceeded limits. | Reduce spec/ref size or pre-bundle the document. |
192
265
  | `CONTRACT_SPEC_PARSE_FAILED` | The fetched document was not valid JSON/YAML object content. | Fix the source document syntax. |
266
+ | `CONTRACT_SPEC_READ_FAILED` | The `spec-path` file could not be read from the workspace. | Verify the file exists at the configured path and that the workflow checked out the branch that contains it. |
193
267
  | `CONTRACT_SPEC_VALIDATION_FAILED` | The bundled document failed OpenAPI validation. | Fix OpenAPI validation errors. |
194
268
  | `CONTRACT_UNSUPPORTED_OPENAPI_VERSION` | The document was not OpenAPI 3.0 or 3.1. | Provide an OpenAPI 3.0/3.1 document. |
195
269
  | `CONTRACT_NO_ELIGIBLE_OPERATIONS` | No eligible `paths` operations with responses were found. | Add path operations with responses. |
@@ -298,16 +372,26 @@ steps:
298
372
  | `spec-sync-mode` | `update` | Spec lifecycle policy. `update` keeps one canonical spec current in Spec Hub, while `version` creates or reuses a release-scoped spec asset. |
299
373
  | `release-label` | | Optional release label used for versioned specs and collections. When omitted for versioned sync, the action derives one from GitHub tag or branch metadata. |
300
374
  | `project-name` | | Service name used in workspace and asset naming. |
301
- | `domain` | | Business domain used for governance assignment. |
375
+ | `domain` | | Business domain metadata. Also used by the legacy `governance-mapping-json` fallback. |
302
376
  | `domain-code` | | Short prefix used when constructing the workspace name. |
303
377
  | `requester-email` | | Optional user invited into the workspace. |
304
378
  | `workspace-admin-user-ids` | | Comma-separated Postman user IDs to grant admin access. |
305
379
  | `workspace-team-id` | | Numeric sub-team ID for org-mode workspace creation. Required when the API key belongs to an org with multiple sub-teams. |
306
- | `spec-url` | | Required registry-backed OpenAPI document URL. |
307
- | `governance-mapping-json` | `{}` | Map of domain to governance group name. |
380
+ | `spec-url` | | HTTPS URL to the OpenAPI document. Provide either `spec-url` or `spec-path`. |
381
+ | `spec-path` | | Local filesystem path to the OpenAPI document, relative to the checked-out workspace (e.g. `apis/identity/openapi.yaml`). Use this when the spec lives in the repo and you don't want to host it over HTTPS. Provide either `spec-url` or `spec-path`. |
382
+ | `breaking-change-mode` | `off` | OpenAPI breaking-change comparison mode: `off`, `pr-native`, `baseline-only`, or `previous-spec`. |
383
+ | `breaking-baseline-spec-path` | | Workspace-relative baseline OpenAPI spec path used by `baseline-only` and as `pr-native` fallback. |
384
+ | `breaking-rules-path` | `changes-rules.yaml` | Workspace-relative `openapi-changes` rules file. Missing files are ignored. |
385
+ | `breaking-target-ref` | | Optional target branch or git ref override for `pr-native`. |
386
+ | `breaking-summary-path` | | Optional markdown report output path. Defaults to a runner-temp file. |
387
+ | `breaking-log-path` | | Optional raw command log output path. Defaults to a runner-temp file. |
388
+ | `governance-group` | | Postman governance group name. Overrides the `postman-governance-group` repository custom property and legacy domain mapping. |
389
+ | `governance-mapping-json` | `{}` | Legacy fallback map of `domain` value to Postman governance group name. Prefer the repository custom property or `governance-group`. |
390
+ | `github-token` | | GitHub token used to read the `postman-governance-group` repository custom property. |
391
+ | `gh-fallback-token` | | Fallback GitHub token used to read repository custom properties when `github-token` cannot. |
308
392
  | `postman-api-key` | | Required for all Postman asset operations. |
309
- | `postman-access-token` | | Required for governance assignment and canonical workspace validation during reruns. |
310
- | `integration-backend` | `bifrost` | Current public open-alpha backend. |
393
+ | `postman-access-token` | | Required for governance assignment, cloud spec-to-collection syncing, and canonical workspace validation during reruns. |
394
+ | `integration-backend` | `bifrost` | Current public customer preview backend. |
311
395
 
312
396
  ## Lifecycle Modes
313
397
 
@@ -406,11 +490,11 @@ The `postman-api-key` is a Postman API key (PMAK) used for all standard Postman
406
490
 
407
491
  > **Note:** The PMAK is a long-lived key tied to your Postman account. It does not require periodic renewal like the `postman-access-token`.
408
492
 
409
- ### Obtaining `postman-access-token` (Open Alpha)
493
+ ### Obtaining `postman-access-token` (Customer Preview)
410
494
 
411
- > **⚠️ Open-alpha limitation:** The `postman-access-token` input requires a manually-extracted session token. There is currently no public API to exchange a Postman API key (PMAK) for an access token programmatically. This manual step will be eliminated before GA.
495
+ > **⚠️ Customer Preview limitation:** The `postman-access-token` input requires a manually-extracted session token. There is currently no public API to exchange a Postman API key (PMAK) for an access token programmatically. This manual step will be eliminated before GA.
412
496
 
413
- The `postman-access-token` is a Postman session token (`x-access-token`) required for internal API operations that the standard PMAK API key cannot perform specifically governance group assignment and canonical workspace validation during reruns in this action. Without it, those steps degrade to warning-based behavior and name-based workspace fallback during provisioning.
497
+ The `postman-access-token` is a Postman session token required for workspace enrichment operations that the standard PMAK API key cannot perform, including governance group assignment, cloud spec-to-collection syncing, and canonical workspace validation during reruns. Without it, those steps degrade to warning-based behavior and name-based workspace fallback during provisioning.
414
498
 
415
499
  **To obtain and configure the token:**
416
500
 
@@ -450,6 +534,8 @@ The `postman-access-token` is a Postman session token (`x-access-token`) require
450
534
  - `contract-collection-id`
451
535
  - `collections-json`
452
536
  - `lint-summary-json`
537
+ - `breaking-change-status`
538
+ - `breaking-change-summary-json`
453
539
 
454
540
  ## Local development
455
541
 
@@ -462,11 +548,11 @@ npm run build
462
548
 
463
549
  `npm run build` produces the committed `dist/index.cjs` action bundle used by `action.yml`.
464
550
 
465
- ## Open-Alpha Release Strategy
551
+ ## Customer Preview Release Strategy
466
552
 
467
- - Open-alpha channel tags use `v0.x.y`.
553
+ - Customer Preview channel tags use `v0.x.y`.
468
554
  - Consumers can pin immutable tags such as `v0.2.0` for reproducibility.
469
- - Moving tag `v0` is used only as the rolling open-alpha channel.
555
+ - Moving tag `v0` is used only as the rolling customer preview channel.
470
556
 
471
557
  ## REST Migration Seam
472
558
 
package/action.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: postman-bootstrap-action
2
- description: Public open-alpha action contract for Postman workspace, spec, and collection bootstrap.
2
+ description: Public customer preview action contract for Postman workspace, spec, and collection bootstrap.
3
3
  inputs:
4
4
 
5
5
  workspace-id:
@@ -41,6 +41,9 @@ inputs:
41
41
  domain-code:
42
42
  description: Workspace naming prefix
43
43
  required: false
44
+ governance-group:
45
+ description: Postman governance workspace group name. Overrides the postman-governance-group repository custom property and domain mapping.
46
+ required: false
44
47
  requester-email:
45
48
  description: Requester email for audit context
46
49
  required: false
@@ -54,16 +57,47 @@ inputs:
54
57
  this input to see available sub-teams listed in the error output.
55
58
  required: false
56
59
  spec-url:
57
- description: URL to the OpenAPI document to bootstrap
58
- required: true
60
+ description: HTTPS URL to the OpenAPI document to bootstrap. Provide either spec-url or spec-path.
61
+ required: false
62
+ spec-path:
63
+ description: Local filesystem path to the OpenAPI document (relative to the workspace). Provide either spec-url or spec-path.
64
+ required: false
59
65
  openapi-version:
60
66
  description: OpenAPI specification version override (3.0 or 3.1). When not set, the version is auto-detected from the spec content.
61
67
  required: false
62
68
  default: ''
69
+ breaking-change-mode:
70
+ description: OpenAPI breaking-change comparison mode (off, pr-native, baseline-only, or previous-spec)
71
+ required: false
72
+ default: 'off'
73
+ breaking-baseline-spec-path:
74
+ description: Workspace-relative baseline OpenAPI spec path used by baseline-only mode and pr-native fallback
75
+ required: false
76
+ breaking-rules-path:
77
+ description: Workspace-relative openapi-changes rules file. Missing files are ignored.
78
+ required: false
79
+ default: changes-rules.yaml
80
+ breaking-target-ref:
81
+ description: Optional target branch or git ref override for pr-native breaking-change comparisons
82
+ required: false
83
+ breaking-summary-path:
84
+ description: Optional markdown report output path. Defaults to a runner-temp file.
85
+ required: false
86
+ default: ''
87
+ breaking-log-path:
88
+ description: Optional raw command log output path. Defaults to a runner-temp file.
89
+ required: false
90
+ default: ''
63
91
  governance-mapping-json:
64
- description: JSON map of business domain to governance group name
92
+ description: Legacy JSON map of business domain to governance group name. Prefer governance-group or the postman-governance-group repository custom property.
65
93
  required: false
66
94
  default: '{}'
95
+ github-token:
96
+ description: GitHub token used to read the postman-governance-group repository custom property
97
+ required: false
98
+ gh-fallback-token:
99
+ description: Fallback GitHub token used to read repository custom properties when github-token cannot
100
+ required: false
67
101
  postman-api-key:
68
102
  description: Postman API key used for bootstrap operations
69
103
  required: true
@@ -109,6 +143,10 @@ outputs:
109
143
  description: JSON summary of generated collections
110
144
  lint-summary-json:
111
145
  description: JSON summary of lint errors and warnings
146
+ breaking-change-status:
147
+ description: OpenAPI breaking-change check status
148
+ breaking-change-summary-json:
149
+ description: JSON summary of the OpenAPI breaking-change check
112
150
  runs:
113
151
  using: node24
114
- main: dist/index.cjs
152
+ main: dist/action.cjs