ci(gapic-generator-typescript): install system protoc for generator tests#8003
Open
GautamSharda wants to merge 5 commits intomainfrom
Open
ci(gapic-generator-typescript): install system protoc for generator tests#8003GautamSharda wants to merge 5 commits intomainfrom
GautamSharda wants to merge 5 commits intomainfrom
Conversation
This change completely removes the Bazel dependency from the gapic-generator-typescript project. All Bazel configuration files have been deleted and package.json scripts have been updated to use the standard TypeScript compiler (tsc) directly. Bazel was originally introduced to export build rules for the googleapis monorepo. However, following the consolidation of the generator into google-cloud-node/core, Bazel is no longer necessary and adds significant overhead (e.g., 4+ minute installations via npm run compile). Since tsc provides all the compilation functionality needed natively, stripping Bazel simplifies the toolchain and significantly speeds up CI pipelines without losing capabilities. To verify this change does not break functionality, the project was locally compiled successfully using `npx tsc -p .` in under 7 seconds. The test scripts were also run, and the overall Librarian CI workflow has been verified to pass with these changes, confirming that the generator builds and executes correctly without Bazel. For googleapis/librarian#4593
# Conflicts: # core/generator/gapic-generator-typescript/.bazeliskrc # core/generator/gapic-generator-typescript/.bazelrc # core/generator/gapic-generator-typescript/WORKSPACE # core/generator/gapic-generator-typescript/repositories.bzl
…outside of bazel This PR improves the robustness of the generator scripts so they can execute successfully outside of a Bazel sandbox environment. When the generator is invoked directly (e.g., via tsc and node), it previously failed due to missing executable permissions on protoc-plugin.js, strict file path checks for the system protoc binary, and crashes when parsing modern protos without the --experimental_editions flag. This commit addresses those by: - Dynamically applying chmod +x to the generated plugin script. - Trusting the system PATH for protoc (bypassing fs.existsSync for the string 'protoc'). - Explicitly passing --experimental_editions to protoc. - Explicitly invoking the baseline tests with the node runtime to avoid shebang permission issues.
…ests This PR explicitly installs the protoc (v25.3) binary into the GitHub Actions runner environment for gapic-generator-typescript tests. Currently, the generator-tests.yaml workflow relies on Bazel to download, compile, and manage the protoc binary from source. This compilation adds significant overhead to the CI pipeline (4+ minutes). By downloading the pre-compiled binary directly to /usr/local/bin/protoc, we make the system-level protoc instantly available to the runner. This is Part 2 of 3 in the broader effort to completely remove Bazel from the generator (For #4593, see full vision in PR #<INSERT_BIG_PR_NUMBER>). Pre-installing this system dependency prepares the CI environment for the final removal of Bazel, ensuring the tests can still compile protos natively in the next step.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR explicitly installs the
protoc(v25.3) binary into the GitHub Actions runner environment forgapic-generator-typescripttests.Currently, the
generator-tests.yamlworkflow relies on Bazel to download, compile, and manage theprotocbinary from source. This compilation adds significant overhead to the CI pipeline (4+ minutes). By downloading the pre-compiled binary directly to/usr/local/bin/protoc, we make the system-levelprotocinstantly available to the runner.This is Part 2 of 3 in the broader effort to completely remove Bazel from the generator (For googleapis/librarian#4593
). Pre-installing this system dependency prepares the CI environment for the final removal of Bazel, ensuring the tests can still compile protos natively in the next step.