You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The frontend's protobuf TypeScript bindings are committed to the repo and ship in the source release. They are not generated from the .proto files at build time.
They are generated by hand with bin/frontend-proto-gen.sh (protoc + ts-proto). No build step or CI job runs that script or checks that the committed output matches the .proto files. The Python bindings, by contrast, are generated during the build by bin/python-proto-gen.sh (see build.yml, which installs the protoc version pinned in bin/protoc-version.txt) and are not committed.
Problems with this:
The source release ships generated code whose source isn't in the release.google/protobuf/descriptor.ts is generated from Google's google/protobuf/descriptor.proto (BSD-3-Clause), which reaches the generator through the import in scalapb.proto. That .proto comes from protoc's own include path and is not in the source tarball, so the release ships about 6.8k lines of generated code, including the comments copied from Google's .proto, without the source it came from. ASF source releases should contain the source, with generated artefacts produced by the build.
They drift. Nothing keeps the committed .ts files in sync with common/workflow-core/src/main/protobuf/**. They have already gone stale once and had to be fixed (fix: regenerate protobuf files in the frontend #4334). A .proto change that misses a manual regeneration builds without error and leaves the frontend and backend disagreeing about the wire types.
They need special handling for licence headers. All four are listed in .licenserc.yamlpaths-ignore, so those exemptions have to be maintained for files that shouldn't be in the source tree at all.
Suggested fix: generate the frontend bindings during the build, the same way the Python ones are.
Run bin/frontend-proto-gen.sh (or an equivalent yarn script, e.g. a prebuild / prestart hook) as part of the frontend build, using the pinned bin/protoc-version.txt protoc and the ts-proto version already in devDependencies.
Delete frontend/src/app/common/type/proto/ from git, add it to .gitignore, and remove its entries from .licenserc.yaml.
Make sure the frontend CI jobs and bin/texera-web-application.dockerfile install protoc before building.
If generating at build time isn't wanted, the minimum fix is a CI check that regenerates the files and fails on git diff. That stops the drift, but point 1 would remain.
Related: the scalapb options file common/workflow-core/src/main/protobuf/scalapb/scalapb.proto is vendored from ScalaPB (Apache-2.0) but carries an ASF header and is missing from LICENSE. That's a separate fix, along the lines of #8775.
How to reproduce?
B=https://dist.apache.org/repos/dist/dev/incubator/texera/1.2.1-incubating-RC1
curl -sO $B/apache-texera-1.2.1-incubating-src.tar.gz
tar xzf apache-texera-1.2.1-incubating-src.tar.gz
cd apache-texera-1.2.1-incubating-src
find frontend/src/app/common/type/proto -name '*.ts'
head -5 frontend/src/app/common/type/proto/google/protobuf/descriptor.ts # "source: google/protobuf/descriptor.proto"
find . -name descriptor.proto # not shipped
Version/Branch
1.2.1-incubating-RC1 (same layout on release/v1.3 and main)
What happened?
The frontend's protobuf TypeScript bindings are committed to the repo and ship in the source release. They are not generated from the
.protofiles at build time.They are generated by hand with
bin/frontend-proto-gen.sh(protoc +ts-proto). No build step or CI job runs that script or checks that the committed output matches the.protofiles. The Python bindings, by contrast, are generated during the build bybin/python-proto-gen.sh(seebuild.yml, which installs the protoc version pinned inbin/protoc-version.txt) and are not committed.Problems with this:
google/protobuf/descriptor.tsis generated from Google'sgoogle/protobuf/descriptor.proto(BSD-3-Clause), which reaches the generator through the import inscalapb.proto. That.protocomes from protoc's own include path and is not in the source tarball, so the release ships about 6.8k lines of generated code, including the comments copied from Google's.proto, without the source it came from. ASF source releases should contain the source, with generated artefacts produced by the build..tsfiles in sync withcommon/workflow-core/src/main/protobuf/**. They have already gone stale once and had to be fixed (fix: regenerate protobuf files in the frontend #4334). A.protochange that misses a manual regeneration builds without error and leaves the frontend and backend disagreeing about the wire types..licenserc.yamlpaths-ignore, so those exemptions have to be maintained for files that shouldn't be in the source tree at all.Suggested fix: generate the frontend bindings during the build, the same way the Python ones are.
bin/frontend-proto-gen.sh(or an equivalentyarnscript, e.g. aprebuild/prestarthook) as part of the frontend build, using the pinnedbin/protoc-version.txtprotoc and thets-protoversion already indevDependencies.frontend/src/app/common/type/proto/from git, add it to.gitignore, and remove its entries from.licenserc.yaml.bin/texera-web-application.dockerfileinstall protoc before building.If generating at build time isn't wanted, the minimum fix is a CI check that regenerates the files and fails on
git diff. That stops the drift, but point 1 would remain.Related: the scalapb options file
common/workflow-core/src/main/protobuf/scalapb/scalapb.protois vendored from ScalaPB (Apache-2.0) but carries an ASF header and is missing fromLICENSE. That's a separate fix, along the lines of #8775.How to reproduce?
Version/Branch
1.2.1-incubating-RC1 (same layout on release/v1.3 and main)
Commit Hash
3f760c8