Skip to content

Commit

Permalink
Missing commit incl gems and fixes to gem build/release
Browse files Browse the repository at this point in the history
  • Loading branch information
jhongturney committed Aug 14, 2024
1 parent 0bd26d0 commit 4101f67
Show file tree
Hide file tree
Showing 47 changed files with 28 additions and 36 deletions.
28 changes: 10 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (7.2.0)
activesupport (7.1.3.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
Expand All @@ -39,11 +38,8 @@ GEM
facter (4.6.1)
hocon (~> 1.3)
thor (>= 1.0.1, < 2.0)
faraday (2.10.1)
faraday-net_http (>= 2.0, < 3.2)
logger
faraday-net_http (3.1.1)
net-http
faraday (2.0.0)
ruby2_keywords (>= 0.0.4)
fast_gettext (2.4.0)
prime
forwardable (1.3.3)
Expand All @@ -59,15 +55,12 @@ GEM
json (2.7.2)
language_server-protocol (3.17.0.3)
locale (2.1.4)
logger (1.6.0)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.24.1)
multi_json (1.15.0)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
net-http (0.4.1)
uri
multi_xml (0.6.0)
mutex_m (0.2.0)
net-ssh (7.2.3)
octocatalog-diff (2.1.0)
diffy (>= 3.1.0)
Expand All @@ -88,7 +81,7 @@ GEM
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (6.0.1)
public_suffix (5.1.1)
puppet (7.30.0)
concurrent-ruby (~> 1.0)
deep_merge (~> 1.0)
Expand Down Expand Up @@ -150,12 +143,12 @@ GEM
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rugged (1.7.2)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
scanf (1.0.0)
securerandom (0.3.1)
semantic_puppet (1.1.0)
simplecov (0.22.0)
docile (~> 1.1)
Expand All @@ -172,7 +165,6 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
uri (0.13.0)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion doc/octofacts-updater.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This document will help you address all of these security and automation non-opt
The easiest way to get started with `octofacts-updater` is to download and install our "quickstart" configuration file. In the git repo, this is found at [/examples/config/quickstart.yaml](/examples/config/quickstart.yaml). If you'd like to download the latest version directly from GitHub, you can use wget, like this:

```
wget -O octofacts-updater.yaml https://raw.githubusercontent.com/github/octofacts/master/examples/config/quickstart.yaml
wget -O octofacts-updater.yaml https://raw.githubusercontent.com/github/octofacts/main/examples/config/quickstart.yaml
```

## Data sources
Expand Down
20 changes: 10 additions & 10 deletions rake/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
##
## 1. Update `.version` with new version number
## 2. Run `script/bootstrap` to update Gemfile.lock
## 3. Commit changes, PR, and merge to master
## 4. Check out master branch locally
## 3. Commit changes, PR, and merge to main
## 4. Check out main branch locally
## 5. Run `bundle exec rake gem:release`
# frozen_string_literal: true
require "fileutils"
Expand Down Expand Up @@ -90,7 +90,7 @@ def self.tag

# Tag it
exec_command("git tag #{Shellwords.escape(version)}")
exec_command("git push origin master")
exec_command("git push origin main")
exec_command("git push origin #{Shellwords.escape(version)}")
end

Expand All @@ -116,8 +116,8 @@ def self.exec_command(command)
namespace :gem do
task "build" do
branch = Octofacts::Gem.branch
unless branch == "master"
raise "On a non-master branch #{branch}; use gem:force-build if you really want to do this"
unless branch == "main"
raise "On a non-main branch #{branch}; use gem:force-build if you really want to do this"
end
Octofacts::Gem.build
end
Expand All @@ -128,8 +128,8 @@ def self.exec_command(command)

task "force-build" do
branch = Octofacts::Gem.branch
unless branch == "master"
warn "WARNING: Force-building from non-master branch #{branch}"
unless branch == "main"
warn "WARNING: Force-building from non-main branch #{branch}"
end
Octofacts::Gem.build
end
Expand All @@ -140,15 +140,15 @@ def self.exec_command(command)

task "release" do
branch = Octofacts::Gem.branch
unless branch == "master"
raise "On a non-master branch #{branch}; refusing to release"
unless branch == "main"
raise "On a non-main branch #{branch}; refusing to release"
end
[:check, :build, :tag, :push].each { |t| Rake::Task["gem:#{t}"].invoke }
end

task "tag" do
branch = Octofacts::Gem.branch
raise "On a non-master branch #{branch}; refusing to tag" unless branch == "master"
raise "On a non-main branch #{branch}; refusing to tag" unless branch == "main"
Octofacts::Gem.tag
end

Expand Down
14 changes: 7 additions & 7 deletions spec/octofacts_updater/service/github_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
end

describe "#ensure_branch_exists" do
let(:cfg) { { "github" => { "branch" => "foo", "repository" => "example/repo", "default_branch" => "master" } } }
let(:cfg) { { "github" => { "branch" => "foo", "repository" => "example/repo", "default_branch" => "main" } } }
let(:octokit) { double("Octokit") }
let(:subject) { described_class.new(cfg) }

Expand All @@ -264,26 +264,26 @@
context "when branch does not exist" do
it "should create branch of Octokit::NotFound is raised" do
allow(octokit).to receive(:branch).with("example/repo", "foo").and_raise(Octokit::NotFound)
allow(octokit).to receive(:branch).with("example/repo", "master").and_return(commit: { sha: "00abcdef" })
allow(octokit).to receive(:branch).with("example/repo", "main").and_return(commit: { sha: "00abcdef" })
expect(octokit).to receive(:create_ref).with("example/repo", "heads/foo", "00abcdef")
expect(subject).to receive(:verbose).with("Created branch foo based on master 00abcdef.")
expect(subject).to receive(:verbose).with("Created branch foo based on main 00abcdef.")
allow(subject).to receive(:octokit).and_return(octokit)
expect(subject.send(:ensure_branch_exists)).to eq(true)
end

it "should create branch if .branch call returns nil" do
allow(octokit).to receive(:branch).with("example/repo", "foo").and_return(nil)
allow(octokit).to receive(:branch).with("example/repo", "master").and_return(commit: { sha: "00abcdef" })
allow(octokit).to receive(:branch).with("example/repo", "main").and_return(commit: { sha: "00abcdef" })
expect(octokit).to receive(:create_ref).with("example/repo", "heads/foo", "00abcdef")
expect(subject).to receive(:verbose).with("Created branch foo based on master 00abcdef.")
expect(subject).to receive(:verbose).with("Created branch foo based on main 00abcdef.")
allow(subject).to receive(:octokit).and_return(octokit)
expect(subject.send(:ensure_branch_exists)).to eq(true)
end
end
end

describe "#find_or_create_pull_request" do
let(:cfg) { { "github" => { "branch" => "foo", "repository" => "example/repo", "default_branch" => "master" } } }
let(:cfg) { { "github" => { "branch" => "foo", "repository" => "example/repo", "default_branch" => "main" } } }
let(:subject) { described_class.new(cfg) }
let(:pr) { OpenStruct.new(html_url: "https://github.com/example/repo/pull/12345") }

