Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
gaobinlong committed Jul 23, 2024
2 parents 8c74476 + 34ff292 commit 0de8c79
Show file tree
Hide file tree
Showing 49 changed files with 1,062 additions and 344 deletions.
1 change: 1 addition & 0 deletions .cspell
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ aarch
actiongroup
actiongroups
aggregatable
argjson
asciifolding
authc
authinfo
Expand Down
3 changes: 2 additions & 1 deletion .github/opensearch-cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ services:
environment:
- 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!}'
- discovery.type=single-node
- path.repo=/tmp/opensearch/repo
- path.repo=/tmp/opensearch/repo
- plugins.index_state_management.job_interval=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Spec Test Coverage Analysis
{{with .test_coverage}}

| Total | Tested |
|-------------------|----------------------------------------------------------|
| {{.paths_count}} | {{.evaluated_paths_count}} ({{.evaluated_paths_pct}} %) |

{{end}}
3 changes: 2 additions & 1 deletion .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
workflow_run:
workflows:
- Analyze PR Changes
- Test Spec
types:
- completed

Expand Down Expand Up @@ -71,4 +72,4 @@ jobs:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ env.PR_NUMBER }}
body: ${{ steps.render.outputs.result }}
edit-mode: replace
edit-mode: replace
59 changes: 58 additions & 1 deletion .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,61 @@ jobs:
run: docker-compose up -d

- name: Run Tests
run: npm run test:spec -- --opensearch-insecure
run: |
npm run test:spec -- --opensearch-insecure --coverage coverage/test-spec-coverage-${{ matrix.entry.version }}.json
- name: Upload Test Coverage Results
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.entry.version }}
path: coverage/test-spec-coverage-${{ matrix.entry.version }}.json

merge-coverage:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: test-opensearch-spec
steps:
- uses: actions/checkout@v3

- name: Download Spec Coverage Data
uses: actions/download-artifact@v4
with:
path: coverage

- name: Combine Test Coverage Data
shell: bash -eo pipefail {0}
run: |
jq -sc '
map(to_entries) |
flatten |
group_by(.key) |
map({key: .[0].key, value: map(.value) | max}) |
from_entries |
.' $(find ./coverage -name "test-spec-coverage-*.json") > ./coverage/coverage.json
cat ./coverage/coverage.json
- name: Construct Comment Data Payload
shell: bash -eo pipefail {0}
run: |
jq \
--arg pr_number ${PR_NUMBER} \
--slurpfile test_coverage ./coverage/coverage.json \
--null-input '
{
"pr_number": ($pr_number),
"comment_identifier": "# Test Coverage Analysis",
"template_name": "pr-test-coverage-analysis",
"template_data": {
"test_coverage": ($test_coverage[0])
}
}
' | tee pr-comment.json
env:
PR_NUMBER: ${{ github.event.pull_request.number }}

