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
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
Rather than passing --stamp everywhere, use a proper config so that we can easily add additional flags.
I've broken out a remote_release config which builds things remotely and then downloads the artifacts given on the command line to the local machine. This only makes sense for targets which we do notrun (as run happens locally, so we'd need to rebuild any artifacts anyway)
PR Type
enhancement
Description
Enhanced Bazel configurations by adding --compilation_mode=opt to the build:release and introducing a new build:remote_release configuration for remote builds.
Updated Rake tasks to replace --stamp with --config=release, ensuring consistent use of Bazel release configurations across different language tasks.
Modified tasks to use --config=remote_release for remote execution, improving build efficiency.
Changes walkthrough 📝
Relevant files
Enhancement
.bazelrc
Enhance Bazel configurations for release builds
.bazelrc
Added --compilation_mode=opt to build:release.
Introduced build:remote_release configuration for remote builds.
Rather than passing `--stamp` everywhere, use a proper config
so that we can easily add additional flags.
I've broken out a `remote_release` config which builds things
remotely and then downloads the artifacts given on the command
line to the local machine. This only makes sense for targets
which we do _not_ `run` (as `run` happens locally, so we'd
need to rebuild any artifacts anyway)
Configuration Change The new remote_release configuration combines release and remote configs. Ensure this doesn't cause unexpected behavior in the build process.
Build Configuration Verify that replacing --stamp with --config=release or --config=remote_release maintains all necessary build information and doesn't break any existing functionality.
Add checks for required environment variables in the java:release task
In the java:release task, consider adding a check to ensure that the required environment variables (MAVEN_REPO and GPG_SIGN) are set before proceeding with the release process. This can help prevent issues caused by missing configuration.
ENV['MAVEN_REPO'] = "https://oss.sonatype.org/#{repo}"
ENV['GPG_SIGN'] = (!nightly).to_s
++raise "MAVEN_REPO is not set" if ENV['MAVEN_REPO'].nil? || ENV['MAVEN_REPO'].empty?+raise "GPG_SIGN is not set" if ENV['GPG_SIGN'].nil? || ENV['GPG_SIGN'].empty?
Rake::Task['java:version'].invoke if nightly
Rake::Task['java:package'].invoke('--config=release')
Rake::Task['java:build'].invoke('--config=release')
Apply this suggestion
Suggestion importance[1-10]: 9
Why: Ensuring that required environment variables are set before proceeding with the release process is crucial for preventing issues caused by missing configuration, making this a high-priority improvement.
9
Add a check for the NUGET_API_KEY environment variable in the dotnet:release task
In the dotnet:release task, consider adding a check to ensure that the NUGET_API_KEY environment variable is set before attempting to use it. This can help prevent errors and provide a more informative message if the key is missing.
api_key = ENV.fetch('NUGET_API_KEY', nil)
+raise "NUGET_API_KEY environment variable is not set" if api_key.nil?
push_destination = 'https://api.nuget.org/v3/index.json'
if nightly
Apply this suggestion
Suggestion importance[1-10]: 9
Why: Checking for the NUGET_API_KEY environment variable before use is essential for preventing errors and providing informative messages if the key is missing, significantly improving error prevention.
9
Error handling
Add error handling to the java-release-zip task
Consider adding error handling for the Bazel.execute call in the java-release-zip task. This will help catch and report any issues that may occur during the build process.
task :'java-release-zip' do
- Rake::Task['java:package'].invoke('--config=remote_release')+ begin+ Rake::Task['java:package'].invoke('--config=remote_release')+ rescue StandardError => e+ puts "Error during java-release-zip task: #{e.message}"+ raise+ end
end
Apply this suggestion
Suggestion importance[1-10]: 8
Why: Adding error handling for the Bazel.execute call in the java-release-zip task is important for catching and reporting issues during the build process, enhancing robustness and reliability.
8
Maintainability
Add a comment to explain the purpose of the release configuration
Consider adding a comment explaining the purpose of the release configuration, especially the --compilation_mode=opt flag. This will help other developers understand the optimization level used for release builds.
Why: Adding a comment to explain the purpose of the release configuration improves code maintainability and helps other developers understand the optimization level used for release builds, but it is not crucial for functionality.
…4423)
Rather than passing `--stamp` everywhere, use a proper config
so that we can easily add additional flags.
I've broken out a `remote_release` config which builds things
remotely and then downloads the artifacts given on the command
line to the local machine. This only makes sense for targets
which we do _not_ `run` (as `run` happens locally, so we'd
need to rebuild any artifacts anyway)
Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
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.
User description
Rather than passing
--stamp
everywhere, use a proper config so that we can easily add additional flags.I've broken out a
remote_release
config which builds things remotely and then downloads the artifacts given on the command line to the local machine. This only makes sense for targets which we do notrun
(asrun
happens locally, so we'd need to rebuild any artifacts anyway)PR Type
enhancement
Description
--compilation_mode=opt
to thebuild:release
and introducing a newbuild:remote_release
configuration for remote builds.--stamp
with--config=release
, ensuring consistent use of Bazel release configurations across different language tasks.--config=remote_release
for remote execution, improving build efficiency.Changes walkthrough 📝
.bazelrc
Enhance Bazel configurations for release builds
.bazelrc
--compilation_mode=opt
tobuild:release
.build:remote_release
configuration for remote builds.Rakefile
Update Rake tasks to use Bazel release configs
Rakefile
--stamp
with--config=release
in various tasks.--config=remote_release
for remote execution.