Expand All @@ -303,7 +303,7 @@
octokit = double("Octokit")
allow(subject).to receive(:octokit).and_return(octokit)
expect(octokit).to receive(:pull_requests).with("example/repo", {head: "github:foo", state: "open"}).and_return([])
expect(octokit).to receive(:create_pull_request).with("example/repo", "master", "foo", "PR_Subject", "PR_Body").and_return(pr)
expect(octokit).to receive(:create_pull_request).with("example/repo", "main", "foo", "PR_Subject", "PR_Body").and_return(pr)
expect(subject).to receive(:verbose).with("Created a new PR https://github.com/example/repo/pull/12345")
expect(subject).to receive(:pr_subject).and_return("PR_Subject")
expect(subject).to receive(:pr_body).and_return("PR_Body")
Expand Down
Binary file removed vendor/cache/activesupport-7.1.3.2.gem
Binary file not shown.
Binary file added vendor/cache/activesupport-7.1.3.4.gem
Binary file not shown.
Binary file removed vendor/cache/activesupport-7.2.0.gem
Binary file not shown.
Binary file removed vendor/cache/addressable-2.8.6.gem
Binary file not shown.
Binary file removed vendor/cache/bigdecimal-3.1.7.gem
Binary file not shown.
Binary file removed vendor/cache/concurrent-ruby-1.2.3.gem
Binary file not shown.
Binary file removed vendor/cache/docile-1.4.0.gem
Binary file not shown.
Binary file added vendor/cache/faraday-2.0.0.gem
Binary file not shown.
Binary file removed vendor/cache/faraday-2.10.1.gem
Binary file not shown.
Binary file removed vendor/cache/faraday-2.8.1.gem
Binary file not shown.
Binary file removed vendor/cache/faraday-net_http-3.0.2.gem
Binary file not shown.
Binary file removed vendor/cache/faraday-net_http-3.1.1.gem
Binary file not shown.
Binary file removed vendor/cache/fast_gettext-1.8.0.gem
Binary file not shown.
Binary file removed vendor/cache/hashdiff-1.1.0.gem
Binary file not shown.
Binary file removed vendor/cache/httparty-0.21.0.gem
Binary file not shown.
Binary file removed vendor/cache/httpclient-2.8.3.gem
Binary file not shown.
Binary file removed vendor/cache/i18n-1.14.4.gem
Binary file not shown.
Binary file removed vendor/cache/json-2.7.1.gem
Binary file not shown.
Binary file removed vendor/cache/logger-1.6.0.gem
Binary file not shown.
Binary file removed vendor/cache/method_source-1.0.0.gem
Binary file not shown.
Binary file removed vendor/cache/minitest-5.22.3.gem
Binary file not shown.
Binary file removed vendor/cache/multi_xml-0.7.1.gem
Binary file not shown.
Binary file removed vendor/cache/net-http-0.4.1.gem
Binary file not shown.
Binary file removed vendor/cache/net-ssh-7.2.1.gem
Binary file not shown.
Binary file removed vendor/cache/octokit-8.1.0.gem
Binary file not shown.
Binary file removed vendor/cache/parser-3.3.0.5.gem
Binary file not shown.
Binary file removed vendor/cache/public_suffix-5.0.4.gem
Binary file not shown.
Binary file added vendor/cache/public_suffix-5.1.1.gem
Binary file not shown.
Binary file removed vendor/cache/public_suffix-6.0.1.gem
Binary file not shown.
Binary file removed vendor/cache/puppet-6.25.1.gem
Binary file not shown.
Binary file removed vendor/cache/racc-1.7.3.gem
Binary file not shown.
Binary file removed vendor/cache/rack-3.0.10.gem
Binary file not shown.
Binary file removed vendor/cache/regexp_parser-2.9.0.gem
Binary file not shown.
Binary file removed vendor/cache/rexml-3.3.3.gem
Binary file not shown.
Binary file removed vendor/cache/rspec-expectations-3.13.0.gem
Binary file not shown.
Binary file removed vendor/cache/rspec-mocks-3.13.0.gem
Binary file not shown.
Binary file removed vendor/cache/rspec-puppet-2.6.15.gem
Binary file not shown.
Binary file removed vendor/cache/rubocop-1.62.1.gem
Binary file not shown.
Binary file removed vendor/cache/rubocop-ast-1.31.2.gem
Binary file not shown.
Binary file removed vendor/cache/rubocop-performance-1.20.2.gem
Binary file not shown.
Binary file removed vendor/cache/rubocop-rails-2.24.0.gem
Binary file not shown.
Binary file removed vendor/cache/securerandom-0.3.1.gem
Binary file not shown.
Binary file removed vendor/cache/uri-0.13.0.gem
Binary file not shown.

0 comments on commit 4101f67

Please sign in to comment.