From a906a1881212e20189eeb3211a6ed85d4b17cd64 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 22 Jul 2019 12:26:55 -0700 Subject: Remove old jenkins testing files Signed-off-by: Tim Smith --- ci/jenkins_run_tests.bat | 14 -------------- ci/jenkins_run_tests.sh | 13 ------------- 2 files changed, 27 deletions(-) delete mode 100644 ci/jenkins_run_tests.bat delete mode 100755 ci/jenkins_run_tests.sh diff --git a/ci/jenkins_run_tests.bat b/ci/jenkins_run_tests.bat deleted file mode 100644 index 9483952..0000000 --- a/ci/jenkins_run_tests.bat +++ /dev/null @@ -1,14 +0,0 @@ -ruby -v - -call bundle check - -if %ERRORLEVEL% NEQ 0 ( - call rm Gemfile.lock - call bundle install --without docgen --path vendor/bundle -) - -bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f documentation spec - -set RSPEC_ERRORLVL=%ERRORLEVEL% -REM Return the error level from rspec -exit /B %RSPEC_ERRORLVL% diff --git a/ci/jenkins_run_tests.sh b/ci/jenkins_run_tests.sh deleted file mode 100755 index 5bf7def..0000000 --- a/ci/jenkins_run_tests.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -export PATH=$PATH:/usr/local/bin - -ruby -v; -# remove the Gemfile.lock and try again if bundler fails. -# This should take care of Gemfile changes that result in "bad" bundles without forcing us to rebundle every time -bundle install --without docgen --path vendor/bundle || ( rm Gemfile.lock && bundle install --path vendor/bundle ) -bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f documentation spec; -RSPEC_RETURNCODE=$? - -# exit with the result of running rspec -exit $RSPEC_RETURNCODE -- cgit v1.2.1 From 36164633f416e97100c863b1e088d34b40b5738e Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 22 Jul 2019 12:27:40 -0700 Subject: Use consistent gemfile groups This makes it easier to diff our configs Signed-off-by: Tim Smith --- .expeditor/verify.pipeline.yml | 10 +++++----- Gemfile | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index a29049b..b0fff38 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -3,7 +3,7 @@ steps: - label: run-lint-and-specs-ruby-2.2 command: - export USER="root" - - bundle install --jobs=7 --retry=3 --without docs development style + - bundle install --jobs=7 --retry=3 --without docs debug style - bundle exec rake spec expeditor: executor: @@ -13,7 +13,7 @@ steps: - label: run-lint-and-specs-ruby-2.3 command: - export USER="root" - - bundle install --jobs=7 --retry=3 --without docs development + - bundle install --jobs=7 --retry=3 --without docs debug - bundle exec rake expeditor: executor: @@ -23,7 +23,7 @@ steps: - label: run-lint-and-specs-ruby-2.4 command: - export USER="root" - - bundle install --jobs=7 --retry=3 --without docs development + - bundle install --jobs=7 --retry=3 --without docs debug - bundle exec rake expeditor: executor: @@ -32,8 +32,8 @@ steps: - label: run-lint-and-specs-ruby-2.5 command: - - bundle install --jobs=7 --retry=3 --without docs development - export USER="root" + - bundle install --jobs=7 --retry=3 --without docs debug - bundle exec rake expeditor: executor: @@ -43,7 +43,7 @@ steps: - label: run-lint-and-specs-ruby-2.6 command: - export USER="root" - - bundle install --jobs=7 --retry=3 --without docs development + - bundle install --jobs=7 --retry=3 --without docs debug - bundle exec rake expeditor: executor: diff --git a/Gemfile b/Gemfile index 8928d2c..fae2931 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ group :test do gem "rake" end -group :development do +group :debug do gem "pry" gem "pry-byebug" gem "pry-stack_explorer" -- cgit v1.2.1 From 5804b90e01c461b2f264c95c6699edc4913e5908 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 22 Jul 2019 12:28:17 -0700 Subject: Replace Appvyeor with Buildkite for Windows PR testing Make buildkite the source of truth Signed-off-by: Tim Smith --- .expeditor/verify.pipeline.yml | 15 ++++++++++++++ README.md | 2 +- appveyor.yml | 47 ------------------------------------------ 3 files changed, 16 insertions(+), 48 deletions(-) delete mode 100644 appveyor.yml diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index b0fff38..3f46d3a 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -1,3 +1,9 @@ +--- +expeditor: + defaults: + buildkite: + timeout_in_minutes: 30 + steps: - label: run-lint-and-specs-ruby-2.2 @@ -49,3 +55,12 @@ steps: executor: docker: image: ruby:2.6-stretch + +- label: run-specs-windows + command: + - bundle install --jobs=7 --retry=3 --without docs debug + - bundle exec rake + expeditor: + executor: + docker: + host_os: windows diff --git a/README.md b/README.md index 82cb0a3..7c3cb20 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Mixlib::ShellOut -[![Build Status Master](https://ci.appveyor.com/api/projects/status/github/chef/mixlib-shellout?branch=master&svg=true&passingText=master%20-%20Ok&pendingText=master%20-%20Pending&failingText=master%20-%20Failing)](https://ci.appveyor.com/project/Chef/mixlib-shellout/branch/master) [![Build Status](https://badge.buildkite.com/7051b7b35cc19076c35a6e6a9e996807b0c14475ca3f3acd86.svg)](https://buildkite.com/chef-oss/chef-mixlib-shellout-master-verify) [![Gem Version](https://badge.fury.io/rb/mixlib-shellout.svg)](https://badge.fury.io/rb/mixlib-shellout) +[![Build Status](https://badge.buildkite.com/7051b7b35cc19076c35a6e6a9e996807b0c14475ca3f3acd86.svg)](https://buildkite.com/chef-oss/chef-mixlib-shellout-master-verify) [![Gem Version](https://badge.fury.io/rb/mixlib-shellout.svg)](https://badge.fury.io/rb/mixlib-shellout) **Umbrella Project**: [Chef Foundation](https://github.com/chef/chef-oss-practices/blob/master/projects/chef-foundation.md) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index e029cd2..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: "master-{build}" - -os: Windows Server 2012 R2 -platform: - - x64 - -cache: - - vendor/bundle -environment: - matrix: - - ruby_version: "23" - - ruby_version: "23-x64" - - ruby_version: "24-x64" - - ruby_version: "25-x64" - - ruby_version: "26-x64" - -clone_folder: c:\projects\mixlib-shellout -clone_depth: 1 -skip_tags: true -branches: - only: - - master - -skip_commits: - # version bumps by Expeditor happen as a separate commit after the merge, we can skip - author: Chef Expeditor - # if ONLY the files listed below are changed in a commit, skip - files: - - MAINTAINERS.md - - MAINTAINERS.toml - - CHANGELOG.md - - RELEASE_NOTES.md - -install: - - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% - - echo %PATH% - - ruby --version - - gem update --system - - gem --version - - gem install bundler --quiet --no-document - - bundler --version - -build_script: - - bundle install --jobs=7 --retry=3 --without docs development - -test_script: - - bundle exec rspec -- cgit v1.2.1 From 26cb37535f4f1f46bf91469caa3fbc45738643de Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 19 Dec 2019 20:13:03 -0800 Subject: Test on Ruby 2.7 + random testing improvements Update the Github templates to use multiple labels Use Gem caching our BK Add Ruby 2.7 testing Use Debian 10 Ruby containers not Debian 9 Signed-off-by: Tim Smith --- .expeditor/config.yml | 3 ++ .expeditor/run_linux_tests.sh | 53 +++++++++++++++++++++++++++++++ .expeditor/verify.pipeline.yml | 30 +++++++++-------- .github/CODEOWNERS | 4 +-- .github/ISSUE_TEMPLATE/BUG_TEMPLATE.md | 2 +- .github/ISSUE_TEMPLATE/DESIGN_PROPOSAL.md | 2 +- 6 files changed, 77 insertions(+), 17 deletions(-) create mode 100755 .expeditor/run_linux_tests.sh diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 7032e6c..a3d4b3d 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -1,5 +1,6 @@ # Documentation available at https://expeditor.chef.io/docs/getting-started/ --- + # Slack channel in Chef Software slack to send notifications about build failures, etc slack: notify_channel: chef-found-notify @@ -12,6 +13,8 @@ rubygems: github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true + # The tag format to use (e.g. v1.0.0) + version_tag_format: "v{{version}}" # allow bumping the minor release via label minor_bump_labels: - "Expeditor: Bump Version Minor" diff --git a/.expeditor/run_linux_tests.sh b/.expeditor/run_linux_tests.sh new file mode 100755 index 0000000..4c14c80 --- /dev/null +++ b/.expeditor/run_linux_tests.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# This script runs a passed in command, but first setups up the bundler caching on the repo + +set -ue + +export USER="root" + +echo "--- dependencies" +export LANG=C.UTF-8 LANGUAGE=C.UTF-8 +S3_URL="s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}" + +pull_s3_file() { + aws s3 cp "${S3_URL}/$1" "$1" || echo "Could not pull $1 from S3" +} + +push_s3_file() { + if [ -f "$1" ]; then + aws s3 cp "$1" "${S3_URL}/$1" || echo "Could not push $1 to S3 for caching." + fi +} + +apt-get update -y +apt-get install awscli -y + +echo "--- bundle install" +pull_s3_file "bundle.tar.gz" +pull_s3_file "bundle.sha256" + +if [ -f bundle.tar.gz ]; then + tar -xzf bundle.tar.gz +fi + +if [ -n "${RESET_BUNDLE_CACHE:-}" ]; then + rm bundle.sha256 +fi + +bundle config --local path vendor/bundle +bundle install --jobs=7 --retry=3 + +echo "--- bundle cache" +if test -f bundle.sha256 && shasum --check bundle.sha256 --status; then + echo "Bundled gems have not changed. Skipping upload to s3" +else + echo "Bundled gems have changed. Uploading to s3" + shasum -a 256 Gemfile.lock > bundle.sha256 + tar -czf bundle.tar.gz vendor/ + push_s3_file bundle.tar.gz + push_s3_file bundle.sha256 +fi + +echo "+++ bundle exec task" +bundle exec $1 diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 3f46d3a..57afa06 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -9,8 +9,7 @@ steps: - label: run-lint-and-specs-ruby-2.2 command: - export USER="root" - - bundle install --jobs=7 --retry=3 --without docs debug style - - bundle exec rake spec + - .expeditor/run_linux_tests.sh rake expeditor: executor: docker: @@ -19,8 +18,7 @@ steps: - label: run-lint-and-specs-ruby-2.3 command: - export USER="root" - - bundle install --jobs=7 --retry=3 --without docs debug - - bundle exec rake + - .expeditor/run_linux_tests.sh rake expeditor: executor: docker: @@ -29,32 +27,38 @@ steps: - label: run-lint-and-specs-ruby-2.4 command: - export USER="root" - - bundle install --jobs=7 --retry=3 --without docs debug - - bundle exec rake + - .expeditor/run_linux_tests.sh rake expeditor: executor: docker: - image: ruby:2.4-stretch + image: ruby:2.4-buster - label: run-lint-and-specs-ruby-2.5 command: - export USER="root" - - bundle install --jobs=7 --retry=3 --without docs debug - - bundle exec rake + - .expeditor/run_linux_tests.sh rake expeditor: executor: docker: - image: ruby:2.5-stretch + image: ruby:2.5-buster - label: run-lint-and-specs-ruby-2.6 command: - export USER="root" - - bundle install --jobs=7 --retry=3 --without docs debug - - bundle exec rake + - .expeditor/run_linux_tests.sh rake + expeditor: + executor: + docker: + image: ruby:2.6-buster + +- label: run-lint-and-specs-ruby-2.7rc + command: + - export USER="root" + - .expeditor/run_linux_tests.sh rake expeditor: executor: docker: - image: ruby:2.6-stretch + image: ruby:2.7-rc-buster - label: run-specs-windows command: diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f1217b3..950afb7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ # Order is important. The last matching pattern has the most precedence. -* @chef/chef-foundation-reviewers -.expeditor/** @chef/jex-team +* @chef/chef-foundation-owners @chef/chef-foundation-approvers @chef/chef-foundation-reviewers +.expeditor/ @chef/jex-team *.md @chef/docs-team diff --git a/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md b/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md index f28915b..87ac9b4 100644 --- a/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/BUG_TEMPLATE.md @@ -1,7 +1,7 @@ --- name: � Bug Report about: If something isn't working as expected �. -labels: "Status: Untriaged" +labels: "Status: Untriaged, Type: Bug" --- # Version: diff --git a/.github/ISSUE_TEMPLATE/DESIGN_PROPOSAL.md b/.github/ISSUE_TEMPLATE/DESIGN_PROPOSAL.md index 9f4a958..9508b09 100644 --- a/.github/ISSUE_TEMPLATE/DESIGN_PROPOSAL.md +++ b/.github/ISSUE_TEMPLATE/DESIGN_PROPOSAL.md @@ -1,7 +1,7 @@ --- name: Design Proposal about: I have a significant change I would like to propose and discuss before starting -labels: "Status: Untriaged" +labels: "Status: Untriaged, Type: Design Proposal" --- ### When a Change Needs a Design Proposal -- cgit v1.2.1 From e79e60b2dab8c3e489fd3b03c53ef9aa6a7dd0c2 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 19 Dec 2019 20:23:27 -0800 Subject: Make sure we still support Ruby 2.2 Reasons Signed-off-by: Tim Smith --- .rubocop.yml | 3 +++ Gemfile | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f3a8913..e9fb15f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,6 @@ +AllCops: + TargetRubyVersion: 2.2 + Lint/UnderscorePrefixedVariableName: Exclude: - 'spec/mixlib/shellout/windows_spec.rb' diff --git a/Gemfile b/Gemfile index fae2931..8d32ed0 100644 --- a/Gemfile +++ b/Gemfile @@ -8,12 +8,8 @@ group :docs do gem "github-markup" end -# added to its own group so we can exclude for Ruby 2.2 -group :style do - gem "chefstyle" -end - group :test do + gem "chefstyle", "~> 0.12.0" # still supports Ruby 2.2 TargetRubyVersion gem "rspec", "~> 3.0" gem "rake" end -- cgit v1.2.1 From 2c8a87206cbb3ca5bf0ff63286ee6844797b6bc1 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 19 Dec 2019 20:31:38 -0800 Subject: Another Ruby 2.2 pin Signed-off-by: Tim Smith --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 8d32ed0..bf33195 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,7 @@ end group :debug do gem "pry" - gem "pry-byebug" + gem "pry-byebug", "~> 3.6.0" # Pinned for ruby 2.2 gem "pry-stack_explorer" gem "rb-readline" end -- cgit v1.2.1 From d150d02ed25010be4b5dfeaf0a2e40e96a01deae Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 19 Dec 2019 20:46:28 -0800 Subject: Fix chefstyle pin for Ruby 2.2 Signed-off-by: Tim Smith --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index bf33195..b2cec2c 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ group :docs do end group :test do - gem "chefstyle", "~> 0.12.0" # still supports Ruby 2.2 TargetRubyVersion + gem "chefstyle", "~> 0.11.0" # still supports Ruby 2.2 TargetRubyVersion gem "rspec", "~> 3.0" gem "rake" end -- cgit v1.2.1