From 062a0328a306d9ae60bb3505106d92546110dc1b Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 9 Sep 2024 15:41:36 +0530 Subject: [PATCH 01/38] added plan.sh and plan.ps1 to build chef-vault as hab package Signed-off-by: nikhil2611 --- Gemfile | 7 ++-- chef-vault.gemspec | 2 +- habitat/plan.ps1 | 86 ++++++++++++++++++++++++++++++++++++++++++++++ habitat/plan.sh | 79 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 170 insertions(+), 4 deletions(-) create mode 100644 habitat/plan.ps1 create mode 100644 habitat/plan.sh diff --git a/Gemfile b/Gemfile index 089115f..75b5b37 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ gemspec group :development do gem "chefstyle" gem "rake" + gem "appbundler" if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0.0") gem "contracts", "~> 0.16.1" # pin until we drop ruby < 2.7 gem "chef-zero" @@ -15,11 +16,11 @@ group :development do else gem "contracts", "~> 0.17" gem "chef-zero", ">= 15.0.4" - gem "chef", "~> 17.0" + gem "chef", ">= 18.5.0" gem "rspec", "~> 3.0" gem "aruba", "~> 2.2" - gem "knife", "~> 17.0" - gem "chef-utils", "17.10.68" # pin until we drop ruby >=3 + gem "knife", "~> 18.0" + gem "chef-utils", ">= 18.5.0" # pin until we drop ruby >=3 end end diff --git a/chef-vault.gemspec b/chef-vault.gemspec index 6bfeae6..4576e5a 100644 --- a/chef-vault.gemspec +++ b/chef-vault.gemspec @@ -31,5 +31,5 @@ Gem::Specification.new do |s| s.bindir = "bin" s.executables = %w{ chef-vault } - s.required_ruby_version = ">= 2.7" + s.required_ruby_version = ">= 3.1" end diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 new file mode 100644 index 0000000..4138603 --- /dev/null +++ b/habitat/plan.ps1 @@ -0,0 +1,86 @@ +$ErrorActionPreference = "Stop" +$PSDefaultParameterValues['*:ErrorAction']='Stop' + +$pkg_name="chef-vault" +$pkg_origin="core" +$pkg_version="4.1.12" +$pkg_revision="1" +$pkg_maintainer="The Chef Maintainers " + +$pkg_deps=@( + "chef/ruby31-plus-devkit" + "core/git" +) +$pkg_bin_dirs=@("bin" + "vendor/bin") +$project_root= (Resolve-Path "$PLAN_CONTEXT/../").Path + +function Invoke-SetupEnvironment { + Push-RuntimeEnv -IsPath GEM_PATH "$pkg_prefix/vendor" + + Set-RuntimeEnv APPBUNDLER_ALLOW_RVM "true" # prevent appbundler from clearing out the carefully constructed runtime GEM_PATH + Set-RuntimeEnv FORCE_FFI_YAJL "ext" + Set-RuntimeEnv LANG "en_US.UTF-8" + Set-RuntimeEnv LC_CTYPE "en_US.UTF-8" +} + +function Invoke-Build { + try { + $env:Path += ";c:\\Program Files\\Git\\bin" + Push-Location $project_root + $env:GEM_HOME = "$HAB_CACHE_SRC_PATH/$pkg_dirname/vendor" + + Write-BuildLine " ** Configuring bundler for this build environment" + bundle config --local without integration deploy maintenance + bundle config --local jobs 4 + bundle config --local retry 5 + bundle config --local silence_root_warning 1 + Write-BuildLine " ** Using bundler to retrieve the Ruby dependencies" + bundle install + + gem build chef-vault.gemspec + Write-BuildLine " ** Using gem to install" + gem install chef-vault*.gem --no-document + + + If ($lastexitcode -ne 0) { Exit $lastexitcode } + } finally { + Pop-Location + } +} + +function Invoke-Install { + Write-BuildLine "** Copy built & cached gems to install directory" + Copy-Item -Path "$HAB_CACHE_SRC_PATH/$pkg_dirname/*" -Destination $pkg_prefix -Recurse -Force -Exclude @("gem_make.out", "mkmf.log", "Makefile", + "*/latest", "latest", + "*/JSON-Schema-Test-Suite", "JSON-Schema-Test-Suite") + + try { + Push-Location $pkg_prefix + bundle config --local gemfile $project_root/Gemfile + Write-BuildLine "** generating binstubs for chef-vault with precise version pins" + Write-BuildLine "** generating binstubs for chef-vault with precise version pins $project_root $pkg_prefix/bin " + Invoke-Expression -Command "appbundler.bat $project_root $pkg_prefix/bin chef-vault" + If ($lastexitcode -ne 0) { Exit $lastexitcode } + Write-BuildLine " ** Running the chef-vault project's 'rake install' to install the path-based gems so they look like any other installed gem." + + If ($lastexitcode -ne 0) { Exit $lastexitcode } + } finally { + Pop-Location + } +} + +function Invoke-After { + # We don't need the cache of downloaded .gem files ... + Remove-Item $pkg_prefix/vendor/cache -Recurse -Force + # We don't need the gem docs. + Remove-Item $pkg_prefix/vendor/doc -Recurse -Force + # We don't need to ship the test suites for every gem dependency, + # only inspec's for package verification. + Get-ChildItem $pkg_prefix/vendor/gems -Filter "spec" -Directory -Recurse -Depth 1 ` + | Where-Object -FilterScript { $_.FullName -notlike "*chef-vault*" } ` + | Remove-Item -Recurse -Force + # Remove the byproducts of compiling gems with extensions + Get-ChildItem $pkg_prefix/vendor/gems -Include @("gem_make.out", "mkmf.log", "Makefile") -File -Recurse ` + | Remove-Item -Force +} \ No newline at end of file diff --git a/habitat/plan.sh b/habitat/plan.sh new file mode 100644 index 0000000..cb2af34 --- /dev/null +++ b/habitat/plan.sh @@ -0,0 +1,79 @@ +pkg_name=chef-vault +pkg_origin=core +pkg_version="4.1.12" +pkg_description="Gem that allows you to encrypt a Chef Data Bag Item using the public keys of a list of chef nodes. This allows only those chef nodes to decrypt the encrypted values." +pkg_license=('Apache-2.0') +pkg_deps=( + core/ruby31 + core/bash + core/git +) +pkg_build_deps=( + core/gcc + core/make +) +pkg_bin_dirs=(bin) + +# Setup environment variables for Ruby Gems +do_setup_environment() { + build_line "Setting up GEM_HOME and GEM_PATH" + export GEM_HOME="$pkg_prefix/lib" + export GEM_PATH="$GEM_HOME" +} + +# Unpack the source files into the cache directory +do_unpack() { + local unpack_dir="$HAB_CACHE_SRC_PATH/$pkg_dirname" + build_line "Creating unpack directory: $unpack_dir" + mkdir -pv "$unpack_dir" + cp -RT "$PLAN_CONTEXT"/.. "$unpack_dir/" +} + +# Build the gem from the gemspec file +do_build() { + build_line "Building the gem from the gemspec file" + pushd "$HAB_CACHE_SRC_PATH/$pkg_dirname" > /dev/null + gem build chef-vault.gemspec + popd > /dev/null +} + +# Install the built gem into the package directory +do_install() { + build_line "Installing the gem" + pushd "$HAB_CACHE_SRC_PATH/$pkg_dirname" > /dev/null + gem install chef-vault-*.gem --no-document + popd > /dev/null + + wrap_chef_vault_bin +} + +# Create a wrapper script to properly set paths and execute the chef-vault command +wrap_chef_vault_bin() { + local bin="$pkg_prefix/bin/chef-vault" + local real_bin="$GEM_HOME/gems/chef-vault-${pkg_version}/bin/chef-vault" + build_line "Adding wrapper $bin to $real_bin" + +# build_line "Creating wrapper script: $bin" + cat < "$bin" +#!$(pkg_path_for core/bash)/bin/bash +set -e + +# Set the PATH for chef-vault to include necessary binaries +export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:\$PATH" + +# Set Ruby paths defined from 'do_setup_environment()' +export GEM_HOME="$GEM_HOME" +export GEM_PATH="$GEM_PATH" + +# Execute the chef-vault binary +exec $(pkg_path_for core/ruby31)/bin/ruby $real_bin "\$@" +EOF + + # Ensure the wrapper script is executable + chmod -v 755 "$bin" +} + +# No additional stripping needed +do_strip() { + return 0 +} \ No newline at end of file From a4775f998e21b0b788648fd5bd61db8e5fe53d4e Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 9 Sep 2024 15:52:32 +0530 Subject: [PATCH 02/38] updating min ruby version to 3.1 Signed-off-by: nikhil2611 --- .expeditor/verify.pipeline.yml | 29 ----------------------------- .github/workflows/unit.yml | 4 ++-- Rakefile | 2 +- 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 4155273..53fa4a1 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -11,20 +11,6 @@ expeditor: steps: -- label: run-specs-ruby-2.7 - command: - - .expeditor/run_linux_tests.sh rake - expeditor: - executor: - docker: - image: ruby:2.7 -- label: run-specs-ruby-3.0 - command: - - .expeditor/run_linux_tests.sh rake - expeditor: - executor: - docker: - image: ruby:3.0 - label: run-specs-ruby-3.1 command: - .expeditor/run_linux_tests.sh rake @@ -33,21 +19,6 @@ steps: docker: image: ruby:3.1 -- label: run-specs-ruby-3.0-windows - command: - - .expeditor/run_windows_tests.ps1 - expeditor: - executor: - docker: - host_os: windows - shell: ["powershell", "-Command"] - image: rubydistros/windows-2019:3.0 - user: 'NT AUTHORITY\SYSTEM' - environment: - - FORCE_FFI_YAJL=ext - - EXPIRE_CACHE=true - - CHEF_LICENSE=accept-no-persist - - label: run-specs-ruby-3.1-windows command: - .expeditor/run_windows_tests.ps1 diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 90c43a6..1b97629 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -15,10 +15,10 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - - name: Set up ruby 2.7 + - name: Set up ruby 3.1 uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.1 bundler-cache: true - name: run specs run: bundle exec rake spec --trace diff --git a/Rakefile b/Rakefile index d234851..2a6a2f6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,6 @@ require "bundler/gem_tasks" -WINDOWS_PLATFORM = %w{ x64-mingw32 x64-mingw-ucrt ruby }.freeze +WINDOWS_PLATFORM = /mswin|win32|mingw/.freeze unless defined? WINDOWS_PLATFORM # Style Tests begin From 764a66808c42cf57c7496d35bb2b0363bd728127 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 23 Sep 2024 16:50:03 +0530 Subject: [PATCH 03/38] updated plan.sh Signed-off-by: nikhil2611 --- habitat/plan.sh | 171 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 127 insertions(+), 44 deletions(-) diff --git a/habitat/plan.sh b/habitat/plan.sh index cb2af34..94fe4b9 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -1,76 +1,159 @@ +_chef_client_ruby="core/ruby31" pkg_name=chef-vault -pkg_origin=core -pkg_version="4.1.12" +pkg_origin=ngupta26 pkg_description="Gem that allows you to encrypt a Chef Data Bag Item using the public keys of a list of chef nodes. This allows only those chef nodes to decrypt the encrypted values." pkg_license=('Apache-2.0') -pkg_deps=( - core/ruby31 - core/bash - core/git +pkg_bin_dirs=( + bin + vendor/bin ) pkg_build_deps=( - core/gcc core/make + core/gcc + core/git + core/libarchive +) +pkg_deps=( + $_chef_client_ruby + core/coreutils ) -pkg_bin_dirs=(bin) +pkg_svc_user=root + +pkg_version() { + cat "${SRC_PATH}/VERSION" +} + +do_before() { + do_default_before + update_pkg_version + # We must wait until we update the pkg_version to use the pkg_version + pkg_filename="${pkg_name}-${pkg_version}.tar.gz" +} + +do_download() { + build_line "Locally creating archive of latest repository commit at ${HAB_CACHE_SRC_PATH}/${pkg_filename}" + # source is in this repo, so we're going to create an archive from the + # appropriate path within the repo and place the generated tarball in the + # location expected by do_unpack + ( cd "${SRC_PATH}" || exit_with "unable to enter hab-src directory" 1 + git archive --prefix="${pkg_name}-${pkg_version}/" --output="${HAB_CACHE_SRC_PATH}/${pkg_filename}" HEAD + ) +} + +do_verify() { + build_line "Skipping checksum verification on the archive we just created." + return 0 +} # Setup environment variables for Ruby Gems do_setup_environment() { - build_line "Setting up GEM_HOME and GEM_PATH" - export GEM_HOME="$pkg_prefix/lib" - export GEM_PATH="$GEM_HOME" + push_runtime_env GEM_PATH "${pkg_prefix}/vendor" + + set_runtime_env APPBUNDLER_ALLOW_RVM "true" # prevent appbundler from clearing out the carefully constructed runtime GEM_PATH + set_runtime_env LANG "en_US.UTF-8" + set_runtime_env LC_CTYPE "en_US.UTF-8" } -# Unpack the source files into the cache directory -do_unpack() { - local unpack_dir="$HAB_CACHE_SRC_PATH/$pkg_dirname" - build_line "Creating unpack directory: $unpack_dir" - mkdir -pv "$unpack_dir" - cp -RT "$PLAN_CONTEXT"/.. "$unpack_dir/" +do_prepare() { + export GEM_HOME="${pkg_prefix}/vendor" + export CPPFLAGS="${CPPFLAGS} ${CFLAGS}" + + ( cd "$CACHE_PATH" + bundle config --local jobs "$(nproc)" + bundle config --local without server docgen maintenance pry travis integration ci chefstyle + bundle config --local shebang "$(pkg_path_for "$_chef_client_ruby")/bin/ruby" + bundle config --local retry 5 + bundle config --local silence_root_warning 1 + ) + + build_line "Setting link for /usr/bin/env to 'coreutils'" + if [ ! -f /usr/bin/env ]; then + ln -s "$(pkg_interpreter_for core/coreutils bin/env)" /usr/bin/env + fi } +# Unpack the source files into the cache directory +# do_unpack() { +# local unpack_dir="$HAB_CACHE_SRC_PATH/$pkg_dirname" +# build_line "Creating unpack directory: $unpack_dir" +# mkdir -pv "$unpack_dir" +# cp -RT "$PLAN_CONTEXT"/.. "$unpack_dir/" +# } + # Build the gem from the gemspec file do_build() { - build_line "Building the gem from the gemspec file" - pushd "$HAB_CACHE_SRC_PATH/$pkg_dirname" > /dev/null - gem build chef-vault.gemspec - popd > /dev/null + ( cd "$CACHE_PATH" || exit_with "unable to enter hab-cache directory" 1 + build_line "Installing gem dependencies ..." + bundle install --jobs=3 --retry=3 + build_line "Installing gems from git repos properly ..." + build_line "Installing this project's gems ..." + bundle exec rake install:local + gem install chef-utils chef-config appbundler + ) } # Install the built gem into the package directory do_install() { - build_line "Installing the gem" - pushd "$HAB_CACHE_SRC_PATH/$pkg_dirname" > /dev/null - gem install chef-vault-*.gem --no-document - popd > /dev/null + ( cd "$pkg_prefix" || exit_with "unable to enter pkg prefix directory" 1 + export BUNDLE_GEMFILE="${CACHE_PATH}/Gemfile" + build_line "** fixing binstub shebangs" + fix_interpreter "${pkg_prefix}/vendor/bin/*" "$_chef_client_ruby" bin/ruby + export BUNDLE_GEMFILE="${CACHE_PATH}/Gemfile" + for gem in chef-vault; do + build_line "** generating binstubs for $gem with precise version pins" + appbundler $CACHE_PATH $pkg_prefix/bin $gem + done + ) +} + +do_after() { + build_line "Trimming the fat ..." + + # We don't need the cache of downloaded .gem files ... + rm -rf "$pkg_prefix/vendor/cache" - wrap_chef_vault_bin + rm -r "$pkg_prefix/vendor/bundler" + + # We don't need the gem docs. + rm -rf "$pkg_prefix/vendor/doc" + # We don't need to ship the test suites for every gem dependency, + # only Chef's for package verification. + find "$pkg_prefix/vendor/gems" -name spec -type d | grep -v "chef-vault-${pkg_version}" \ + | while read spec_dir; do rm -rf "$spec_dir"; done } + # Create a wrapper script to properly set paths and execute the chef-vault command -wrap_chef_vault_bin() { - local bin="$pkg_prefix/bin/chef-vault" - local real_bin="$GEM_HOME/gems/chef-vault-${pkg_version}/bin/chef-vault" - build_line "Adding wrapper $bin to $real_bin" +# wrap_chef_vault_bin() { +# local bin="$pkg_prefix/bin/chef-vault" +# local real_bin="$GEM_HOME/gems/chef-vault-${pkg_version}/bin/chef-vault" +# build_line "Adding wrapper $bin to $real_bin" + +# # build_line "Creating wrapper script: $bin" +# cat < "$bin" +# #!$(pkg_path_for core/bash)/bin/bash +# set -e -# build_line "Creating wrapper script: $bin" - cat < "$bin" -#!$(pkg_path_for core/bash)/bin/bash -set -e +# # Set the PATH for chef-vault to include necessary binaries +# export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:\$PATH" -# Set the PATH for chef-vault to include necessary binaries -export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:\$PATH" +# # Set Ruby paths defined from 'do_setup_environment()' +# export GEM_HOME="$GEM_HOME" +# export GEM_PATH="$GEM_PATH" -# Set Ruby paths defined from 'do_setup_environment()' -export GEM_HOME="$GEM_HOME" -export GEM_PATH="$GEM_PATH" +# # Execute the chef-vault binary +# exec $(pkg_path_for core/ruby31)/bin/ruby $real_bin "\$@" +# EOF -# Execute the chef-vault binary -exec $(pkg_path_for core/ruby31)/bin/ruby $real_bin "\$@" -EOF +# # Ensure the wrapper script is executable +# chmod -v 755 "$bin" +# } - # Ensure the wrapper script is executable - chmod -v 755 "$bin" +do_end() { + if [ "$(readlink /usr/bin/env)" = "$(pkg_interpreter_for core/coreutils bin/env)" ]; then + build_line "Removing the symlink we created for '/usr/bin/env'" + rm /usr/bin/env + fi } # No additional stripping needed From fe2b295c45331e436cb34e975a6a03203d02227e Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 23 Sep 2024 16:53:50 +0530 Subject: [PATCH 04/38] updated gemspec and version.rb Signed-off-by: nikhil2611 --- chef-vault.gemspec | 3 ++- lib/chef-vault/version.rb | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chef-vault.gemspec b/chef-vault.gemspec index 4576e5a..e7a5f77 100644 --- a/chef-vault.gemspec +++ b/chef-vault.gemspec @@ -14,7 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -$:.push File.expand_path("lib", __dir__) +lib = File.expand_path("lib", __dir__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "chef-vault/version" Gem::Specification.new do |s| diff --git a/lib/chef-vault/version.rb b/lib/chef-vault/version.rb index 6436819..dbd3c56 100644 --- a/lib/chef-vault/version.rb +++ b/lib/chef-vault/version.rb @@ -15,6 +15,5 @@ # limitations under the License. class ChefVault - VERSION = "4.1.12" - MAJOR, MINOR, TINY = VERSION.split(".") + VERSION = "4.1.12".freeze end From bba07edc564c53323a975bcc439a402044770f56 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 3 Dec 2024 18:58:42 +0530 Subject: [PATCH 05/38] updated the plan file for linux Signed-off-by: nikhil2611 --- habitat/plan.sh | 170 ++++++++++++++---------------------------------- 1 file changed, 49 insertions(+), 121 deletions(-) diff --git a/habitat/plan.sh b/habitat/plan.sh index 94fe4b9..338ca25 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -1,6 +1,8 @@ -_chef_client_ruby="core/ruby31" -pkg_name=chef-vault -pkg_origin=ngupta26 +export HAB_BLDR_CHANNEL="LTS-2024" +_chef_client_ruby="core/ruby3_1" +pkg_name="chef-vault" +pkg_origin="chef" +pkg_maintainer="The Chef Maintainers " pkg_description="Gem that allows you to encrypt a Chef Data Bag Item using the public keys of a list of chef nodes. This allows only those chef nodes to decrypt the encrypted values." pkg_license=('Apache-2.0') pkg_bin_dirs=( @@ -9,154 +11,80 @@ pkg_bin_dirs=( ) pkg_build_deps=( core/make + core/bash core/gcc - core/git core/libarchive ) pkg_deps=( $_chef_client_ruby core/coreutils + core/git ) pkg_svc_user=root pkg_version() { - cat "${SRC_PATH}/VERSION" + cat "$SRC_PATH/VERSION" } do_before() { - do_default_before update_pkg_version - # We must wait until we update the pkg_version to use the pkg_version - pkg_filename="${pkg_name}-${pkg_version}.tar.gz" -} - -do_download() { - build_line "Locally creating archive of latest repository commit at ${HAB_CACHE_SRC_PATH}/${pkg_filename}" - # source is in this repo, so we're going to create an archive from the - # appropriate path within the repo and place the generated tarball in the - # location expected by do_unpack - ( cd "${SRC_PATH}" || exit_with "unable to enter hab-src directory" 1 - git archive --prefix="${pkg_name}-${pkg_version}/" --output="${HAB_CACHE_SRC_PATH}/${pkg_filename}" HEAD - ) } -do_verify() { - build_line "Skipping checksum verification on the archive we just created." - return 0 -} - -# Setup environment variables for Ruby Gems -do_setup_environment() { - push_runtime_env GEM_PATH "${pkg_prefix}/vendor" - - set_runtime_env APPBUNDLER_ALLOW_RVM "true" # prevent appbundler from clearing out the carefully constructed runtime GEM_PATH - set_runtime_env LANG "en_US.UTF-8" - set_runtime_env LC_CTYPE "en_US.UTF-8" -} - -do_prepare() { - export GEM_HOME="${pkg_prefix}/vendor" - export CPPFLAGS="${CPPFLAGS} ${CFLAGS}" - - ( cd "$CACHE_PATH" - bundle config --local jobs "$(nproc)" - bundle config --local without server docgen maintenance pry travis integration ci chefstyle - bundle config --local shebang "$(pkg_path_for "$_chef_client_ruby")/bin/ruby" - bundle config --local retry 5 - bundle config --local silence_root_warning 1 - ) - - build_line "Setting link for /usr/bin/env to 'coreutils'" - if [ ! -f /usr/bin/env ]; then - ln -s "$(pkg_interpreter_for core/coreutils bin/env)" /usr/bin/env - fi +do_unpack() { + mkdir -pv "$HAB_CACHE_SRC_PATH/$pkg_dirname" + cp -RT "$PLAN_CONTEXT"/.. "$HAB_CACHE_SRC_PATH/$pkg_dirname/" } -# Unpack the source files into the cache directory -# do_unpack() { -# local unpack_dir="$HAB_CACHE_SRC_PATH/$pkg_dirname" -# build_line "Creating unpack directory: $unpack_dir" -# mkdir -pv "$unpack_dir" -# cp -RT "$PLAN_CONTEXT"/.. "$unpack_dir/" -# } - -# Build the gem from the gemspec file do_build() { - ( cd "$CACHE_PATH" || exit_with "unable to enter hab-cache directory" 1 - build_line "Installing gem dependencies ..." - bundle install --jobs=3 --retry=3 - build_line "Installing gems from git repos properly ..." - build_line "Installing this project's gems ..." - bundle exec rake install:local - gem install chef-utils chef-config appbundler - ) + echo $(pkg_path_for $_chef_client_ruby) + export GEM_HOME="$pkg_prefix/vendor/gems" + + build_line "Setting GEM_PATH=$GEM_HOME" + export GEM_PATH="$GEM_HOME" + bundle config --local without integration deploy maintenance + bundle config --local jobs 4 + bundle config --local retry 5 + bundle config --local silence_root_warning 1 + bundle install + gem build chef-vault.gemspec } -# Install the built gem into the package directory do_install() { - ( cd "$pkg_prefix" || exit_with "unable to enter pkg prefix directory" 1 - export BUNDLE_GEMFILE="${CACHE_PATH}/Gemfile" - build_line "** fixing binstub shebangs" - fix_interpreter "${pkg_prefix}/vendor/bin/*" "$_chef_client_ruby" bin/ruby - export BUNDLE_GEMFILE="${CACHE_PATH}/Gemfile" - for gem in chef-vault; do - build_line "** generating binstubs for $gem with precise version pins" - appbundler $CACHE_PATH $pkg_prefix/bin $gem - done - ) -} - -do_after() { - build_line "Trimming the fat ..." - - # We don't need the cache of downloaded .gem files ... - rm -rf "$pkg_prefix/vendor/cache" - - rm -r "$pkg_prefix/vendor/bundler" + export GEM_HOME="$pkg_prefix/vendor/gems" - # We don't need the gem docs. - rm -rf "$pkg_prefix/vendor/doc" - # We don't need to ship the test suites for every gem dependency, - # only Chef's for package verification. - find "$pkg_prefix/vendor/gems" -name spec -type d | grep -v "chef-vault-${pkg_version}" \ - | while read spec_dir; do rm -rf "$spec_dir"; done + build_line "Setting GEM_PATH=$GEM_HOME" + export GEM_PATH="$GEM_HOME" + gem install chef-vault-*.gem --no-document + wrap_ruby_chef_vault + set_runtime_env "GEM_PATH" "${pkg_prefix}/vendor/gems" } +wrap_ruby_chef_vault() { + local bin="$pkg_prefix/bin/chef-vault" + local real_bin="$GEM_HOME/gems/chef-vault-${pkg_version}/bin/chef-vault" + wrap_bin_with_ruby "$bin" "$real_bin" +} -# Create a wrapper script to properly set paths and execute the chef-vault command -# wrap_chef_vault_bin() { -# local bin="$pkg_prefix/bin/chef-vault" -# local real_bin="$GEM_HOME/gems/chef-vault-${pkg_version}/bin/chef-vault" -# build_line "Adding wrapper $bin to $real_bin" - -# # build_line "Creating wrapper script: $bin" -# cat < "$bin" -# #!$(pkg_path_for core/bash)/bin/bash -# set -e - -# # Set the PATH for chef-vault to include necessary binaries -# export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:\$PATH" - -# # Set Ruby paths defined from 'do_setup_environment()' -# export GEM_HOME="$GEM_HOME" -# export GEM_PATH="$GEM_PATH" +wrap_bin_with_ruby() { + local bin="$1" + local real_bin="$2" + build_line "Adding wrapper $bin to $real_bin" + cat < "$bin" +#!$(pkg_path_for core/bash)/bin/bash +set -e -# # Execute the chef-vault binary -# exec $(pkg_path_for core/ruby31)/bin/ruby $real_bin "\$@" -# EOF +# Set binary path that allows chef-vault to use non-Hab pkg binaries +export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:\$PATH" -# # Ensure the wrapper script is executable -# chmod -v 755 "$bin" -# } +# Set Ruby paths defined from 'do_setup_environment()' +export GEM_HOME="$pkg_prefix/vendor/gems" +export GEM_PATH="\$GEM_HOME" -do_end() { - if [ "$(readlink /usr/bin/env)" = "$(pkg_interpreter_for core/coreutils bin/env)" ]; then - build_line "Removing the symlink we created for '/usr/bin/env'" - rm /usr/bin/env - fi +exec $(pkg_path_for $_chef_client_ruby)/bin/ruby $real_bin \$@ +EOF + chmod -v 755 "$bin" } -# No additional stripping needed do_strip() { return 0 -} \ No newline at end of file +} From 59741b7f51baeade13c73b94437d68acff483656 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 3 Dec 2024 19:16:28 +0530 Subject: [PATCH 06/38] updated the plan file for win Signed-off-by: nikhil2611 --- chef-vault.gemspec | 3 +-- habitat/plan.ps1 | 18 ++++++++++++------ lib/chef-vault/version.rb | 3 ++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/chef-vault.gemspec b/chef-vault.gemspec index e7a5f77..4576e5a 100644 --- a/chef-vault.gemspec +++ b/chef-vault.gemspec @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -lib = File.expand_path("lib", __dir__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +$:.push File.expand_path("lib", __dir__) require "chef-vault/version" Gem::Specification.new do |s| diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 index 4138603..72c3128 100644 --- a/habitat/plan.ps1 +++ b/habitat/plan.ps1 @@ -1,10 +1,10 @@ $ErrorActionPreference = "Stop" $PSDefaultParameterValues['*:ErrorAction']='Stop' +$env:HAB_BLDR_CHANNEL = "LTS-2024" $pkg_name="chef-vault" -$pkg_origin="core" -$pkg_version="4.1.12" -$pkg_revision="1" +$pkg_origin="chef" +$pkg_version=$(Get-Content "$PLAN_CONTEXT/../VERSION") $pkg_maintainer="The Chef Maintainers " $pkg_deps=@( @@ -15,6 +15,13 @@ $pkg_bin_dirs=@("bin" "vendor/bin") $project_root= (Resolve-Path "$PLAN_CONTEXT/../").Path +function pkg_version { + Get-Content "$SRC_PATH/VERSION" +} + +function Invoke-Before { + Set-PkgVersion +} function Invoke-SetupEnvironment { Push-RuntimeEnv -IsPath GEM_PATH "$pkg_prefix/vendor" @@ -39,9 +46,8 @@ function Invoke-Build { bundle install gem build chef-vault.gemspec - Write-BuildLine " ** Using gem to install" - gem install chef-vault*.gem --no-document - + Write-BuildLine " ** Using gem to install" + gem install chef-vault*.gem --no-document If ($lastexitcode -ne 0) { Exit $lastexitcode } } finally { diff --git a/lib/chef-vault/version.rb b/lib/chef-vault/version.rb index dbd3c56..2b92c91 100644 --- a/lib/chef-vault/version.rb +++ b/lib/chef-vault/version.rb @@ -15,5 +15,6 @@ # limitations under the License. class ChefVault - VERSION = "4.1.12".freeze + VERSION = "4.1.13" + MAJOR, MINOR, TINY = VERSION.split(".") end From 3ed8ff98818915192be9a207577f56235c512f3a Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 3 Dec 2024 19:43:43 +0530 Subject: [PATCH 07/38] reverted the version Signed-off-by: nikhil2611 --- lib/chef-vault/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef-vault/version.rb b/lib/chef-vault/version.rb index 2b92c91..6436819 100644 --- a/lib/chef-vault/version.rb +++ b/lib/chef-vault/version.rb @@ -15,6 +15,6 @@ # limitations under the License. class ChefVault - VERSION = "4.1.13" + VERSION = "4.1.12" MAJOR, MINOR, TINY = VERSION.split(".") end From ab33aec00fb2a4c1ce66ee71f0473f284e05d660 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Thu, 5 Dec 2024 16:58:20 +0530 Subject: [PATCH 08/38] Automated pipelines for the build and publish hab pkgs Signed-off-by: Ashique Saidalavi --- .expeditor/build.habitat.yml | 9 ++ .../buildkite/artifact.habitat.test.ps1 | 92 +++++++++++++++++++ .expeditor/buildkite/artifact.habitat.test.sh | 71 ++++++++++++++ .expeditor/config.yml | 45 +++++++-- .expeditor/habitat-test.pipeline.yml | 34 +++++++ habitat/tests/test.sh | 25 +++++ 6 files changed, 266 insertions(+), 10 deletions(-) create mode 100644 .expeditor/build.habitat.yml create mode 100644 .expeditor/buildkite/artifact.habitat.test.ps1 create mode 100644 .expeditor/buildkite/artifact.habitat.test.sh create mode 100644 .expeditor/habitat-test.pipeline.yml create mode 100644 habitat/tests/test.sh diff --git a/.expeditor/build.habitat.yml b/.expeditor/build.habitat.yml new file mode 100644 index 0000000..72ea256 --- /dev/null +++ b/.expeditor/build.habitat.yml @@ -0,0 +1,9 @@ +--- +origin: chef + +expeditor: + defaults: + buildkite: + retry: + automatic: + limit: 1 diff --git a/.expeditor/buildkite/artifact.habitat.test.ps1 b/.expeditor/buildkite/artifact.habitat.test.ps1 new file mode 100644 index 0000000..af4b98d --- /dev/null +++ b/.expeditor/buildkite/artifact.habitat.test.ps1 @@ -0,0 +1,92 @@ +#!/usr/bin/env powershell + +#Requires -Version 5 +# https://stackoverflow.com/questions/9948517 +# TODO: Set-StrictMode -Version Latest +$PSDefaultParameterValues['*:ErrorAction']='Stop' +$ErrorActionPreference = 'Stop' +$env:HAB_BLDR_CHANNEL = "LTS-2024" +$env:HAB_ORIGIN = 'ci' +$env:CHEF_LICENSE = 'accept-no-persist' +$env:HAB_LICENSE = 'accept-no-persist' +$Plan = 'chef-vault' + +Write-Host "--- system details" +$Properties = 'Caption', 'CSName', 'Version', 'BuildType', 'OSArchitecture' +Get-CimInstance Win32_OperatingSystem | Select-Object $Properties | Format-Table -AutoSize + +Write-Host "--- Installing the version of Habitat required" + +function Stop-HabProcess { + $habProcess = Get-Process hab -ErrorAction SilentlyContinue + if ($habProcess) { + Write-Host "Stopping hab process..." + Stop-Process -Name hab -Force + } +} + +function Install-Habitat { + Write-Host "Downloading and installing Habitat..." + Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.ps1')) +} + +try { + hab --version +} +catch { + Set-ExecutionPolicy Bypass -Scope Process -Force + + Stop-HabProcess + + # Remove the existing hab.exe if it exists and if you have permissions + $habPath = "C:\ProgramData\Habitat\hab.exe" + if (Test-Path $habPath) { + Write-Host "Attempting to remove existing hab.exe..." + Remove-Item $habPath -Force -ErrorAction SilentlyContinue + if (Test-Path $habPath) { + Write-Host "Failed to remove hab.exe, re-running script with elevated permissions." + Start-Process powershell -Verb runAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" + exit + } + } + + Install-Habitat +} +finally { + Write-Host ":habicat: I think I have the version I need to build." +} + + +Write-Host "--- Generating fake origin key" +hab origin key generate $env:HAB_ORIGIN + +Write-Host "--- Building $Plan" +$project_root = "$(git rev-parse --show-toplevel)" +Set-Location $project_root + +$env:DO_CHECK=$true; hab pkg build . + +. $project_root/results/last_build.ps1 + +Write-Host "--- Installing $pkg_ident/$pkg_artifact" +hab pkg install -b $project_root/results/$pkg_artifact + +Write-Host "+++ Testing $Plan" + +Push-Location $project_root + +try { + Write-Host "Running unit tests..." + hab pkg exec "${pkg_ident}" rake unit + + If ($lastexitcode -ne 0) { + Write-Host "Rake unit tests failed!" -ForegroundColor Red + Exit $lastexitcode + } else { + Write-Host "Rake unit tests passed!" -ForegroundColor Green + } +} +finally { + # Ensure we always return to the original directory + Pop-Location +} diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh new file mode 100644 index 0000000..225255b --- /dev/null +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + +set -eo pipefail + +export HAB_ORIGIN='ci' +export PLAN='chef-vault' +export CHEF_LICENSE="accept-no-persist" +export HAB_LICENSE="accept-no-persist" +export HAB_BLDR_CHANNEL="LTS-2024" + +echo "--- checking if git is installed" +if ! command -v git &> /dev/null; then + echo "Git is not installed. Installing Git..." + sudo yum install -y git +else + echo "Git is already installed." + git --version +fi + +echo "--- add an exception for this directory since detected dubious ownership in repository at /workdir" +git config --global --add safe.directory /workdir + +echo "--- git status for this workdir" +git status + +echo "--- ruby version" +ruby -v + +export project_root="$(git rev-parse --show-toplevel)" +echo "The value for project_root is: $project_root" + +export HAB_NONINTERACTIVE=true +export HAB_NOCOLORING=true +export HAB_STUDIO_SECRET_HAB_NONINTERACTIVE=true + +echo "--- system details" +uname -a + +echo "--- Installing Habitat" +id -a +curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | bash + +echo "--- :key: Generating fake origin key" +hab origin key generate "$HAB_ORIGIN" + + +echo "--- Building $PLAN" +cd "$project_root" +DO_CHECK=true hab pkg build . + +echo "--- Sourcing 'results/last_build.sh'" +if [ -f ./results/last_build.env ]; then + cat ./results/last_build.env + . ./results/last_build.env + export pkg_artifact +fi + +echo "+++ Installing ${pkg_ident:?is undefined}" +echo "++++" +echo $project_root +echo "+++" +hab pkg install -b "${project_root:?is undefined}/results/${pkg_artifact:?is undefined}" + +echo "+++ Testing $PLAN" + +PATH="$(hab pkg path ci/chef-vault)/bin:$PATH" +export PATH +echo "PATH is $PATH" + +echo "--- :mag_right: Testing $PLAN" +${project_root}/habitat/tests/test.sh "$pkg_ident" || error 'failures during test of executables' diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 1d2c98a..2063fce 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -29,17 +29,29 @@ subscriptions: - workload: pull_request_merged:{{github_repo}}:{{release_branch}}:* actions: - built_in:bump_version: - ignore_labels: - - "Expeditor: Skip Version Bump" - - "Expeditor: Skip All" + ignore_labels: + - "Expeditor: Skip Version Bump" + - "Expeditor: Skip All" - bash:.expeditor/update_version.sh: - only_if: built_in:bump_version + only_if: built_in:bump_version - built_in:update_changelog: - ignore_labels: - - "Expeditor: Skip Changelog" - - "Expeditor: Skip All" + ignore_labels: + - "Expeditor: Skip Changelog" + - "Expeditor: Skip All" - built_in:build_gem: - only_if: built_in:bump_version + only_if: built_in:bump_version + - trigger_pipeline:habitat/build: + only_if: built_in:bump_version + ignore_labels: + - "Expeditor: Skip Habitat" + - "Expeditor: Skip All" + + # the habitat chain + - workload: buildkite_hab_build_group_published:{{agent_id}}:* + actions: + # when all of the hab package publish to the unstable channel, test and promote them + - trigger_pipeline:habitat/test + - workload: project_promoted:{{agent_id}}:* actions: - built_in:rollover_changelog @@ -47,5 +59,18 @@ subscriptions: pipelines: - verify: - description: Pull Request validation tests - public: true + description: Pull Request validation tests + public: true + - habitat/build: + env: + - HAB_NONINTERACTIVE: "true" + - HAB_NOCOLORING: "true" + - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" + - habitat/test: + description: Execute tests against the habitat artifact + definition: .expeditor/habitat-test.pipeline.yml + env: + - HAB_NONINTERACTIVE: "true" + - HAB_NOCOLORING: "true" + - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" + trigger: pull_request diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml new file mode 100644 index 0000000..838d841 --- /dev/null +++ b/.expeditor/habitat-test.pipeline.yml @@ -0,0 +1,34 @@ +--- +expeditor: + defaults: + buildkite: + timeout_in_minutes: 30 + retry: + automatic: + limit: 1 + +steps: + + - label: ":linux: Validate Habitat Builds of Test Kitchen" + commands: + - .expeditor/buildkite/artifact.habitat.test.sh + expeditor: + executor: + docker: + image: ruby:3.1 + privileged: true + + - label: ":windows: Validate Habitat Builds of Test Kitchen" + commands: + - .expeditor/buildkite/artifact.habitat.test.ps1 + expeditor: + executor: + docker: + host_os: windows + shell: ["powershell", "-Command"] + image: rubydistros/windows-2019:3.1 + user: 'NT AUTHORITY\SYSTEM' + environment: + - FORCE_FFI_YAJL=ext + - EXPIRE_CACHE=true + - CHEF_LICENSE=accept-no-persist \ No newline at end of file diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh new file mode 100644 index 0000000..bb5f881 --- /dev/null +++ b/habitat/tests/test.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -euo pipefail + +project_root="$(git rev-parse --show-toplevel)" + +# print error message followed by usage and exit +error () { + local message="$1" + + echo -e "\nERROR: ${message}\n" >&2 + + exit 1 +} + +[[ -n "$pkg_ident" ]] || error 'no hab package identity provided' + +package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") + +cd "${project_root}" + +echo "--- :mag_right: Testing ${pkg_ident} executables" +help_message=$(hab pkg exec "${pkg_ident}" -- chef-vault -h) +original_help="Usage: chef-vault" +[[ $help_message =~ $original_help ]] || error "chef-vault help command is not as expected" From 974b72881e077b977f2c37f425bfe538b9187370 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Thu, 5 Dec 2024 19:10:46 +0530 Subject: [PATCH 09/38] Committed config for testing Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 2063fce..03d6f13 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -40,17 +40,17 @@ subscriptions: - "Expeditor: Skip All" - built_in:build_gem: only_if: built_in:bump_version - - trigger_pipeline:habitat/build: - only_if: built_in:bump_version - ignore_labels: - - "Expeditor: Skip Habitat" - - "Expeditor: Skip All" +# - trigger_pipeline:habitat/build: +# only_if: built_in:bump_version +# ignore_labels: +# - "Expeditor: Skip Habitat" +# - "Expeditor: Skip All" # the habitat chain - - workload: buildkite_hab_build_group_published:{{agent_id}}:* - actions: - # when all of the hab package publish to the unstable channel, test and promote them - - trigger_pipeline:habitat/test +# - workload: buildkite_hab_build_group_published:{{agent_id}}:* +# actions: +# # when all of the hab package publish to the unstable channel, test and promote them +# - trigger_pipeline:habitat/test - workload: project_promoted:{{agent_id}}:* actions: @@ -61,16 +61,16 @@ pipelines: - verify: description: Pull Request validation tests public: true - - habitat/build: - env: - - HAB_NONINTERACTIVE: "true" - - HAB_NOCOLORING: "true" - - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" - - habitat/test: - description: Execute tests against the habitat artifact - definition: .expeditor/habitat-test.pipeline.yml - env: - - HAB_NONINTERACTIVE: "true" - - HAB_NOCOLORING: "true" - - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" - trigger: pull_request +# - habitat/build: +# env: +# - HAB_NONINTERACTIVE: "true" +# - HAB_NOCOLORING: "true" +# - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" +# - habitat/test: +# description: Execute tests against the habitat artifact +# definition: .expeditor/habitat-test.pipeline.yml +# env: +# - HAB_NONINTERACTIVE: "true" +# - HAB_NOCOLORING: "true" +# - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" +# trigger: pull_request From 1e130d8c3c4fde4ecc5726dd6028463e0b11e512 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Thu, 5 Dec 2024 19:13:53 +0530 Subject: [PATCH 10/38] Linting updates Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 03d6f13..709a4ad 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -29,17 +29,17 @@ subscriptions: - workload: pull_request_merged:{{github_repo}}:{{release_branch}}:* actions: - built_in:bump_version: - ignore_labels: - - "Expeditor: Skip Version Bump" - - "Expeditor: Skip All" + ignore_labels: + - "Expeditor: Skip Version Bump" + - "Expeditor: Skip All" - bash:.expeditor/update_version.sh: - only_if: built_in:bump_version + only_if: built_in:bump_version - built_in:update_changelog: - ignore_labels: - - "Expeditor: Skip Changelog" - - "Expeditor: Skip All" + ignore_labels: + - "Expeditor: Skip Changelog" + - "Expeditor: Skip All" - built_in:build_gem: - only_if: built_in:bump_version + only_if: built_in:bump_version # - trigger_pipeline:habitat/build: # only_if: built_in:bump_version # ignore_labels: From 683c0b2e13d7357b9e1f57ea1277da2bf3cc56da Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Thu, 5 Dec 2024 19:14:48 +0530 Subject: [PATCH 11/38] Linting updates Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 709a4ad..1baee28 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -59,8 +59,8 @@ subscriptions: pipelines: - verify: - description: Pull Request validation tests - public: true + description: Pull Request validation tests + public: true # - habitat/build: # env: # - HAB_NONINTERACTIVE: "true" From 5d73c083a8bfe8ccbbf6ae5b2b3e8e0d2eb1e93b Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Thu, 5 Dec 2024 19:16:48 +0530 Subject: [PATCH 12/38] Subscription changes Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 1baee28..428ad1c 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -40,17 +40,17 @@ subscriptions: - "Expeditor: Skip All" - built_in:build_gem: only_if: built_in:bump_version -# - trigger_pipeline:habitat/build: -# only_if: built_in:bump_version -# ignore_labels: -# - "Expeditor: Skip Habitat" -# - "Expeditor: Skip All" + - trigger_pipeline:habitat/build: + only_if: built_in:bump_version + ignore_labels: + - "Expeditor: Skip Habitat" + - "Expeditor: Skip All" # the habitat chain -# - workload: buildkite_hab_build_group_published:{{agent_id}}:* -# actions: -# # when all of the hab package publish to the unstable channel, test and promote them -# - trigger_pipeline:habitat/test + - workload: buildkite_hab_build_group_published:{{agent_id}}:* + actions: + # when all of the hab package publish to the unstable channel, test and promote them + - trigger_pipeline:habitat/test - workload: project_promoted:{{agent_id}}:* actions: From 99d777de67692983b1dea00b65665297d98c8041 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Thu, 5 Dec 2024 19:18:24 +0530 Subject: [PATCH 13/38] Linting updates Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 428ad1c..98a1a32 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -61,16 +61,16 @@ pipelines: - verify: description: Pull Request validation tests public: true -# - habitat/build: -# env: -# - HAB_NONINTERACTIVE: "true" -# - HAB_NOCOLORING: "true" -# - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" -# - habitat/test: -# description: Execute tests against the habitat artifact -# definition: .expeditor/habitat-test.pipeline.yml -# env: -# - HAB_NONINTERACTIVE: "true" -# - HAB_NOCOLORING: "true" -# - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" -# trigger: pull_request + - habitat/build: + env: + - HAB_NONINTERACTIVE: "true" + - HAB_NOCOLORING: "true" + - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" + - habitat/test: + description: Execute tests against the habitat artifact + definition: .expeditor/habitat-test.pipeline.yml + env: + - HAB_NONINTERACTIVE: "true" + - HAB_NOCOLORING: "true" + - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" + trigger: pull_request From 384999583d66d32928515ccbf41a63c4e3336135 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Thu, 5 Dec 2024 19:55:15 +0530 Subject: [PATCH 14/38] Added the release branch config Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 98a1a32..de986bc 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -9,6 +9,12 @@ slack: rubygems: - chef-vault +release_branches: + - workstation-LTS: + version_constraint: 4.* + - main: + version_constraint: 4.* + github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true From 0d96d1469abfa422850fc174c3f349d85a74a2b6 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 19:08:05 +0530 Subject: [PATCH 15/38] Config updates Signed-off-by: Ashique Saidalavi --- .expeditor/config.yml | 17 +++++++++++------ .expeditor/run_windows_tests.ps1 | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index de986bc..d2865b8 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -9,12 +9,6 @@ slack: rubygems: - chef-vault -release_branches: - - workstation-LTS: - version_constraint: 4.* - - main: - version_constraint: 4.* - github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true @@ -27,6 +21,12 @@ github: major_bump_labels: - "Expeditor: Bump Version Major" +release_branches: + - workstation-LTS: + version_constraint: 4.* + - main: + version_constraint: 4.* + changelog: rollup_header: Changes not yet released to rubygems.org @@ -46,6 +46,11 @@ subscriptions: - "Expeditor: Skip All" - built_in:build_gem: only_if: built_in:bump_version + - trigger_pipeline:habitat/test: + only_if: built_in:bump_version + ignore_labels: + - "Expeditor: Skip Habitat" + - "Expeditor: Skip All" - trigger_pipeline:habitat/build: only_if: built_in:bump_version ignore_labels: diff --git a/.expeditor/run_windows_tests.ps1 b/.expeditor/run_windows_tests.ps1 index 3cce207..2f80a4b 100644 --- a/.expeditor/run_windows_tests.ps1 +++ b/.expeditor/run_windows_tests.ps1 @@ -18,4 +18,4 @@ If ($lastexitcode -ne 0) { Exit $lastexitcode } Write-Output "--- Bundle Execute" bundle exec rake -If ($lastexitcode -ne 0) { Exit $lastexitcode } \ No newline at end of file +If ($lastexitcode -ne 0) { Exit $lastexitcode } From 15bb95958945fcaa3f57c4a992964963c0fd0a1e Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 19:19:18 +0530 Subject: [PATCH 16/38] Pipeline fixes Signed-off-by: Ashique Saidalavi --- .expeditor/habitat-test.pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index 838d841..4d2b646 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -9,7 +9,7 @@ expeditor: steps: - - label: ":linux: Validate Habitat Builds of Test Kitchen" + - label: ":linux: Validate Habitat Builds of Chef-cli" commands: - .expeditor/buildkite/artifact.habitat.test.sh expeditor: @@ -18,7 +18,7 @@ steps: image: ruby:3.1 privileged: true - - label: ":windows: Validate Habitat Builds of Test Kitchen" + - label: ":windows: Validate Habitat Builds of Chef-cli" commands: - .expeditor/buildkite/artifact.habitat.test.ps1 expeditor: From c9b353065ec9e1a03c0b5acfd8e6e38e47c36d4c Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 19:55:38 +0530 Subject: [PATCH 17/38] Test updates Signed-off-by: Ashique Saidalavi --- .../buildkite/artifact.habitat.test.ps1 | 11 ++-------- .expeditor/habitat-test.pipeline.yml | 1 + habitat/tests/test.ps1 | 22 +++++++++++++++++++ 3 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 habitat/tests/test.ps1 diff --git a/.expeditor/buildkite/artifact.habitat.test.ps1 b/.expeditor/buildkite/artifact.habitat.test.ps1 index af4b98d..b9befd9 100644 --- a/.expeditor/buildkite/artifact.habitat.test.ps1 +++ b/.expeditor/buildkite/artifact.habitat.test.ps1 @@ -76,15 +76,8 @@ Write-Host "+++ Testing $Plan" Push-Location $project_root try { - Write-Host "Running unit tests..." - hab pkg exec "${pkg_ident}" rake unit - - If ($lastexitcode -ne 0) { - Write-Host "Rake unit tests failed!" -ForegroundColor Red - Exit $lastexitcode - } else { - Write-Host "Rake unit tests passed!" -ForegroundColor Green - } + $scriptPath = Join-Path $project_root "habitat/tests/test.ps1" + & $scriptPath $pkg_ident } finally { # Ensure we always return to the original directory diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index 4d2b646..f000a08 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -11,6 +11,7 @@ steps: - label: ":linux: Validate Habitat Builds of Chef-cli" commands: + - chmod +x .expeditor/buildkite/artifact.habitat.test.sh - .expeditor/buildkite/artifact.habitat.test.sh expeditor: executor: diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 new file mode 100644 index 0000000..ec127ee --- /dev/null +++ b/habitat/tests/test.ps1 @@ -0,0 +1,22 @@ +param ( + [Parameter()] + [string]$PackageIdentifier = $(throw "Usage: test.ps1 [test_pkg_ident] e.g. test.ps1 ci/user-windows/1.0.0/20190812103929") +) + + +Write-Host "--- :fire: Smokish test" +# Pester the Package +$help_message=hab pkg exec "${pkg_ident}" -- chef-vault -h +$original_message="Usage: chef-vault" + +Write-Host "Checking the help message of the package" +Write-Host "Expected: $original_message" +Write-Host "Actual: $help_message" +if ($help_message.Contains($original_message)) +{ + Write "Chef-vault is working fine" +} +else { + Write-Error "chef-vault binary doesn't return the correct usage message " + throw "Chef-vault windows pipeline not working for hab pkg" +} From a6111f070c47d7d5725540e86a5baecbecdd4c06 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 21:31:34 +0530 Subject: [PATCH 18/38] Fixed the verify tests for windows Signed-off-by: Ashique Saidalavi --- .expeditor/buildkite/artifact.habitat.test.sh | 1 + .expeditor/habitat-test.pipeline.yml | 4 ++-- habitat/tests/test.ps1 | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index 225255b..c07fa77 100644 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -68,4 +68,5 @@ export PATH echo "PATH is $PATH" echo "--- :mag_right: Testing $PLAN" +chmod +x "${project_root}/habitat/tests/test.sh" ${project_root}/habitat/tests/test.sh "$pkg_ident" || error 'failures during test of executables' diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index f000a08..a3af2f4 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -9,7 +9,7 @@ expeditor: steps: - - label: ":linux: Validate Habitat Builds of Chef-cli" + - label: ":linux: Validate Habitat Builds of Chef-vault" commands: - chmod +x .expeditor/buildkite/artifact.habitat.test.sh - .expeditor/buildkite/artifact.habitat.test.sh @@ -19,7 +19,7 @@ steps: image: ruby:3.1 privileged: true - - label: ":windows: Validate Habitat Builds of Chef-cli" + - label: ":windows: Validate Habitat Builds of Chef-vault" commands: - .expeditor/buildkite/artifact.habitat.test.ps1 expeditor: diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 index ec127ee..07ecf03 100644 --- a/habitat/tests/test.ps1 +++ b/habitat/tests/test.ps1 @@ -12,7 +12,7 @@ $original_message="Usage: chef-vault" Write-Host "Checking the help message of the package" Write-Host "Expected: $original_message" Write-Host "Actual: $help_message" -if ($help_message.Contains($original_message)) +if ($help_message -like "*$original_message*") { Write "Chef-vault is working fine" } From d82159da9f98d25b23a4516a66824c530bc749fa Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 22:07:55 +0530 Subject: [PATCH 19/38] Testing the linux habitat verify test Signed-off-by: Ashique Saidalavi --- .expeditor/buildkite/artifact.habitat.test.sh | 2 +- habitat/tests/test.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index c07fa77..24f46c8 100644 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -69,4 +69,4 @@ echo "PATH is $PATH" echo "--- :mag_right: Testing $PLAN" chmod +x "${project_root}/habitat/tests/test.sh" -${project_root}/habitat/tests/test.sh "$pkg_ident" || error 'failures during test of executables' +"${project_root}/habitat/tests/test.sh" "$pkg_ident" diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index bb5f881..39d0383 100644 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -12,6 +12,7 @@ error () { exit 1 } +echo "--- :mag_right: Starting the testing" [[ -n "$pkg_ident" ]] || error 'no hab package identity provided' From 71a2091542f8738ef865fb54f6b6fbc236ef0208 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 22:38:27 +0530 Subject: [PATCH 20/38] Fixed the issue with the shell script parameter Signed-off-by: Ashique Saidalavi --- habitat/tests/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 39d0383..b2d9452 100644 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -3,6 +3,7 @@ set -euo pipefail project_root="$(git rev-parse --show-toplevel)" +pkg_ident="$1" # print error message followed by usage and exit error () { From 15819039329ff8f2884cfa0c19abd9793f8a61c0 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Mon, 9 Dec 2024 22:56:18 +0530 Subject: [PATCH 21/38] Removed the logs added for testing Signed-off-by: Ashique Saidalavi --- habitat/tests/test.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index b2d9452..30c7348 100644 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -13,7 +13,6 @@ error () { exit 1 } -echo "--- :mag_right: Starting the testing" [[ -n "$pkg_ident" ]] || error 'no hab package identity provided' From 6964e667c7f5405bf671b9da9f05858dbcd411ac Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Tue, 10 Dec 2024 12:02:56 +0530 Subject: [PATCH 22/38] Updated the file permissions and changed the notify channel Signed-off-by: Ashique Saidalavi --- .expeditor/buildkite/artifact.habitat.test.sh | 1 - .expeditor/config.yml | 2 +- .expeditor/habitat-test.pipeline.yml | 1 - habitat/tests/test.sh | 0 4 files changed, 1 insertion(+), 3 deletions(-) mode change 100644 => 100755 .expeditor/buildkite/artifact.habitat.test.sh mode change 100644 => 100755 habitat/tests/test.sh diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh old mode 100644 new mode 100755 index 24f46c8..a78e0a8 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -68,5 +68,4 @@ export PATH echo "PATH is $PATH" echo "--- :mag_right: Testing $PLAN" -chmod +x "${project_root}/habitat/tests/test.sh" "${project_root}/habitat/tests/test.sh" "$pkg_ident" diff --git a/.expeditor/config.yml b/.expeditor/config.yml index d2865b8..5ede865 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -3,7 +3,7 @@ # Slack channel in Chef Software slack to send notifications about build failures, etc slack: - notify_channel: chef-infra-notify + notify_channel: chef-ws-notify # This publish is triggered by the `built_in:publish_rubygems` artifact_action. rubygems: diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index a3af2f4..f49e004 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -11,7 +11,6 @@ steps: - label: ":linux: Validate Habitat Builds of Chef-vault" commands: - - chmod +x .expeditor/buildkite/artifact.habitat.test.sh - .expeditor/buildkite/artifact.habitat.test.sh expeditor: executor: diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh old mode 100644 new mode 100755 From 5e3f3ff12c736eeadc23dff1c6c0263ee4abccdd Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Wed, 11 Dec 2024 00:13:21 +0530 Subject: [PATCH 23/38] Test commit for pipeline testing - 1 Signed-off-by: Ashique Saidalavi From 17cb3d9441bd5d35b2bcfef4fad47124a85958d8 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 10 Dec 2024 20:14:06 +0000 Subject: [PATCH 24/38] Bump version to 4.1.14 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- VERSION | 2 +- lib/chef-vault/version.rb | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47fb5f4..883942b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,17 @@ # chef-vault Change Log - -## [v4.1.13](https://github.com/chef/chef-vault/tree/v4.1.13) (2024-09-25) + +## [v4.1.14](https://github.com/chef/chef-vault/tree/v4.1.14) (2024-12-10) #### Merged Pull Requests -- CHEF-3710-chef-vault warning message includes sensitive info [#414](https://github.com/chef/chef-vault/pull/414) ([nikhil2611](https://github.com/nikhil2611)) +- Test commit for pipeline testing [#424](https://github.com/chef/chef-vault/pull/424) ([ashiqueps](https://github.com/ashiqueps)) ### Changes not yet released to rubygems.org #### Merged Pull Requests +- Test commit for pipeline testing [#424](https://github.com/chef/chef-vault/pull/424) ([ashiqueps](https://github.com/ashiqueps)) - CHEF-3710-chef-vault warning message includes sensitive info [#414](https://github.com/chef/chef-vault/pull/414) ([nikhil2611](https://github.com/nikhil2611)) - Integrating with sonarQube [#406](https://github.com/chef/chef-vault/pull/406) ([nikhil2611](https://github.com/nikhil2611)) diff --git a/VERSION b/VERSION index 068399f..ed9a86f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.13 \ No newline at end of file +4.1.14 \ No newline at end of file diff --git a/lib/chef-vault/version.rb b/lib/chef-vault/version.rb index 2b92c91..7726c8f 100644 --- a/lib/chef-vault/version.rb +++ b/lib/chef-vault/version.rb @@ -15,6 +15,6 @@ # limitations under the License. class ChefVault - VERSION = "4.1.13" + VERSION = "4.1.14" MAJOR, MINOR, TINY = VERSION.split(".") end From d8342068aefcf159a569fe13f632bd1a95861b52 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 6 Jan 2025 13:15:00 +0530 Subject: [PATCH 25/38] removed the manually created pipelines and added the channels Signed-off-by: nikhil2611 --- .expeditor/config.yml | 66 +++++++++++++++++++-------------------- VERSION | 2 +- lib/chef-vault/version.rb | 2 +- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 5ede865..99eae6f 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -9,6 +9,11 @@ slack: rubygems: - chef-vault +artifact_channels: + - dev + - workstation-build + - LTS-2024 + github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true @@ -23,7 +28,7 @@ github: release_branches: - workstation-LTS: - version_constraint: 4.* + version_constraint: 0.* - main: version_constraint: 4.* @@ -46,42 +51,37 @@ subscriptions: - "Expeditor: Skip All" - built_in:build_gem: only_if: built_in:bump_version - - trigger_pipeline:habitat/test: - only_if: built_in:bump_version - ignore_labels: - - "Expeditor: Skip Habitat" - - "Expeditor: Skip All" - - trigger_pipeline:habitat/build: - only_if: built_in:bump_version - ignore_labels: - - "Expeditor: Skip Habitat" - - "Expeditor: Skip All" + # - trigger_pipeline:habitat/test: + # only_if: built_in:bump_version + # ignore_labels: + # - "Expeditor: Skip Habitat" + # - "Expeditor: Skip All" + # - trigger_pipeline:habitat/build: + # only_if: built_in:bump_version + # ignore_labels: + # - "Expeditor: Skip Habitat" + # - "Expeditor: Skip All" # the habitat chain - - workload: buildkite_hab_build_group_published:{{agent_id}}:* - actions: - # when all of the hab package publish to the unstable channel, test and promote them - - trigger_pipeline:habitat/test - - - workload: project_promoted:{{agent_id}}:* - actions: - - built_in:rollover_changelog - - built_in:publish_rubygems + # - workload: buildkite_hab_build_group_published:{{agent_id}}:* + # actions: + # # when all of the hab package publish to the unstable channel, test and promote them + # - trigger_pipeline:habitat/test pipelines: - verify: description: Pull Request validation tests public: true - - habitat/build: - env: - - HAB_NONINTERACTIVE: "true" - - HAB_NOCOLORING: "true" - - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" - - habitat/test: - description: Execute tests against the habitat artifact - definition: .expeditor/habitat-test.pipeline.yml - env: - - HAB_NONINTERACTIVE: "true" - - HAB_NOCOLORING: "true" - - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" - trigger: pull_request + # - habitat/build: + # env: + # - HAB_NONINTERACTIVE: "true" + # - HAB_NOCOLORING: "true" + # - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" + # - habitat/test: + # description: Execute tests against the habitat artifact + # definition: .expeditor/habitat-test.pipeline.yml + # env: + # - HAB_NONINTERACTIVE: "true" + # - HAB_NOCOLORING: "true" + # - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" + # trigger: pull_request diff --git a/VERSION b/VERSION index ed9a86f..6c6aa7c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.14 \ No newline at end of file +0.1.0 \ No newline at end of file diff --git a/lib/chef-vault/version.rb b/lib/chef-vault/version.rb index 7726c8f..b344c92 100644 --- a/lib/chef-vault/version.rb +++ b/lib/chef-vault/version.rb @@ -15,6 +15,6 @@ # limitations under the License. class ChefVault - VERSION = "4.1.14" + VERSION = "0.1.0" MAJOR, MINOR, TINY = VERSION.split(".") end From 2d73a0431425e883d3858e55e8c28b757effd73d Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 6 Jan 2025 17:44:03 +0530 Subject: [PATCH 26/38] added the workload to promote packages Signed-off-by: nikhil2611 --- .expeditor/config.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 99eae6f..32d1a5a 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -51,11 +51,6 @@ subscriptions: - "Expeditor: Skip All" - built_in:build_gem: only_if: built_in:bump_version - # - trigger_pipeline:habitat/test: - # only_if: built_in:bump_version - # ignore_labels: - # - "Expeditor: Skip Habitat" - # - "Expeditor: Skip All" # - trigger_pipeline:habitat/build: # only_if: built_in:bump_version # ignore_labels: @@ -68,6 +63,14 @@ subscriptions: # # when all of the hab package publish to the unstable channel, test and promote them # - trigger_pipeline:habitat/test + # Subscribe to the promotion of the dev channel to acceptance + # - workload: project_promoted:{{agent_id}}:dev:* + # actions: + # - built_in:promote_habitat_packages + # - workload: project_promoted:{{agent_id}}:workstation-build:* + # actions: + # - built_in:promote_habitat_packages + pipelines: - verify: description: Pull Request validation tests From 01e9e9ed28e29fddb3cc89b3a259d75c1b904cf3 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Mon, 6 Jan 2025 12:15:29 +0000 Subject: [PATCH 27/38] Bump version to 0.1.0 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 883942b..823400c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,17 @@ # chef-vault Change Log - -## [v4.1.14](https://github.com/chef/chef-vault/tree/v4.1.14) (2024-12-10) + +## [v0.1.0](https://github.com/chef/chef-vault/tree/v0.1.0) (2025-01-06) #### Merged Pull Requests -- Test commit for pipeline testing [#424](https://github.com/chef/chef-vault/pull/424) ([ashiqueps](https://github.com/ashiqueps)) +- Removed the manually created pipelines and added the channels [#425](https://github.com/chef/chef-vault/pull/425) ([nikhil2611](https://github.com/nikhil2611)) ### Changes not yet released to rubygems.org #### Merged Pull Requests +- Removed the manually created pipelines and added the channels [#425](https://github.com/chef/chef-vault/pull/425) ([nikhil2611](https://github.com/nikhil2611)) - Test commit for pipeline testing [#424](https://github.com/chef/chef-vault/pull/424) ([ashiqueps](https://github.com/ashiqueps)) - CHEF-3710-chef-vault warning message includes sensitive info [#414](https://github.com/chef/chef-vault/pull/414) ([nikhil2611](https://github.com/nikhil2611)) - Integrating with sonarQube [#406](https://github.com/chef/chef-vault/pull/406) ([nikhil2611](https://github.com/nikhil2611)) From a8341414292df43ff5f591e3ebbd758dc1f14ccc Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 6 Jan 2025 17:48:22 +0530 Subject: [PATCH 28/38] added the pipelines to get create automatically Signed-off-by: nikhil2611 --- .expeditor/config.yml | 57 ++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 32d1a5a..45995dc 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -51,40 +51,41 @@ subscriptions: - "Expeditor: Skip All" - built_in:build_gem: only_if: built_in:bump_version - # - trigger_pipeline:habitat/build: - # only_if: built_in:bump_version - # ignore_labels: - # - "Expeditor: Skip Habitat" - # - "Expeditor: Skip All" + - trigger_pipeline:habitat/build: + only_if: built_in:bump_version + ignore_labels: + - "Expeditor: Skip Habitat" + - "Expeditor: Skip All" # the habitat chain - # - workload: buildkite_hab_build_group_published:{{agent_id}}:* - # actions: - # # when all of the hab package publish to the unstable channel, test and promote them - # - trigger_pipeline:habitat/test + - workload: buildkite_hab_build_group_published:{{agent_id}}:* + actions: + # when all of the hab package publish to the unstable channel, test and promote them + - trigger_pipeline:habitat/test # Subscribe to the promotion of the dev channel to acceptance - # - workload: project_promoted:{{agent_id}}:dev:* - # actions: - # - built_in:promote_habitat_packages - # - workload: project_promoted:{{agent_id}}:workstation-build:* - # actions: - # - built_in:promote_habitat_packages + - workload: project_promoted:{{agent_id}}:dev:* + actions: + - built_in:promote_habitat_packages + - workload: project_promoted:{{agent_id}}:workstation-build:* + actions: + - built_in:promote_habitat_packages pipelines: - verify: description: Pull Request validation tests public: true - # - habitat/build: - # env: - # - HAB_NONINTERACTIVE: "true" - # - HAB_NOCOLORING: "true" - # - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" - # - habitat/test: - # description: Execute tests against the habitat artifact - # definition: .expeditor/habitat-test.pipeline.yml - # env: - # - HAB_NONINTERACTIVE: "true" - # - HAB_NOCOLORING: "true" - # - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" - # trigger: pull_request + - habitat/build: + env: + - HAB_NONINTERACTIVE: "true" + - HAB_NOCOLORING: "true" + - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" + - habitat/test: + description: Execute tests against the habitat artifact + definition: .expeditor/habitat-test.pipeline.yml + env: + - HAB_NONINTERACTIVE: "true" + - HAB_NOCOLORING: "true" + - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" + trigger: pull_request + From c9a0b0945f597a9017452a4979439cf40c5b6d1c Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 6 Jan 2025 17:53:59 +0530 Subject: [PATCH 29/38] updated the workload Signed-off-by: nikhil2611 --- .expeditor/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 45995dc..b49f826 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -61,9 +61,9 @@ subscriptions: - workload: buildkite_hab_build_group_published:{{agent_id}}:* actions: # when all of the hab package publish to the unstable channel, test and promote them - - trigger_pipeline:habitat/test + - built_in:promote_habitat_packages - # Subscribe to the promotion of the dev channel to acceptance + # Subscribe to the promotion of the dev channel to acceptance - workload: project_promoted:{{agent_id}}:dev:* actions: - built_in:promote_habitat_packages From 3072511d2ecc8f9fe477151a2b2826ad12d46244 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 6 Jan 2025 17:56:05 +0530 Subject: [PATCH 30/38] updated the workload Signed-off-by: nikhil2611 --- .expeditor/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index b49f826..afd4f60 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -49,8 +49,6 @@ subscriptions: ignore_labels: - "Expeditor: Skip Changelog" - "Expeditor: Skip All" - - built_in:build_gem: - only_if: built_in:bump_version - trigger_pipeline:habitat/build: only_if: built_in:bump_version ignore_labels: From 92809fe2cd3e044f38b4f36bbfbf59b557a2f2a1 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Mon, 6 Jan 2025 12:26:58 +0000 Subject: [PATCH 31/38] Bump version to 0.1.1 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- VERSION | 2 +- lib/chef-vault/version.rb | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 823400c..2dfb442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,17 @@ # chef-vault Change Log - -## [v0.1.0](https://github.com/chef/chef-vault/tree/v0.1.0) (2025-01-06) + +## [v0.1.1](https://github.com/chef/chef-vault/tree/v0.1.1) (2025-01-06) #### Merged Pull Requests -- Removed the manually created pipelines and added the channels [#425](https://github.com/chef/chef-vault/pull/425) ([nikhil2611](https://github.com/nikhil2611)) +- Adding pipelines to trigger pipeline automatically [#426](https://github.com/chef/chef-vault/pull/426) ([nikhil2611](https://github.com/nikhil2611)) ### Changes not yet released to rubygems.org #### Merged Pull Requests +- Adding pipelines to trigger pipeline automatically [#426](https://github.com/chef/chef-vault/pull/426) ([nikhil2611](https://github.com/nikhil2611)) - Removed the manually created pipelines and added the channels [#425](https://github.com/chef/chef-vault/pull/425) ([nikhil2611](https://github.com/nikhil2611)) - Test commit for pipeline testing [#424](https://github.com/chef/chef-vault/pull/424) ([ashiqueps](https://github.com/ashiqueps)) - CHEF-3710-chef-vault warning message includes sensitive info [#414](https://github.com/chef/chef-vault/pull/414) ([nikhil2611](https://github.com/nikhil2611)) diff --git a/VERSION b/VERSION index 6c6aa7c..6da28dd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 \ No newline at end of file +0.1.1 \ No newline at end of file diff --git a/lib/chef-vault/version.rb b/lib/chef-vault/version.rb index b344c92..45375a7 100644 --- a/lib/chef-vault/version.rb +++ b/lib/chef-vault/version.rb @@ -15,6 +15,6 @@ # limitations under the License. class ChefVault - VERSION = "0.1.0" + VERSION = "0.1.1" MAJOR, MINOR, TINY = VERSION.split(".") end From 0edf8e71b7f73a0666f6952cf824953aba52565d Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 6 Jan 2025 17:58:28 +0530 Subject: [PATCH 32/38] empty commit to test pipelines Signed-off-by: nikhil2611 From 4ff900cd528ffc0831ac9656818119b6550f4b30 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Mon, 6 Jan 2025 12:32:43 +0000 Subject: [PATCH 33/38] Bump version to 0.1.2 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- VERSION | 2 +- lib/chef-vault/version.rb | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dfb442..43484ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,17 @@ # chef-vault Change Log - -## [v0.1.1](https://github.com/chef/chef-vault/tree/v0.1.1) (2025-01-06) + +## [v0.1.2](https://github.com/chef/chef-vault/tree/v0.1.2) (2025-01-06) #### Merged Pull Requests -- Adding pipelines to trigger pipeline automatically [#426](https://github.com/chef/chef-vault/pull/426) ([nikhil2611](https://github.com/nikhil2611)) +- Empty commit to test pipelines [#427](https://github.com/chef/chef-vault/pull/427) ([nikhil2611](https://github.com/nikhil2611)) ### Changes not yet released to rubygems.org #### Merged Pull Requests +- Empty commit to test pipelines [#427](https://github.com/chef/chef-vault/pull/427) ([nikhil2611](https://github.com/nikhil2611)) - Adding pipelines to trigger pipeline automatically [#426](https://github.com/chef/chef-vault/pull/426) ([nikhil2611](https://github.com/nikhil2611)) - Removed the manually created pipelines and added the channels [#425](https://github.com/chef/chef-vault/pull/425) ([nikhil2611](https://github.com/nikhil2611)) - Test commit for pipeline testing [#424](https://github.com/chef/chef-vault/pull/424) ([ashiqueps](https://github.com/ashiqueps)) diff --git a/VERSION b/VERSION index 6da28dd..8294c18 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.1 \ No newline at end of file +0.1.2 \ No newline at end of file diff --git a/lib/chef-vault/version.rb b/lib/chef-vault/version.rb index 45375a7..ff3ae3f 100644 --- a/lib/chef-vault/version.rb +++ b/lib/chef-vault/version.rb @@ -15,6 +15,6 @@ # limitations under the License. class ChefVault - VERSION = "0.1.1" + VERSION = "0.1.2" MAJOR, MINOR, TINY = VERSION.split(".") end From 32f8dfdd9ffab9ec9562b3534f7b4561db650df9 Mon Sep 17 00:00:00 2001 From: Nikhil Gupta <35272911+nikhil2611@users.noreply.github.com> Date: Thu, 23 Jan 2025 13:14:29 +0530 Subject: [PATCH 34/38] Chef-18535 Removed the release branch changes and fixed pipeline (#428) * updating version to major version and few plan file fixes Signed-off-by: nikhil2611 * reverting back the release branch changes and version update Signed-off-by: nikhil2611 * swapping order of action Signed-off-by: nikhil2611 * swapping order of action to fix expeditor error Signed-off-by: nikhil2611 * commenting the trigger pipeline to test expeditor config Signed-off-by: nikhil2611 * commenting the build gem to test expeditor config Signed-off-by: nikhil2611 * commenting the build gem to test expeditor config Signed-off-by: nikhil2611 * fixing expeditor error Signed-off-by: nikhil2611 * fixing expeditor error Signed-off-by: nikhil2611 * fixing the expeditor errro Signed-off-by: nikhil2611 * adding back the trigger pipeline Signed-off-by: nikhil2611 * adding old config to test the expeditor failure Signed-off-by: nikhil2611 * now trying to add updated config Signed-off-by: nikhil2611 * adding release branch to test the expeditor validation Signed-off-by: nikhil2611 * reverted back the release branch Signed-off-by: nikhil2611 * update to unstable channel in the workload Signed-off-by: nikhil2611 * removed the build gem Signed-off-by: nikhil2611 * added back the release branch Signed-off-by: nikhil2611 * added back the release branch Signed-off-by: nikhil2611 * added the env variable in the builkite config Signed-off-by: nikhil2611 --------- Signed-off-by: nikhil2611 --- .expeditor/build.habitat.yml | 3 ++ .../buildkite/artifact.habitat.test.ps1 | 1 - .expeditor/buildkite/artifact.habitat.test.sh | 1 - .expeditor/config.yml | 14 +++----- .expeditor/habitat-test.pipeline.yml | 2 ++ VERSION | 2 +- habitat/plan.ps1 | 1 - habitat/plan.sh | 33 ++++++++++--------- lib/chef-vault/version.rb | 2 +- 9 files changed, 29 insertions(+), 30 deletions(-) diff --git a/.expeditor/build.habitat.yml b/.expeditor/build.habitat.yml index 72ea256..5c7e6ed 100644 --- a/.expeditor/build.habitat.yml +++ b/.expeditor/build.habitat.yml @@ -1,4 +1,7 @@ --- +env: + HAB_REFRESH_CHANNEL: "LTS-2024" + origin: chef expeditor: diff --git a/.expeditor/buildkite/artifact.habitat.test.ps1 b/.expeditor/buildkite/artifact.habitat.test.ps1 index b9befd9..b63683b 100644 --- a/.expeditor/buildkite/artifact.habitat.test.ps1 +++ b/.expeditor/buildkite/artifact.habitat.test.ps1 @@ -5,7 +5,6 @@ # TODO: Set-StrictMode -Version Latest $PSDefaultParameterValues['*:ErrorAction']='Stop' $ErrorActionPreference = 'Stop' -$env:HAB_BLDR_CHANNEL = "LTS-2024" $env:HAB_ORIGIN = 'ci' $env:CHEF_LICENSE = 'accept-no-persist' $env:HAB_LICENSE = 'accept-no-persist' diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index a78e0a8..2233bd8 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -6,7 +6,6 @@ export HAB_ORIGIN='ci' export PLAN='chef-vault' export CHEF_LICENSE="accept-no-persist" export HAB_LICENSE="accept-no-persist" -export HAB_BLDR_CHANNEL="LTS-2024" echo "--- checking if git is installed" if ! command -v git &> /dev/null; then diff --git a/.expeditor/config.yml b/.expeditor/config.yml index afd4f60..024448a 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -10,9 +10,8 @@ rubygems: - chef-vault artifact_channels: - - dev - - workstation-build - - LTS-2024 + - unstable + - chef-dke-lts2024 github: # This deletes the GitHub PR branch after successfully merged into the release branch @@ -62,17 +61,13 @@ subscriptions: - built_in:promote_habitat_packages # Subscribe to the promotion of the dev channel to acceptance - - workload: project_promoted:{{agent_id}}:dev:* - actions: - - built_in:promote_habitat_packages - - workload: project_promoted:{{agent_id}}:workstation-build:* + - workload: project_promoted:{{agent_id}}:unstable:* actions: - built_in:promote_habitat_packages pipelines: - verify: description: Pull Request validation tests - public: true - habitat/build: env: - HAB_NONINTERACTIVE: "true" @@ -85,5 +80,4 @@ pipelines: - HAB_NONINTERACTIVE: "true" - HAB_NOCOLORING: "true" - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" - trigger: pull_request - + trigger: pull_request \ No newline at end of file diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index f49e004..f85d2a3 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -3,6 +3,8 @@ expeditor: defaults: buildkite: timeout_in_minutes: 30 + env: + HAB_REFRESH_CHANNEL: "LTS-2024" retry: automatic: limit: 1 diff --git a/VERSION b/VERSION index 8294c18..068399f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.2 \ No newline at end of file +4.1.13 \ No newline at end of file diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 index 72c3128..1c3a7fd 100644 --- a/habitat/plan.ps1 +++ b/habitat/plan.ps1 @@ -1,7 +1,6 @@ $ErrorActionPreference = "Stop" $PSDefaultParameterValues['*:ErrorAction']='Stop' -$env:HAB_BLDR_CHANNEL = "LTS-2024" $pkg_name="chef-vault" $pkg_origin="chef" $pkg_version=$(Get-Content "$PLAN_CONTEXT/../VERSION") diff --git a/habitat/plan.sh b/habitat/plan.sh index 338ca25..2d83e23 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -1,5 +1,4 @@ -export HAB_BLDR_CHANNEL="LTS-2024" -_chef_client_ruby="core/ruby3_1" +ruby_pkg="core/ruby3_1" pkg_name="chef-vault" pkg_origin="chef" pkg_maintainer="The Chef Maintainers " @@ -7,7 +6,6 @@ pkg_description="Gem that allows you to encrypt a Chef Data Bag Item using the p pkg_license=('Apache-2.0') pkg_bin_dirs=( bin - vendor/bin ) pkg_build_deps=( core/make @@ -15,13 +13,18 @@ pkg_build_deps=( core/gcc core/libarchive ) -pkg_deps=( - $_chef_client_ruby - core/coreutils - core/git -) +pkg_deps=(${ruby_pkg} core/coreutils core/git) + pkg_svc_user=root +do_setup_environment() { + build_line 'Setting GEM_HOME="$pkg_prefix/vendor"' + export GEM_HOME="$pkg_prefix/vendor" + + build_line "Setting GEM_PATH=$GEM_HOME" + export GEM_PATH="$GEM_HOME" +} + pkg_version() { cat "$SRC_PATH/VERSION" } @@ -36,8 +39,8 @@ do_unpack() { } do_build() { - echo $(pkg_path_for $_chef_client_ruby) - export GEM_HOME="$pkg_prefix/vendor/gems" + + export GEM_HOME="$pkg_prefix/vendor" build_line "Setting GEM_PATH=$GEM_HOME" export GEM_PATH="$GEM_HOME" @@ -50,13 +53,13 @@ do_build() { } do_install() { - export GEM_HOME="$pkg_prefix/vendor/gems" + export GEM_HOME="$pkg_prefix/vendor" build_line "Setting GEM_PATH=$GEM_HOME" export GEM_PATH="$GEM_HOME" gem install chef-vault-*.gem --no-document wrap_ruby_chef_vault - set_runtime_env "GEM_PATH" "${pkg_prefix}/vendor/gems" + set_runtime_env "GEM_PATH" "${pkg_prefix}/vendor" } wrap_ruby_chef_vault() { @@ -77,10 +80,10 @@ set -e export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:\$PATH" # Set Ruby paths defined from 'do_setup_environment()' -export GEM_HOME="$pkg_prefix/vendor/gems" -export GEM_PATH="\$GEM_HOME" +export GEM_HOME="$pkg_prefix/vendor" +export GEM_PATH="$GEM_PATH" -exec $(pkg_path_for $_chef_client_ruby)/bin/ruby $real_bin \$@ +exec $(pkg_path_for ${ruby_pkg})/bin/ruby $real_bin \$@ EOF chmod -v 755 "$bin" } diff --git a/lib/chef-vault/version.rb b/lib/chef-vault/version.rb index ff3ae3f..2b92c91 100644 --- a/lib/chef-vault/version.rb +++ b/lib/chef-vault/version.rb @@ -15,6 +15,6 @@ # limitations under the License. class ChefVault - VERSION = "0.1.2" + VERSION = "4.1.13" MAJOR, MINOR, TINY = VERSION.split(".") end From 9cc13decf94463a744e3127fea8229e044a9ddf5 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Thu, 23 Jan 2025 13:50:07 +0530 Subject: [PATCH 35/38] updated workload and removed release branch Signed-off-by: nikhil2611 --- .expeditor/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 024448a..6609d9b 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -26,8 +26,6 @@ github: - "Expeditor: Bump Version Major" release_branches: - - workstation-LTS: - version_constraint: 0.* - main: version_constraint: 4.* @@ -53,6 +51,8 @@ subscriptions: ignore_labels: - "Expeditor: Skip Habitat" - "Expeditor: Skip All" + - built_in:build_gem: + only_if: built_in:bump_version # the habitat chain - workload: buildkite_hab_build_group_published:{{agent_id}}:* @@ -64,6 +64,8 @@ subscriptions: - workload: project_promoted:{{agent_id}}:unstable:* actions: - built_in:promote_habitat_packages + - built_in:rollover_changelog + - built_in:publish_rubygems pipelines: - verify: From 7f790f88545271838526b194828652cf66b0146a Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Thu, 23 Jan 2025 14:18:56 +0530 Subject: [PATCH 36/38] removing the build and publish ruby gem as its failing the expeditor config Signed-off-by: nikhil2611 --- .expeditor/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 6609d9b..21b166e 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -51,8 +51,6 @@ subscriptions: ignore_labels: - "Expeditor: Skip Habitat" - "Expeditor: Skip All" - - built_in:build_gem: - only_if: built_in:bump_version # the habitat chain - workload: buildkite_hab_build_group_published:{{agent_id}}:* @@ -64,8 +62,6 @@ subscriptions: - workload: project_promoted:{{agent_id}}:unstable:* actions: - built_in:promote_habitat_packages - - built_in:rollover_changelog - - built_in:publish_rubygems pipelines: - verify: From 494984876b1bba1d2c2f04e77e428ce5598b3cec Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Thu, 23 Jan 2025 16:00:06 +0530 Subject: [PATCH 37/38] fixing expeditor config error Signed-off-by: nikhil2611 --- .expeditor/config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 21b166e..237f0bc 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -46,22 +46,29 @@ subscriptions: ignore_labels: - "Expeditor: Skip Changelog" - "Expeditor: Skip All" + - built_in:build_gem: + only_if: built_in:bump_version - trigger_pipeline:habitat/build: only_if: built_in:bump_version ignore_labels: - "Expeditor: Skip Habitat" - "Expeditor: Skip All" + - workload: project_promoted:{{agent_id}}:* + actions: + - built_in:rollover_changelog + # the habitat chain - workload: buildkite_hab_build_group_published:{{agent_id}}:* actions: # when all of the hab package publish to the unstable channel, test and promote them - built_in:promote_habitat_packages - # Subscribe to the promotion of the dev channel to acceptance + # Subscribe to the promotion of the unstable channel to stable(chef-dke-lts2024) - workload: project_promoted:{{agent_id}}:unstable:* actions: - built_in:promote_habitat_packages + - built_in:publish_rubygems pipelines: - verify: From 0721d392fdcbc5d4370e6859f65f1dbed04290e8 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Thu, 23 Jan 2025 20:05:53 +0530 Subject: [PATCH 38/38] removed the workload as per comments Signed-off-by: nikhil2611 --- .expeditor/config.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 237f0bc..d3b6dad 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -58,12 +58,6 @@ subscriptions: actions: - built_in:rollover_changelog - # the habitat chain - - workload: buildkite_hab_build_group_published:{{agent_id}}:* - actions: - # when all of the hab package publish to the unstable channel, test and promote them - - built_in:promote_habitat_packages - # Subscribe to the promotion of the unstable channel to stable(chef-dke-lts2024) - workload: project_promoted:{{agent_id}}:unstable:* actions: