Skip to content

Commit 975eeed

Browse files
[HTTP/OAS] Commit OAS snapshot (#183338)
Close #181992 ## Summary First iteration of a CLI to capture an OAS snapshot. ## How to test Run `node ./scripts/capture_oas_snapshot.js --update --include-path /api/status` and see result in `oas_docs/bundle.json`. If you have the [bump CLI](https://www.npmjs.com/package/bump-cli) installed you can preview the hosted output with `bump preview ./oas_docs/bundle.json` ## Notes * Added ability to filter by `version`, `access` (public/internal) and excluding paths explicitly to the OAS generation lib * Follows the same general pattern as our other "capture" CLIs like `packages/kbn-check-mappings-update-cli` * Result includes only `/api/status` for now, waiting for other paths to add missing parts --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
1 parent 7fef12b commit 975eeed

File tree

38 files changed

+1378
-200
lines changed

38 files changed

+1378
-200
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
source .buildkite/scripts/common/util.sh
6+
7+
echo --- Capture OAS snapshot
8+
cmd="node scripts/capture_oas_snapshot --include-path /api/status"
9+
if is_pr && ! is_auto_commit_disabled; then
10+
cmd="$cmd --update"
11+
fi
12+
13+
eval "$cmd"
14+
check_for_changed_files "$cmd" true

.buildkite/scripts/steps/checks.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export DISABLE_BOOTSTRAP_VALIDATION=false
77

88
.buildkite/scripts/steps/checks/saved_objects_compat_changes.sh
99
.buildkite/scripts/steps/checks/saved_objects_definition_change.sh
10+
.buildkite/scripts/steps/capture_oas_snapshot.sh
1011
.buildkite/scripts/steps/code_generation/elastic_assistant_codegen.sh
1112
.buildkite/scripts/steps/code_generation/security_solution_codegen.sh
1213
.buildkite/scripts/steps/code_generation/osquery_codegen.sh

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ src/plugins/bfetch @elastic/appex-sharedux
6767
packages/kbn-calculate-auto @elastic/obs-ux-management-team
6868
packages/kbn-calculate-width-from-char-count @elastic/kibana-visualizations
6969
x-pack/plugins/canvas @elastic/kibana-presentation
70+
packages/kbn-capture-oas-snapshot-cli @elastic/kibana-core
7071
x-pack/test/cases_api_integration/common/plugins/cases @elastic/response-ops
7172
packages/kbn-cases-components @elastic/response-ops
7273
x-pack/plugins/cases @elastic/response-ops

0 commit comments

Comments
 (0)