Skip to content

Commit 4653c96

Browse files
committed
Checkout latest protobuf version for report
1 parent c721c2d commit 4653c96

3 files changed

Lines changed: 13 additions & 28 deletions

File tree

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,20 @@ 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
105+
- name: Convert protobuf
112106
run: |
113-
cd cloned-repo
114-
./mvnw clean package
107+
java -jar tools/bin/openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
115108
116-
- name: Convert protobuf
109+
- name: Check for auto-pr-branch and use its protos if exists
117110
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
111+
# Check if auto-pr-branch exists
112+
if git ls-remote --exit-code --heads origin auto-pr-branch > /dev/null 2>&1; then
113+
echo "Found auto-pr-branch, using its proto files for comparison"
114+
git fetch origin auto-pr-branch
115+
git checkout origin/auto-pr-branch -- protos/schemas/
116+
else
117+
echo "auto-pr-branch not found, using main branch proto files"
118+
fi
119119
120120
- name: Post Process Protobuf (dry-run for report)
121121
id: merge_report

.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

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)