-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Theo Truong <theotr@amazon.com>
- Loading branch information
Showing
661 changed files
with
12,693 additions
and
24,361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Generate API from Spec | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * 0" # Every Sunday at midnight GMT | ||
jobs: | ||
generate-api: | ||
if: ${{ github.repository == 'opensearch-project/opensearch-ruby' }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./api_generator | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Config git to rebase | ||
run: git config --global pull.rebase true | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1 | ||
|
||
- name: Update bundler | ||
run: | | ||
sudo apt-get update | ||
bundle install | ||
- name: Generate API | ||
run: |- | ||
bundle exec rake download_spec | ||
bundle exec rake generate_api | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
|
||
- name: GitHub App token | ||
id: github_app_token | ||
uses: tibdex/github-app-token@v2.1.0 | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Create pull request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ steps.github_app_token.outputs.token }} | ||
commit-message: "Updated opensearch-ruby to reflect the latest OpenSearch API spec (${{ env.date }})" | ||
title: "[AUTOCUT] Update opensearch-ruby to reflect the latest OpenSearch API spec (${{ env.date }})" | ||
body: | | ||
Update `opensearch-ruby` to reflect the latest [OpenSearch API spec](https://github.com/opensearch-project/opensearch-api-specification/releases/download/main-latest/opensearch-openapi.yaml). | ||
Date: ${{ env.date }} | ||
branch: update-api-from-spec-${{ env.date }} | ||
base: main | ||
signoff: true | ||
labels: | | ||
autocut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
opensearch-openapi.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require: rubocop-rake | ||
AllCops: | ||
Include: | ||
- 'lib/**/*.rb' | ||
- 'Rakefile' | ||
NewCops: enable | ||
|
||
Metrics/CyclomaticComplexity: | ||
Enabled: false | ||
Metrics/MethodLength: | ||
Enabled: false | ||
Metrics/AbcSize: | ||
Enabled: false | ||
Metrics/PerceivedComplexity: | ||
Enabled: false | ||
Layout/EmptyLineAfterGuardClause: | ||
Enabled: false | ||
Style/MultilineBlockChain: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# frozen_string_literal: true | ||
|
||
require 'rake' | ||
require 'active_support/all' | ||
|
||
task :download_spec do | ||
sh 'curl -L -X GET "https://github.com/opensearch-project/opensearch-api-specification/releases/download/main-latest/opensearch-openapi.yaml" -o opensearch-openapi.yaml' | ||
end | ||
|
||
|
||
task :generate_api do | ||
require './lib/generator' | ||
generator = Generator.new('./opensearch-openapi.yaml', '../') | ||
generator.generate | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'rake' | ||
gem 'rubocop', '~> 1.44', require: false | ||
gem 'rubocop-rspec', require: false | ||
gem 'rubocop-rake', require: false | ||
gem 'mustache', '~> 1' | ||
gem 'activesupport', '~> 7' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
activesupport (7.2.1) | ||
base64 | ||
bigdecimal | ||
concurrent-ruby (~> 1.0, >= 1.3.1) | ||
connection_pool (>= 2.2.5) | ||
drb | ||
i18n (>= 1.6, < 2) | ||
logger (>= 1.4.2) | ||
minitest (>= 5.1) | ||
securerandom (>= 0.3) | ||
tzinfo (~> 2.0, >= 2.0.5) | ||
ast (2.4.2) | ||
base64 (0.2.0) | ||
bigdecimal (3.1.8) | ||
concurrent-ruby (1.3.4) | ||
connection_pool (2.4.1) | ||
drb (2.2.1) | ||
i18n (1.14.6) | ||
concurrent-ruby (~> 1.0) | ||
json (2.7.2) | ||
language_server-protocol (3.17.0.3) | ||
logger (1.6.1) | ||
minitest (5.25.1) | ||
mustache (1.1.1) | ||
parallel (1.26.3) | ||
parser (3.3.5.0) | ||
ast (~> 2.4.1) | ||
racc | ||
racc (1.8.1) | ||
rainbow (3.1.1) | ||
rake (13.2.1) | ||
regexp_parser (2.9.2) | ||
rubocop (1.66.1) | ||
json (~> 2.3) | ||
language_server-protocol (>= 3.17.0) | ||
parallel (~> 1.10) | ||
parser (>= 3.3.0.2) | ||
rainbow (>= 2.2.2, < 4.0) | ||
regexp_parser (>= 2.4, < 3.0) | ||
rubocop-ast (>= 1.32.2, < 2.0) | ||
ruby-progressbar (~> 1.7) | ||
unicode-display_width (>= 2.4.0, < 3.0) | ||
rubocop-ast (1.32.3) | ||
parser (>= 3.3.1.0) | ||
rubocop-rake (0.6.0) | ||
rubocop (~> 1.0) | ||
rubocop-rspec (2.11.1) | ||
rubocop (~> 1.19) | ||
ruby-progressbar (1.13.0) | ||
securerandom (0.3.1) | ||
tzinfo (2.0.6) | ||
concurrent-ruby (~> 1.0) | ||
unicode-display_width (2.6.0) | ||
|
||
PLATFORMS | ||
ruby | ||
x86_64-darwin-22 | ||
|
||
DEPENDENCIES | ||
activesupport (~> 7) | ||
mustache (~> 1) | ||
rake | ||
rubocop (~> 1.44) | ||
rubocop-rake | ||
rubocop-rspec | ||
|
||
BUNDLED WITH | ||
2.5.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This file is generated from the OpenSearch REST API spec. | ||
# Do not modify it by hand. Instead, modify the generator or the spec. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. |
Oops, something went wrong.