Skip to content

Commit 66f52d6

Browse files
committed
Speed up the proto conversion workflow by using a pre-built openapi-generator jar
Signed-off-by: xil <fridalu66@gmail.com>
1 parent 2235650 commit 66f52d6

7 files changed

Lines changed: 12 additions & 2992 deletions

File tree

.github/workflows/backward-compatible-report.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,14 @@ jobs:
102102
OPENSEARCH_VERSION: ${{ steps.get_opensearch_version.outputs.version }}
103103
run: npm ci && npm run preprocessing -- --opensearch-version "$OPENSEARCH_VERSION"
104104

105-
- name: Clone Protobuf Generator Repository
105+
- name: Download openapi-generator JAR
106106
run: |
107-
git clone https://github.com/OpenAPITools/openapi-generator cloned-repo
108-
cd cloned-repo
109-
git checkout 6699ecd9d2f4e0868f23bb36566ea03cd1230e6a
110-
111-
- name: Build Protobuf Generator Tool
112-
run: |
113-
cd cloned-repo
114-
./mvnw clean package
107+
curl -L -f -o openapi-generator-cli.jar \
108+
https://github.com/opensearch-project/opensearch-protobufs/releases/download/openapi-generator-tool/openapi-generator-cli.jar
115109
116110
- name: Convert protobuf
117111
run: |
118-
java -jar cloned-repo/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
112+
java -jar openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
119113
120114
- name: Check for auto-pr-branch and use its protos if exists
121115
run: |

.github/workflows/convert-proto.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
auto-proto-convert:
1515
runs-on: ubuntu-latest
16-
if: github.repository == 'opensearch-project/opensearch-protobufs'
16+
#if: github.repository == 'opensearch-project/opensearch-protobufs'
1717
steps:
1818
- name: Checkout Repository
1919
uses: actions/checkout@v4
@@ -104,20 +104,14 @@ jobs:
104104
OPENSEARCH_VERSION: ${{ steps.get_opensearch_version.outputs.version }}
105105
run: npm ci && npm run preprocessing -- --opensearch-version "$OPENSEARCH_VERSION"
106106

107-
- name: Clone Protobuf Generator Repository
107+
- name: Download openapi-generator JAR
108108
run: |
109-
git clone https://github.com/OpenAPITools/openapi-generator cloned-repo
110-
cd cloned-repo
111-
git checkout 6699ecd9d2f4e0868f23bb36566ea03cd1230e6a
112-
113-
- name: Build Protobuf Generator Tool
114-
run: |
115-
cd cloned-repo
116-
./mvnw clean package
109+
curl -L -f -o openapi-generator-cli.jar \
110+
https://github.com/opensearch-project/opensearch-protobufs/releases/download/openapi-generator-tool/openapi-generator-cli.jar
117111
118112
- name: Convert protobuf
119113
run: |
120-
java -jar cloned-repo/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
114+
java -jar openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
121115
122116
- name: Post Process Protobuf
123117
id: merge_report

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ maven_output/
6767
Thumbs.db
6868

6969
# proto conversion
70-
protos/generated/.openapi-generator/
71-
protos/generated/.openapi-generator-ignore
70+
protos/generated
7271
/cloned-repo
7372
opensearch-openapi.yaml

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1212
- Fix enum value annotations not being preserved ([#353](https://github.com/opensearch-project/opensearch-protobufs/pull/353))
1313
- Preserve comments on versioned fields and Rename "REMOVED" to "DEPRECATED" in reports ([#355](https://github.com/opensearch-project/opensearch-protobufs/pull/355))
1414
- Updates the backward compatibility report workflow to compare against the latest proto files ([#356](https://github.com/opensearch-project/opensearch-protobufs/pull/356))
15+
- Speed up the proto conversion workflow by using a pre-built openapi-generator-cli.jar ([#357](https://github.com/opensearch-project/opensearch-protobufs/pull/357))
16+
1517
### Removed
1618

1719
### Fixed

0 commit comments

Comments
 (0)