Skip to content

Commit 3be6fb4

Browse files
authored
Merge branch 'opensearch-project:main' into 532_publish_proto_files
2 parents d1eef02 + bf35601 commit 3be6fb4

File tree

109 files changed

+3103
-1088
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+3103
-1088
lines changed

.cspell

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ geotile
6363
gsub
6464
Gsub
6565
haasephonetik
66+
hashcode
6667
heteroscedastic
6768
hnsw
6869
homoscedastic
@@ -134,6 +135,7 @@ Oversample
134135
performanceanalyzer
135136
permissionsinfo
136137
pipefail
138+
pipenv
137139
preconfigure
138140
preconfigured
139141
prefilter

.github/workflows/test-spec.yml

+32-14
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,28 @@ jobs:
2727
admin_password: admin
2828
- version: 2.0.0
2929
admin_password: admin
30-
- version: 2.16.0
31-
- version: 2.16.0
30+
- version: 2.18.0
31+
- version: 2.18.0
3232
tests: plugins/index_state_management
33-
- version: 2.16.0
33+
- version: 2.18.0
3434
tests: plugins/ml
35-
- version: 2.16.0
35+
- version: 2.18.0
3636
tests: routing
37-
- version: 2.16.0
37+
- version: 2.18.0
3838
tests: snapshot
39-
- version: 2.17.0
39+
- version: 2.18.0
4040
tests: plugins/streaming
41-
- version: 2.17.0
41+
- version: 2.18.0
4242
tests: plugins/notifications
43-
- version: 2.17.0
43+
- version: 2.18.0
4444
tests: plugins/query_insights
45-
- version: 2.17.0
45+
- version: 2.18.0
4646
tests: plugins/workload-management
4747
- version: 2.18.0
48+
tests: plugins/analysis
49+
- version: 2.19.0
4850
hub: opensearchstaging
49-
ref: '@sha256:57a1cd1142d68c203e2e4aa0666d9a691e1e409a5d14aa4a8f5044036f05cf06'
51+
ref: '@sha256:4da23e0137b2b67206d23b36fcf0914cc39b3bf19310c782f536e4934b86f6cc'
5052
- version: 3.0.0
5153
hub: opensearchstaging
5254
ref: '@sha256:727643acdfebed77bfdb26362dbcff536b7ea02a0cc4ae2da2521729171333de'
@@ -77,12 +79,16 @@ jobs:
7779
working-directory: tests/${{ matrix.entry.tests || 'default' }}
7880
run: docker compose up -d
7981

82+
- name: Generate Test Files Hash
83+
id: tests
84+
run: echo "hash=${{ matrix.entry.version }}-${{ hashFiles(format('tests/{0}', matrix.entry.tests || 'default')) }}" >> $GITHUB_OUTPUT
85+
8086
- name: Run Tests
8187
run: |
8288
npm run test:spec -- \
8389
--opensearch-insecure \
8490
--opensearch-version=${{ matrix.entry.version }} \
85-
--coverage coverage/test-spec-coverage-${{ matrix.entry.version }}-${{ matrix.entry.tests || 'default' }}.json \
91+
--coverage coverage/test-spec-coverage-${{ steps.tests.outputs.hash }}.json \
8692
--tests=tests/${{ matrix.entry.tests || 'default' }}
8793
8894
- name: Get Container Logs
@@ -96,12 +102,11 @@ jobs:
96102
- name: Upload Test Coverage Results
97103
uses: actions/upload-artifact@v4
98104
with:
99-
name: coverage-${{ matrix.entry.version }}-${{ hashFiles(format('tests/{0}', matrix.entry.tests || 'default')) }}
100-
path: coverage/test-spec-coverage-${{ matrix.entry.version }}-${{ matrix.entry.tests || 'default' }}.json
105+
name: coverage-${{ matrix.entry.version }}-${{ steps.tests.outputs.hash }}
106+
path: coverage/test-spec-coverage-${{ steps.tests.outputs.hash }}.json
101107

102108
merge-coverage:
103109
runs-on: ubuntu-latest
104-
if: github.event_name == 'pull_request'
105110
needs: test-opensearch-spec
106111
steps:
107112
- uses: actions/checkout@v4
@@ -111,6 +116,17 @@ jobs:
111116
with:
112117
path: coverage
113118

