Compare commits

...

25 commits
1.3.1 ... main

Author SHA1 Message Date
Michael Hashizume
f055e1202b
Merge pull request #36 from mhashizume/PA-6510/main/beaker-6
Add support for Beaker 6
2024-05-28 11:33:55 -07:00
Michael Hashizume
c027b1bcef Add support for Beaker 6 2024-05-28 10:59:04 -07:00
Aria Li (she/her)
c309bf02ce
Merge pull request #34 from mhashizume/PUP-11786/main/beaker-bump
(PUP-11786) Beaker 5 compatibility
2024-02-14 17:20:09 -08:00
Michael Hashizume
4f5ee09807 (PUP-11786) Beaker 5 compatibility
Vox Pupuli has released Beaker 5, which drops older (< 2.7) Ruby
compatibility and adds compatibility for Ruby 3.2

This commit adds testing for Ruby 3.2, sets the dependency on
Beaker to ~> 5.0, replaces the File#exists? method that's been
deprecated since Ruby 2.7 and removed in 3.2, and updates the
dependency on FakeFS to the same version that Beaker uses (FakeFS
~> 2.4).
2023-03-27 13:59:30 -07:00
Jake Spain
278515e460
Merge pull request #31 from puppetlabs/add_mend
(RE-15111) Add mend scanning. Update test and release actions
2023-02-10 16:49:12 -05:00
Jake Spain
6acbc08aba
Add mend scanning. Update test and release actions 2023-02-10 16:46:25 -05:00
Jake Spain
d8ea6a2e4c
Merge pull request #29 from puppetlabs/codeowners
Update code owners to RE
2023-01-20 13:27:12 -05:00
5be58b1e82
Update code owners to RE 2023-01-20 13:03:59 -05:00
Samuel
5d04a41003
Merge pull request #23 from puppetlabs/snyk_scan
(DIO-3134) Scan repo with Snyk
2022-05-04 14:38:30 -05:00
suckatrash
596e0d83f9
(DIO-3134) Scan repo with Snyk 2022-05-02 13:49:25 -07:00
e012919f08
Update CODEOWNERS 2022-02-16 09:36:17 -05:00
Jenkins
639255b4de (GEM) update beaker-vmpooler version to 1.4.0 2021-06-15 18:44:52 +00:00
1da71ab4dc
Merge pull request #18 from nmburgan/maint/master/use_ssl_with_https_uri
(maint) Use SSL when pooler_api URL is HTTPS
2021-06-15 14:42:48 -04:00
Nick Burgan-Illig
49f57963bc (maint) Use SSL when pooler_api URL is HTTPS
Since vmpooler supports HTTPS and in some environments, only HTTPS is allowed, this sets Net::HTTP to use SSL when the URI is HTTPS.
2021-06-15 16:09:19 +00:00
bd4ae1ee8e
Merge pull request #21 from puppetlabs/dependabot/bundler/rake-tw-13.0
Update rake requirement from ~> 10.1 to ~> 13.0
2021-06-15 10:28:50 -04:00
dependabot[bot]
252e92ab4f
Update rake requirement from ~> 10.1 to ~> 13.0
Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/rake-10.1.0...v13.0.3)

---
updated-dependencies:
- dependency-name: rake
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-15 14:27:24 +00:00
f6bf085eab
Merge pull request #19 from puppetlabs/gh-actions
Add some GH-based testing
2021-06-15 10:26:45 -04:00
ef72c2399a
Add some GH-based testing 2021-06-15 10:24:28 -04:00
Belén
0c4dc910d3
(MAINT) Add CODEOWNERS file 2019-08-26 09:50:16 -07:00
Michelle Schuknecht
79d0880c5b (MAINT) Add CODEOWNERS file 2019-08-26 06:30:15 -07:00
Jenkins
d54e825506 (GEM) update beaker-vmpooler version to 1.3.3 2019-04-30 16:59:45 +00:00
kirby@puppetlabs.com
4063b01ba0 Revert "Fix the API URL for adding disks"
This reverts commit 64c827fab0.
2019-04-30 09:49:19 -07:00
Jenkins
a504de0ae4 (GEM) update beaker-vmpooler version to 1.3.2 2019-04-22 16:40:14 +00:00
mattkirby
b463b50cbe
Merge pull request #15 from jwjs36987/fix_disk_url
(maint) Fix the API URL for adding disks
2019-04-22 09:29:17 -07:00
Jack Stone
64c827fab0 Fix the API URL for adding disks
The pooling_api variable already contains /api/v1 so remove this from
the disk API URL so we don't end up with it twice
2019-04-15 10:51:06 +01:00
10 changed files with 126 additions and 15 deletions

7
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10

39
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Release
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'puppetlabs/beaker-vmpooler'
steps:
- uses: actions/checkout@v3
- name: Get Version
id: gv
run: |
version=$(grep VERSION lib/beaker-vmpooler/version.rb |rev |cut -d "'" -f2 |rev)
echo "version=$version" >> $GITHUB_OUTPUT
echo "Found version $version from lib/beaker-vmpooler/version.rb"
- name: Tag Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.gv.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false
generateReleaseNotes: true
- name: Install Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Build gem
run: gem build *.gemspec
- name: Publish gem
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem push *.gem
env:
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'

