Skip to content

Commit 7fcb2fe

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 7fcb2fe

6 files changed

Lines changed: 6 additions & 29 deletions

File tree

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,9 @@ 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
106-
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
115-
116105
- name: Convert protobuf
117106
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
107+
java -jar tools/bin/openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
119108
120109
- name: Check for auto-pr-branch and use its protos if exists
121110
run: |

.github/workflows/convert-proto.yml

Lines changed: 2 additions & 13 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,9 @@ 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
108-
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
117-
118107
- name: Convert protobuf
119108
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
109+
java -jar tools/bin/openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
121110
122111
- name: Post Process Protobuf
123112
id: merge_report

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ maven_output/
5858
# Gradle
5959
.gradle/
6060
!gradle-wrapper.jar
61+
!tools/bin/openapi-generator-cli.jar
6162

6263
# Logs
6364
*.log

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
29 MB
Binary file not shown.

tools/proto-convert/src/SchemaModifier.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,6 @@ export class SchemaModifier {
588588
const prop = schema.properties[propName] as any;
589589
if (prop && typeof prop === 'object') {
590590
prop['x-oneof-property'] = true;
591-
592-
if ('$ref' in prop) {
593-
this.markReferencedSchemaAsOneof(prop.$ref);
594-
}
595591
}
596592
}
597593
}

0 commit comments

Comments
 (0)