119+
- name: Display Missing Test Paths
120+
run: |
121+
jq -sc '
122+
(map(.operations) | add | unique) as $all |
123+
(map(.evaluated_operations) | add | unique) as $evaluated |
124+
$all-$evaluated |
125+
sort_by(.path) |
126+
.[] |
127+
"\(.method) \(.path)"
128+
' $(find ./ -name "test-spec-coverage-*.json")
129+
114130
- name: Combine Test Coverage Data
115131
shell: bash -eo pipefail {0}
116132
run: |
@@ -126,6 +142,7 @@ jobs:
126142
cat ./coverage/coverage.json
127143
128144
- name: Construct Comment Data Payload
145+
if: github.event_name == 'pull_request'
129146
shell: bash -eo pipefail {0}
130147
run: |
131148
jq \
@@ -146,6 +163,7 @@ jobs:
146163

147164
- name: Upload PR Comment Payload
148165
uses: actions/upload-artifact@v4
166+
if: github.event_name == 'pull_request'
149167
with:
150168
name: pr-comment
151169
path: pr-comment.json
File renamed without changes.
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Validate Spec (Python)
2+
3+
on: [pull_request,push]
4+
5+
jobs:
6+
validate-spec-py:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout the repo
10+
uses: actions/checkout@v4
11+
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: '20'
16+
17+
- name: Build
18+
run: npm ci && npm run merge
19+
20+
- name: Set Up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.12'
24+
25+
- name: Install Dependencies
26+
working-directory: tools/src/validate-spec-py
27+
run: |
28+
pip install --user pipenv
29+
pipenv install
30+
31+
- name: Validate Spec
32+
working-directory: tools/src/validate-spec-py
33+
run: |
34+
pipenv run python validate.py ../../../build/opensearch-openapi.yaml
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Validate Spec (Ruby)
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
validate-spec-ruby:
7+
runs-on: ubuntu-latest
8+
env:
9+
BUNDLE_GEMFILE: ${{ github.workspace }}/tools/src/validate-spec-ruby/Gemfile
10+
steps:
11+
- name: Checkout the repo
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: '20'
18+
19+
- name: Build
20+
run: npm ci && npm run merge
21+
22+
- uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: '3.3'
25+
bundler-cache: true
26+
27+
- name: Validate Spec
28+
working-directory: tools/src/validate-spec-ruby
29+
run: |
30+
bundle exec ruby validate.rb ../../../build/opensearch-openapi.yaml

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,33 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

