Skip to content

A platform for community discussion. Free, open, simple.

DEV: Disable GPG signing in version bump rake task tests (#35737)

Rafael dos Santos Silva3e9546933b8d
diff --git a/lib/tasks/version_bump.rake b/lib/tasks/version_bump.rake
index 3dcaa8cf4f6..3a6f7b39b86 100644
--- a/lib/tasks/version_bump.rake
+++ b/lib/tasks/version_bump.rake
@@ -50,6 +50,7 @@ end
def git(*args, allow_failure: false, silent: false)
puts "> git #{args.inspect}" unless silent
+ args.prepend(*%w[-c commit.gpgsign=false]) if test_mode?
stdout, stderr, status = Open3.capture3({ "LEFTHOOK" => "0" }, "git", *args)
if !status.success? && !allow_failure
raise "Command failed: git #{args.inspect}\n#{stdout.indent(2)}\n#{stderr.indent(2)}"
diff --git a/spec/tasks/version_bump_spec.rb b/spec/tasks/version_bump_spec.rb
index 35f86071816..f4accbf4f5b 100644
--- a/spec/tasks/version_bump_spec.rb
+++ b/spec/tasks/version_bump_spec.rb
@@ -33,12 +33,12 @@ RSpec.describe "tasks/version_bump" do
run "git", "init"
run "git", "checkout", "-b", "main"
run "git", "add", "."
- run "git", "commit", "-m", "Initial commit"
+ run "git", "-c", "commit.gpgsign=false", "commit", "-m", "Initial commit"
run "git", "checkout", "-b", "stable"
File.write("#{origin_path}/lib/version.rb", fake_version_rb("3.1.2"))
run "git", "add", "."
- run "git", "commit", "-m", "Previous stable version bump"
+ run "git", "-c", "commit.gpgsign=false", "commit", "-m", "Previous stable version bump"
run "git", "checkout", "main"
run "git", "config", "receive.denyCurrentBranch", "ignore"
@@ -192,16 +192,16 @@ RSpec.describe "tasks/version_bump" do
File.write("firstfile.txt", "contents")
run "git", "add", "firstfile.txt"
- run "git", "commit", "-m", "security fix one, commit one"
+ run "git", "-c", "commit.gpgsign=false", "commit", "-m", "security fix one, commit one"
File.write("secondfile.txt", "contents")
run "git", "add", "secondfile.txt"
- run "git", "commit", "-m", "security fix one, commit two"
+ run "git", "-c", "commit.gpgsign=false", "commit", "-m", "security fix one, commit two"
run "git", "checkout", "main"
run "git", "checkout", "-b", "security-fix-two"
File.write("somefile.txt", "contents")
run "git", "add", "somefile.txt"
- run "git", "commit", "-m", "security fix two"
+ run "git", "-c", "commit.gpgsign=false", "commit", "-m", "security fix two"
end
Dir.chdir(local_path) do