23 changes: 17 additions & 6 deletions .github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ on:

jobs:
daily_unit_tests_with_nightly_puppet_gem:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
puppet_version: [ 5, 6, 7 ]
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 5
ruby: 2.4
- puppet_version: 6
ruby: 2.5
- puppet_version: 7
Expand All @@ -28,7 +26,7 @@ jobs:
os_type: 'macOS'
env_set_cmd: 'export '
gem_file: 'puppet-latest-universal-darwin.gem'
- os: 'windows-2019'
- os: 'windows-2016'
os_type: 'Windows'
env_set_cmd: '$env:'
gem_file: 'puppet-latest-x64-mingw32.gem'
Expand All @@ -50,9 +48,22 @@ jobs:
- name: Prepare testing environment with bundler
run: |
git config --global core.longpaths true
bundle config set system 'true'
bundle config set --local without 'release'
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
bundle update --jobs 4 --retry 3
- name: Run unit tests
run: bundle exec rake parallel_spec

notify-via-slack:
name: Notify workflow conclusion via Slack
if: ${{ always() }}
needs: daily_unit_tests_with_nightly_puppet_gem
runs-on: 'ubuntu-latest'
steps:
- uses: luchihoratiu/notify-via-slack@main
with:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
12 changes: 10 additions & 2 deletions .github/workflows/static_code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,29 @@ jobs:
name: Run checks

env:
ruby_version: 2.5
ruby_version: 2.6
extra_checks: check:symlinks check:git_ignore check:dot_underscore check:test_file

runs-on: 'ubuntu-18.04'
steps:
- name: Checkout current PR code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install ruby version ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby_version }}

- name: Prepare testing environment with bundler
run: bundle update --jobs 4 --retry 3
run: |
git config --global core.longpaths true
bundle config set --local without 'release'
bundle update --jobs 4 --retry 3
- name: Run commits check
run: bundle exec rake commits

- name: Run rubocop check
run: bundle exec rake ${{ env.extra_checks }} rubocop
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/unit_tests_with_nightly_puppet_gem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ jobs:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
puppet_version: [ 5, 6, 7 ]
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 5
ruby: 2.4
- puppet_version: 6
ruby: 2.5
- puppet_version: 7
Expand All @@ -30,7 +28,7 @@ jobs:
os_type: 'macOS'
env_set_cmd: 'export '
gem_file: 'puppet-latest-universal-darwin.gem'
- os: 'windows-2019'
- os: 'windows-2016'
os_type: 'Windows'
env_set_cmd: '$env:'
gem_file: 'puppet-latest-x64-mingw32.gem'
Expand All @@ -52,7 +50,9 @@ jobs:
- name: Prepare testing environment with bundler
run: |
git config --global core.longpaths true
bundle config set system 'true'
bundle config set --local without 'release'
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
bundle update --jobs 4 --retry 3
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/unit_tests_with_released_puppet_gem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ on:

jobs:
unit_tests_with_released_puppet_gem:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
puppet_version: [ 5, 6 ]
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 5
ruby: 2.4
- puppet_version: 6
ruby: 2.5
- puppet_version: 7
ruby: 2.7

- os: 'ubuntu-18.04'
os_type: 'Linux'
- os: 'macos-10.15'
os_type: 'macOS'
- os: 'windows-2019'
- os: 'windows-2016'
os_type: 'Windows'

runs-on: ${{ matrix.os }}
Expand All @@ -41,7 +41,9 @@ jobs:

