fix: Preserve all manual changes to API_ROOT files for now #82
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.
Currently,
build_gen
overwritesAPI_ROOT
build files (e.g.google/cloud/library/BUILD.bazel
as opposed togoogle/cloud/library/v1/BUILD.bazel
) because we aren't building anything substantial in that directory. That is changing, however: Ruby wrapper libraries are scoped to the API root rather than a service version, and their build rules should be located here.We will ideally want to expand this tool to generate these new build rules. Unfortunately, it will be a bit difficult, because the settings in the
ruby_cloud_gapic_library
rule for a Ruby wrapper requires knowledge about the existence and status of the service versions and their corresponding rules. So for now we're just going to write these rules manually (starting with internal cl/402717660). This means we need to disablebuild_gen
's overwriting of these files if they already exist, to prevent the mostly-empty default from clobbering our work. That's the change in this PR. If the file is not already present, the default file will still be created. Later, when we're confident in the rules' stability and our ability to generate them reasonably, we'll update this generator to generate them.