77
### Added
88
- Added API specs for query groups lifecycle APIs ([#649](https://github.com/opensearch-project/opensearch-api-specification/pull/649))
9+
- Added Python and Ruby spec validators ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
10+
- Added verbose output of the story being evaluated ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
11+
- Added `_search` with `sort: direction` ([#658](https://github.com/opensearch-project/opensearch-api-specification/pull/658))
12+
- Added `_common.mapping:FlatObjectProperty` ([#661](https://github.com/opensearch-project/opensearch-api-specification/pull/661))
13+
- Added `HEAD /{index}/_doc/{id}` returning `404` ([#670](https://github.com/opensearch-project/opensearch-api-specification/pull/670))
14+
- Added `_common.mapping:IcuCollationKeywordProperty` ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666))
15+
- Added `/_cluster/stats/{metric}/nodes/{node_id}` and `/_cluster/stats/{metric}/{index_metric}/nodes/{node_id}` ([#639](https://github.com/opensearch-project/opensearch-api-specification/pull/639))
16+
- Added `PhoneAnalyzer` from `analysis-phonenumber` plugin ([#609](https://github.com/opensearch-project/opensearch-api-specification/pull/609))
17+
- Added `/_list/indices` & `/_list/shards` api specs ([#613](https://github.com/opensearch-project/opensearch-api-specification/pull/613))
918

1019
### Removed
1120
- Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652))
21+
- Removed unsupported `_common.mapping:DenseVectorProperty`, `_common.mapping:SparseVectorProperty`, and `_common.mapping:FlattenedProperty` ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666))
22+
- Removed unsupported time series dimension properties and types ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666))
23+
- Removed unsupported runtime field properties (`script`/`on_script_error`) on `NumberPropertyBase` ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666))
24+
25+
### Fixed
26+
- Spec passes OpenAPI 3.1.0 validations ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
27+
- Disallowed characters (`::`, `@`, and `:`) in key names are replaced with `___` on merge ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
28+
- Added missing `required` to `path` parameters ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
29+
- Added missing `schema` parent to response types ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
30+
- Removed invalid `externalDocs` from `flow_framework.create/update::query.use_case` ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
31+
- Fixed incorrect `style` in `indices.get_mapping::query.index` ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
32+
- Removed invalid `required` from `ppl` responses ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
33+
- Added schema for security API error responses ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
34+
- Fixed `/{index}/_create/{id}` returning `201` ([#669](https://github.com/opensearch-project/opensearch-api-specification/pull/669))
35+
- Fixed `ml._common.yaml#SearchModelsResponse` and `SearchModelsHitsHit` ([#672](https://github.com/opensearch-project/opensearch-api-specification/pull/672))
1236

1337
## [0.1.0] - 2024-10-25
1438

DEVELOPER_GUIDE.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
- [Comment on PR](#comment-on-pr)
2727
- [Test Tools (Unit)](#test-tools-unit)
2828
- [Test Tools (Integration)](#test-tools-integration)
29-
- [Validate Spec](#validate-spec)
29+
- [Validate Spec (Lint)](#validate-spec-lint)
30+
- [Validate Spec (Python)](#validate-spec-python)
31+
- [Validate Spec (Ruby)](#validate-spec-ruby)
3032
<!-- TOC -->
3133

3234
# Developer Guide
@@ -375,6 +377,30 @@ This workflow runs on PRs to invoke the [tools' unit tests](tools/tests), upload
375377

376378
This workflow runs on PRs to invoke the [tools' integration tests](tools/tests) that require a running instance of OpenSearch to ensure there are no breakages in behavior.
377379

378-
### [Validate Spec](.github/workflows/validate-spec.yml)
380+
### [Validate Spec (Lint)](.github/workflows/validate-spec-lint.yml)
379381

380382
This workflow runs on PRs to invoke the [spec linter](#spec-linter) and ensure the multi-file spec is correct and follows the design guidelines.
383+
384+
### [Validate Spec (Python)](.github/workflows/validate-spec-py.yml)
385+
386+
This workflow runs on PRs to invoke the [Python openapi-spec-validator](https://pypi.org/project/openapi-spec-validator/) to ensure that the resulting spec can be loaded by Python tools.
387+
388+
You can run the validator locally as follows after installing [pipenv](https://pipenv.pypa.io/en/latest/installation.html).
389+
390+
```
391+
cd tools/src/validate-spec-py
392+
pipenv install
393+
npm run merge ; pipenv run python validate.py ../../../build/opensearch-openapi.yaml
394+
```
395+
396+
### [Validate Spec (Ruby)](.github/workflows/validate-spec-ruby.yml)
397+
398+
This workflow runs on PRs to invoke the Ruby [Json Schemer](https://github.com/davishmcclurg/json_schemer/) to ensure that the resulting spec can be loaded by Ruby tools.
399+
400+
You can run the validator locally as follows.
401+
402+
```
403+
cd tools/src/validate-spec-ruby
404+
bundle install
405+
npm run merge ; bundle exec ruby validate.rb ../../../build/opensearch-openapi.yaml
406+
```

README.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
[![Test Tools (Unit)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-tools-unit.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-tools-unit.yml)
77
[![Test Tools (Integration)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-tools-integ.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-tools-integ.yml)
88
[![Test Spec](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-spec.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-spec.yml)
9-
[![Validate Spec](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/validate-spec.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/validate-spec.yml)
9+
[![Validate Spec](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/validate-spec-lint.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/validate-spec-lint.yml)
1010

1111
- [OpenSearch API Specification](#opensearch-api-specification)
1212
- [Welcome!](#welcome)
13+
- [OpenSearch API Source of Truth](#opensearch-api-source-of-truth)
14+
- [Working in this Repo](#working-in-this-repo)
1315
- [Project Resources](#project-resources)
1416
- [Code of Conduct](#code-of-conduct)
1517
- [Security](#security)
@@ -18,10 +20,15 @@
1820

1921
## Welcome!
2022

21-
The `opensearch-api-specification` is an open source, community-driven collection of API model specifications for [OpenSearch](https://github.com/opensearch-project/OpenSearch) APIs. The API models are written in OpenAPI format and are used to generate client libraries and documentation. You can find the latest version of the API specification [here](https://github.com/opensearch-project/opensearch-api-specification/releases/download/main-latest/opensearch-openapi.yaml).
23+
The `opensearch-api-specification` is an open source, community-driven collection of API model specifications for [OpenSearch](https://github.com/opensearch-project/OpenSearch) APIs. The API models are written in OpenAPI format and are used to generate client libraries and documentation. You can find the latest release of the API specification [here](https://github.com/opensearch-project/opensearch-api-specification/releases).
2224

23-
To contribute to this project or to track the developments head over to [Projects](https://github.com/opensearch-project/opensearch-api-specification/projects) board. Follow the [Developer guide](DEVELOPER_GUIDE.md) and [Contributing guidelines](CONTRIBUTING.md) for instructions
24-
on building and contributing to opensearch-api-specification.
25+
### OpenSearch API Source of Truth
26+
27+
This repo aims to be the complete source of truth for OpenSearch and OpenSearch Dashboards REST APIs, including plugins. To be the source of truth, this repo [accurately represents APIs in YAML](spec/), and [publishes](https://github.com/opensearch-project/opensearch-api-specification/releases) a single-file OpenAPI 3.1.0 spec. The latter is used to [generate OpenSearch language clients](https://github.com/opensearch-project/opensearch-clients/issues/19), [generate mechanical parts of the OpenSearch documentation](https://github.com/opensearch-project/documentation-website/issues/7700), and will be used to [generate the OpenSearch server API itself](https://github.com/opensearch-project/OpenSearch/issues/3090).
28+
29+
### Working in this Repo
30+
31+
Because of our legacy, the specification is produced by reading the [OpenSearch documentation](https://opensearch.org/docs/latest/) and reverse-engineering code. Thus, a good place to start contributing to this repo is to [identify a missing API and to add it](https://github.com/opensearch-project/opensearch-api-specification/issues/168) by following the [developer guide](DEVELOPER_GUIDE.md). This repo also contains a set of [test tools](TESTING_GUIDE.md) that ensure the correctness of this API and infrastructure that evaluates the gap between the OpenSearch server and this API spec by comparing REST routes registered in a running OpenSearch to the list of the APIs in this repo. You can see the latest API and test coverage numbers in the comments automatically added to any [recently merged pull requests](https://github.com/opensearch-project/opensearch-api-specification/pulls?q=is%3Apr+is%3Aclosed).
2532

2633
## Project Resources
2734

TESTING_GUIDE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Remember to set the `OPENSEARCH_PASSWORD` or `AWS_ACCESS_KEY_ID` and `AWS_SECRET
9797
9898
#### FORBIDDEN/10/cluster create-index blocked (api)
9999
100-
The cluster is most likely hitting a disk watermark threshold. This example sets the disk watermark thresholds to 1500MB low, 100MB high, and 500MB flood stage, allowing the cluster to create indices even if the disk is almost full.
100+
The cluster is most likely hitting a disk watermark threshold. This example sets the disk watermark thresholds to 1500MB low, 100MB high, and 500MB flood stage, allowing the cluster to create indexes even if the disk is almost full.
101101
102102
```bash
103103
curl -k -X PUT --user "admin:${OPENSEARCH_PASSWORD}" https://localhost:9200/_cluster/settings -H 'Content-Type: application/json' -d'

spec/_global_parameters.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ components:
1010
description: Whether to pretty format the returned JSON response.
1111
schema:
1212
type: boolean
13-
default: false
13+
default: false
1414
human:
1515
name: human
1616
in: query
1717
description: Whether to return human readable values for statistics.
1818
schema:
1919
type: boolean
20-
default: true
20+
default: true
2121
error_trace:
2222
name: error_trace
2323
in: query
2424
description: Whether to include the stack trace of returned errors.
2525
schema:
2626
type: boolean
27-
default: false
27+
default: false
2828
source:
2929
name: source
3030
in: query

0 commit comments

Comments
 (0)