- name: Prepare testing environment with bundler
run: |
git config --global core.longpaths true
bundle config set system 'true'
bundle config set --local without 'release'
bundle update --jobs 4 --retry 3
- name: Run unit tests
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [1.1.2](https://github.com/puppetlabs/puppetlabs-augeas_core/tree/1.1.2) (2021-03-08)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-augeas_core/compare/1.1.1...1.1.2)

### Fixed

- \(MODULES-10950\) Infer application name from run mode [\#37](https://github.com/puppetlabs/puppetlabs-augeas_core/pull/37) ([GabrielNagy](https://github.com/GabrielNagy))

## [1.1.1](https://github.com/puppetlabs/puppetlabs-augeas_core/tree/1.1.1) (2020-09-29)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-augeas_core/compare/1.1.0...1.1.1)
Expand Down
12 changes: 8 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,21 @@ group :development do
gem "puppet-strings", require: false
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
end

group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-blacksmith", '~> 3.4', require: false
gem "puppet-module-posix-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.5')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 1.0')
gem "pdk", '~> 1.18', platforms: [:ruby]
end

group :release do
gem "puppet-blacksmith", '~> 3.4', require: false
gem "pdk", *location_for(ENV['PDK_VERSION'] || '~> 2')
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
25 changes: 25 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,28 @@ EOM
end
end

desc "verify that commit messages match CONTRIBUTING.md requirements"
task(:commits) do
# This rake task looks at the summary from every commit from this branch not
# in the branch targeted for a PR.
commit_range = 'HEAD^..HEAD'
puts "Checking commits #{commit_range}"
%x{git log --no-merges --pretty=%s #{commit_range}}.each_line do |commit_summary|
# This regex tests for the currently supported commit summary tokens.
# The exception tries to explain it in more full.
if /^\((maint|packaging|doc|docs|modules-\d+)\)|revert/i.match(commit_summary).nil?
raise "\n\n\n\tThis commit summary didn't match CONTRIBUTING.md guidelines:\n" \
"\n\t\t#{commit_summary}\n" \
"\tThe commit summary (i.e. the first line of the commit message) should start with one of:\n" \
"\t\t(MODULES-<digits>) # this is most common and should be a ticket at tickets.puppet.com\n" \
"\t\t(docs)\n" \
"\t\t(docs)(DOCUMENT-<digits>)\n" \
"\t\t(packaging)\n"
"\t\t(maint)\n" \
"\n\tThis test for the commit summary is case-insensitive.\n\n\n"
else
puts "#{commit_summary}"
end
puts "...passed"
end
end
2 changes: 1 addition & 1 deletion lib/puppet/provider/augeas/augeas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def get_load_path(resource)
load_path.flatten!
end

if Puppet::Application.name == :agent
if Puppet.run_mode.name == :agent
if Puppet::FileSystem.exist?("#{Puppet[:libdir]}/augeas/lenses")
load_path << "#{Puppet[:libdir]}/augeas/lenses"
end
Expand Down
28 changes: 19 additions & 9 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-augeas_core",
"version": "1.1.1",
"version": "1.1.2",
"author": "puppetlabs",
"summary": "Manage files using Augeas",
"license": "Apache-2.0",
Expand All @@ -14,50 +14,60 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8"
"8",
"9",
"10"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04"
"16.04",
"18.04",
"20.04"
]
},
{
"operatingsystem": "Fedora",
"operatingsystemrelease": [
"25"
"30",
"31",
"32"
]
}
],
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 6.0.0 < 7.0.0"
"version_requirement": ">= 6.0.0 < 8.0.0"
}
],
"pdk-version": "1.14.0",
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/provider/augeas/augeas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ def make_tmpname((prefix, suffix), n)
context 'when running application is agent' do
before(:each) do
Puppet[:libdir] = my_fixture_dir
Puppet::Application.stubs(:name).returns(:agent)
Puppet.run_mode.stubs(:name).returns(:agent)
end

it 'offers pluginsync augeas/lenses subdir' do
Expand All @@ -1139,7 +1139,7 @@ def make_tmpname((prefix, suffix), n)

context 'when running application is not agent' do
before(:each) do
Puppet::Application.stubs(:name).returns(:apply)
Puppet.run_mode.stubs(:name).returns(:user)

env = Puppet::Node::Environment.create('root', ['/modules/foobar'])
Puppet.stubs(:lookup).returns(env)
Expand Down