39
.github/workflows/security.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Security
on:
workflow_dispatch:
push:
branches:
- main
jobs:
scan:
name: Mend Scanning
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
# setup a package lock if one doesn't exist, otherwise do nothing
- name: check lock
run: '[ -f "Gemfile.lock" ] && echo "package lock file exists, skipping" || bundle lock'
# install java
- uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
# download mend
- name: download_mend
run: curl -o wss-unified-agent.jar https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
- name: run mend
run: java -jar wss-unified-agent.jar
env:
WS_APIKEY: ${{ secrets.MEND_API_KEY }}
WS_WSS_URL: https://saas-eu.whitesourcesoftware.com/agent
WS_USERKEY: ${{ secrets.MEND_TOKEN }}
WS_PRODUCTNAME: RE
WS_PROJECTNAME: ${{ github.event.repository.name }}

26
.github/workflows/testing.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Testing
on:
pull_request:
branches:
- main
jobs:
spec_tests:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run spec tests
run: bundle exec rake test

2
CODEOWNERS Normal file
View file

@ -0,0 +1,2 @@
* @puppetlabs/release-engineering

11
Gemfile
View file

@ -1,8 +1,6 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org" source ENV['GEM_SOURCE'] || "https://rubygems.org"
gemspec gemspec :development_group => :acceptance_testing
def location_for(place, fake_version = nil) def location_for(place, fake_version = nil)
if place =~ /^(git:[^#]*)#(.*)/ if place =~ /^(git:[^#]*)#(.*)/
@ -14,14 +12,13 @@ def location_for(place, fake_version = nil)
end end
end end
# We don't put beaker in as a test dependency because we # We don't put beaker in as a test dependency because we
# don't want to create a transitive dependency # don't want to create a transitive dependency
group :acceptance_testing do group :acceptance_testing do
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.0') gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 5.0', '< 7')
gem "beaker-abs"
end end
if File.exist? "#{__FILE__}.local"
if File.exists? "#{__FILE__}.local"
eval(File.read("#{__FILE__}.local"), binding) eval(File.read("#{__FILE__}.local"), binding)
end end

View file

@ -20,13 +20,8 @@ Gem::Specification.new do |s|
# Testing dependencies # Testing dependencies
s.add_development_dependency 'rspec', '~> 3.0' s.add_development_dependency 'rspec', '~> 3.0'
s.add_development_dependency 'rspec-its' s.add_development_dependency 'rspec-its'
# pin fakefs for Ruby < 2.3 s.add_development_dependency 'fakefs', '~> 2.4'
if RUBY_VERSION < "2.3" s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'fakefs', '~> 0.6', '< 0.14'
else
s.add_development_dependency 'fakefs', '~> 0.6'
end
s.add_development_dependency 'rake', '~> 10.1'
s.add_development_dependency 'simplecov' s.add_development_dependency 'simplecov'
s.add_development_dependency 'pry', '~> 0.10' s.add_development_dependency 'pry', '~> 0.10'

View file

@ -1,3 +1,3 @@
module BeakerVmpooler module BeakerVmpooler
VERSION = '1.3.1' VERSION = '1.4.0'
end end

View file

@ -114,6 +114,7 @@ module Beaker
uri = URI.parse(@options['pooling_api'] + '/vm/') uri = URI.parse(@options['pooling_api'] + '/vm/')
http = Net::HTTP.new(uri.host, uri.port) http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Post.new(uri.request_uri) request = Net::HTTP::Post.new(uri.request_uri)
if @credentials[:vmpooler_token] if @credentials[:vmpooler_token]
@ -185,6 +186,7 @@ module Beaker
uri = URI.parse(@options[:pooling_api] + '/vm/' + h['vmhostname'].split('.')[0]) uri = URI.parse(@options[:pooling_api] + '/vm/' + h['vmhostname'].split('.')[0])
http = Net::HTTP.new(uri.host, uri.port) http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Put.new(uri.request_uri) request = Net::HTTP::Put.new(uri.request_uri)
# merge pre-defined tags with host tags # merge pre-defined tags with host tags
@ -250,6 +252,7 @@ module Beaker
uri = URI.parse(get_template_url(@options['pooling_api'], name)) uri = URI.parse(get_template_url(@options['pooling_api'], name))
http = Net::HTTP.new( uri.host, uri.port ) http = Net::HTTP.new( uri.host, uri.port )
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Delete.new(uri.request_uri) request = Net::HTTP::Delete.new(uri.request_uri)
if @credentials[:vmpooler_token] if @credentials[:vmpooler_token]
@ -277,6 +280,7 @@ module Beaker
uri = URI.parse(@options[:pooling_api] + '/api/v1/vm/' + hostname + '/disk/' + disk_size.to_s) uri = URI.parse(@options[:pooling_api] + '/api/v1/vm/' + hostname + '/disk/' + disk_size.to_s)
http = Net::HTTP.new(uri.host, uri.port) http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Post.new(uri.request_uri) request = Net::HTTP::Post.new(uri.request_uri)
request['X-AUTH-TOKEN'] = @credentials[:vmpooler_token] request['X-AUTH-TOKEN'] = @credentials[:vmpooler_token]
@ -309,6 +313,7 @@ module Beaker
uri = URI.parse(@options[:pooling_api] + '/vm/' + hostname) uri = URI.parse(@options[:pooling_api] + '/vm/' + hostname)
http = Net::HTTP.new(uri.host, uri.port) http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.instance_of?(URI::HTTPS)
request = Net::HTTP::Get.new(uri.request_uri) request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request) response = http.request(request)

View file

@ -5,6 +5,7 @@ module Beaker
before :each do before :each do
stub_const( "Net", MockNet ) stub_const( "Net", MockNet )
allow_any_instance_of(MockNet::HTTP).to receive(:use_ssl=)
allow( JSON ).to receive( :parse ) do |arg| allow( JSON ).to receive( :parse ) do |arg|
arg arg
end end