- name: Upload PR Comment Payload
uses: actions/upload-artifact@v4
with:
name: pr-comment
path: pr-comment.json
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added missing metrics options to `/_nodes/stats` ([#422](https://github.com/opensearch-project/opensearch-api-specification/pull/422))
- Added tests against OpenSearch 1.3 ([#424](https://github.com/opensearch-project/opensearch-api-specification/pull/424))
- Added `is_hidden` to `/{index}/_alias/{name}` and `/{index}/_aliases/{name}` ([#429](https://github.com/opensearch-project/opensearch-api-specification/pull/429))
- Added `ignore_unmapped` to `GeoDistanceQuery` ([#427](https://github.com/opensearch-project/opensearch-api-specification/pull/427))
- Added missing variants of `indices.put_alias` ([#434](https://github.com/opensearch-project/opensearch-api-specification/pull/434))
- Added `plugins` to NodeInfoSettings ([#442](https://github.com/opensearch-project/opensearch-api-specification/pull/442))
- Added test coverage ([#443](https://github.com/opensearch-project/opensearch-api-specification/pull/443))

### Changed

Expand All @@ -59,6 +63,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Replaced the deprecated fs.rmdirSync with fs.rmSync ([#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359))
- Tester tool now provides better context for non-2XX responses when --verbose is used ([#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359))
- Lock testing for next release of OpenSearch to a specific SHA ([#431](https://github.com/opensearch-project/opensearch-api-specification/pull/431))
- Replace nullable with null type ([#436](https://github.com/opensearch-project/opensearch-api-specification/pull/436))

### Deprecated

Expand All @@ -85,6 +90,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed query DSL `match` that supports a field name and value ([#405](https://github.com/opensearch-project/opensearch-api-specification/pull/405))
- Fixed `/_mapping` with `index` in query ([#385](https://github.com/opensearch-project/opensearch-api-specification/pull/385))
- Fixed duplicate `/_nodes/{node_id}` path ([#416](https://github.com/opensearch-project/opensearch-api-specification/pull/416))
- Fixed `_source` accepting an array of fields in `/_search` ([#430](https://github.com/opensearch-project/opensearch-api-specification/pull/430))

### Security

Expand Down
132 changes: 128 additions & 4 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ paths:
responses:
'200':
$ref: '#/components/responses/indices.get_alias@200'
put:
operationId: indices.put_alias.0
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases
parameters:
- $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.master_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.timeout'
requestBody:
$ref: '#/components/requestBodies/indices.put_alias'
responses:
'200':
$ref: '#/components/responses/indices.put_alias@200'
/_alias/{name}:
get:
operationId: indices.get_alias.1
Expand Down Expand Up @@ -53,6 +69,40 @@ paths:
responses:
'200':
$ref: '#/components/responses/indices.exists_alias@200'
post:
operationId: indices.put_alias.1
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases
parameters:
- $ref: '#/components/parameters/indices.put_alias::path.name'
- $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.master_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.timeout'
requestBody:
$ref: '#/components/requestBodies/indices.put_alias'
responses:
'200':
$ref: '#/components/responses/indices.put_alias@200'
put:
operationId: indices.put_alias.2
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases
parameters:
- $ref: '#/components/parameters/indices.put_alias::path.name'
- $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.master_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.timeout'
requestBody:
$ref: '#/components/requestBodies/indices.put_alias'
responses:
'200':
$ref: '#/components/responses/indices.put_alias@200'
/_aliases:
post:
operationId: indices.update_aliases.0
Expand All @@ -70,6 +120,41 @@ paths:
responses:
'200':
$ref: '#/components/responses/indices.update_aliases@200'
/_aliases/{name}:
post:
operationId: indices.put_alias.3
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases
parameters:
- $ref: '#/components/parameters/indices.put_alias::path.name'
- $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.master_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.timeout'
requestBody:
$ref: '#/components/requestBodies/indices.put_alias'
responses:
'200':
$ref: '#/components/responses/indices.put_alias@200'
put:
operationId: indices.put_alias.4
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases
parameters:
- $ref: '#/components/parameters/indices.put_alias::path.name'
- $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.master_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.timeout'
requestBody:
$ref: '#/components/requestBodies/indices.put_alias'
responses:
'200':
$ref: '#/components/responses/indices.put_alias@200'
/_analyze:
get:
operationId: indices.analyze.0
Expand Down Expand Up @@ -958,6 +1043,23 @@ paths:
responses:
'200':
$ref: '#/components/responses/indices.get_alias@200'
put:
operationId: indices.put_alias.5
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases
parameters:
- $ref: '#/components/parameters/indices.put_alias::path.index'
- $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.master_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.timeout'
requestBody:
$ref: '#/components/requestBodies/indices.put_alias'
responses:
'200':
$ref: '#/components/responses/indices.put_alias@200'
/{index}/_alias/{name}:
get:
operationId: indices.get_alias.3
Expand Down Expand Up @@ -994,7 +1096,7 @@ paths:
'200':
$ref: '#/components/responses/indices.exists_alias@200'
post:
operationId: indices.put_alias.0
operationId: indices.put_alias.6
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
Expand All @@ -1012,7 +1114,7 @@ paths:
'200':
$ref: '#/components/responses/indices.put_alias@200'
put:
operationId: indices.put_alias.1
operationId: indices.put_alias.7
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
Expand Down Expand Up @@ -1045,9 +1147,27 @@ paths:
responses:
'200':
$ref: '#/components/responses/indices.delete_alias@200'
/{index}/_aliases:
put:
operationId: indices.put_alias.8
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases
parameters:
- $ref: '#/components/parameters/indices.put_alias::path.index'
- $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.master_timeout'
- $ref: '#/components/parameters/indices.put_alias::query.timeout'
requestBody:
$ref: '#/components/requestBodies/indices.put_alias'
responses:
'200':
$ref: '#/components/responses/indices.put_alias@200'
/{index}/_aliases/{name}:
post:
operationId: indices.put_alias.2
operationId: indices.put_alias.9
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
Expand All @@ -1065,7 +1185,7 @@ paths:
'200':
$ref: '#/components/responses/indices.put_alias@200'
put:
operationId: indices.put_alias.3
operationId: indices.put_alias.10
x-operation-group: indices.put_alias
x-version-added: '1.0'
description: Creates or updates an alias.
Expand Down Expand Up @@ -1845,8 +1965,12 @@ components:
schema:
type: object
properties:
alias:
type: string
filter:
$ref: '../schemas/_common.query_dsl.yaml#/components/schemas/QueryContainer'
index:
type: string
index_routing:
$ref: '../schemas/_common.yaml#/components/schemas/Routing'
is_write_index:
Expand Down
Loading

0 comments on commit 0de8c79

Please sign in to comment.