Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ jobs:
Acceptance:
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
with:
flags: "--nightly"
secrets: "inherit"
3 changes: 0 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,4 @@ jobs:
Acceptance:
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
with:
flags: "--nightly"
secrets: "inherit"

43 changes: 1 addition & 42 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
plugins:
require:
- rubocop-performance
- rubocop-rspec
- rubocop-rspec_rails
- rubocop-factory_bot
- rubocop-capybara
AllCops:
NewCops: enable
DisplayCopNames: true
Expand Down Expand Up @@ -120,16 +117,6 @@ Bundler/GemFilename:
Enabled: false
Bundler/InsecureProtocolSource:
Enabled: false
Capybara/CurrentPathExpectation:
Enabled: false
Capybara/VisibilityMatcher:
Enabled: false
FactoryBot/AttributeDefinedStatically:
Enabled: false
FactoryBot/CreateList:
Enabled: false
FactoryBot/FactoryClassName:
Enabled: false
Gemspec/DuplicatedAssignment:
Enabled: false
Gemspec/OrderedDependencies:
Expand Down Expand Up @@ -312,8 +299,6 @@ RSpec/ContextWording:
Enabled: false
RSpec/DescribeClass:
Enabled: false
RSpec/Dialect:
Enabled: false
RSpec/EmptyHook:
Enabled: false
RSpec/EmptyLineAfterExample:
Expand Down Expand Up @@ -494,22 +479,6 @@ Style/TrailingMethodEndStatement:
Enabled: false
Style/UnpackFirst:
Enabled: false
Capybara/MatchStyle:
Enabled: false
Capybara/NegationMatcher:
Enabled: false
Capybara/SpecificActions:
Enabled: false
Capybara/SpecificFinders:
Enabled: false
Capybara/SpecificMatcher:
Enabled: false
FactoryBot/ConsistentParenthesesStyle:
Enabled: false
FactoryBot/FactoryNameStyle:
Enabled: false
FactoryBot/SyntaxMethods:
Enabled: false
Gemspec/DeprecatedAttributeAssignment:
Enabled: false
Gemspec/DevelopmentDependencies:
Expand Down Expand Up @@ -626,16 +595,6 @@ RSpec/SubjectDeclaration:
Enabled: false
RSpec/VerifiedDoubleReference:
Enabled: false
RSpecRails/AvoidSetupHook:
Enabled: false
RSpecRails/HaveHttpStatus:
Enabled: false
RSpecRails/InferredSpecType:
Enabled: false
RSpecRails/MinitestAssertions:
Enabled: false
RSpecRails/TravelAround:
Enabled: false
Security/CompoundHash:
Enabled: false
Security/IoMethods:
Expand Down
17 changes: 15 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2025-10-16 14:43:56 UTC using RuboCop version 1.73.2.
# on 2025-11-24 20:22:19 UTC using RuboCop version 1.81.7.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -23,6 +23,17 @@ Lint/UselessConstantScoping:
Exclude:
- 'spec/legacy_taskscheduler.rb'

# Offense count: 4
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
# AllowedMethods: call
# WaywardPredicates: nonzero?
Naming/PredicateMethod:
Exclude:
- 'lib/puppet/provider/scheduled_task/taskscheduler_api2.rb'
- 'lib/puppet/provider/scheduled_task/win32_taskscheduler.rb'
- 'lib/puppet_x/puppet_labs/scheduled_task/task.rb'
- 'spec/legacy_taskscheduler.rb'

# Offense count: 10
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/BitwisePredicate:
Expand All @@ -33,8 +44,10 @@ Style/BitwisePredicate:

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
# SupportedStyles: nested, compact
# SupportedStylesForClasses: ~, nested, compact
# SupportedStylesForModules: ~, nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'lib/puppet_x/puppet_labs/scheduled_task/task.rb'
Expand Down
11 changes: 3 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,9 @@ group :development do
gem "pry", '~> 0.10', require: false
gem "simplecov-console", '~> 0.9', require: false
gem "puppet-debugger", '~> 1.6', require: false
gem "rubocop", '~> 1.73.0', require: false
gem "rubocop-performance", '~> 1.24.0', require: false
gem "rubocop-rspec", '~> 3.5.0', require: false
gem "rubocop-rspec_rails", '~> 2.31.0', require: false
gem "rubocop-factory_bot", '~> 2.27.0', require: false
gem "rubocop-capybara", '~> 2.22.0', require: false
gem "rubocop", '~> 1.72', require: false
gem "rubocop-performance", '= 1.16.0', require: false
gem "rubocop-rspec", '= 3.0', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "bigdecimal", '< 3.2.2', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end
Expand All @@ -74,12 +71,10 @@ group :system_tests do
end

gems = {}
bolt_version = ENV.fetch('BOLT_GEM_VERSION', nil)
puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil)
facter_version = ENV.fetch('FACTER_GEM_VERSION', nil)
hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil)

gems['bolt'] = location_for(bolt_version, nil, { source: gemsource_puppetcore })
gems['puppet'] = location_for(puppet_version, nil, { source: gemsource_puppetcore })
gems['facter'] = location_for(facter_version, nil, { source: gemsource_puppetcore })
gems['hiera'] = location_for(hiera_version, nil, {}) if hiera_version
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"version_requirement": ">= 8.0.0 < 9.0.0"
}
],
"pdk-version": "3.5.0",
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
"template-ref": "heads/main-0-gfa96b82"
"pdk-version": "3.5.1",
"template-url": "https://github.com/puppetlabs/pdk-templates.git#3.5.1",
"template-ref": "tags/3.5.1-0-g9d5b193"
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
subject = ST::Task

after :each do
if Puppet.features.microsoft_windows? && (defined?(task_name) && subject.exists?(task_name))
if Puppet.features.microsoft_windows? && defined?(task_name) && subject.exists?(task_name)
subject.delete(task_name)
end
end
Expand Down Expand Up @@ -111,19 +111,19 @@
context 'with new task' do
let(:task_name) { "puppet_task_#{SecureRandom.uuid}" }

it 'returns all tasks by default' do

Check warning on line 114 in spec/integration/puppet_x/puppet_labs/scheduled_task/task_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Scheduled Tasks API v2 When directly calling Scheduled Tasks API v2 #enum_task_names with new task returns all tasks by default Skipped: Not on Windows platform
subject_count = subject.enum_task_names.count
ps_cmd = '(Get-ScheduledTask | Measure-Object).count'
expect(subject_count).to be_same_as_powershell_command(ps_cmd)
end

it 'does not recurse folders if specified' do

Check warning on line 120 in spec/integration/puppet_x/puppet_labs/scheduled_task/task_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Scheduled Tasks API v2 When directly calling Scheduled Tasks API v2 #enum_task_names with new task does not recurse folders if specified Skipped: Not on Windows platform
subject_count = subject.enum_task_names(subject::ROOT_FOLDER, include_child_folders: false).count
ps_cmd = '(Get-ScheduledTask | ? { $_.TaskPath -eq \'\\\' } | Measure-Object).count'
expect(subject_count).to be_same_as_powershell_command(ps_cmd)
end

it 'onlies return compatible tasks if specified' do

Check warning on line 126 in spec/integration/puppet_x/puppet_labs/scheduled_task/task_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Scheduled Tasks API v2 When directly calling Scheduled Tasks API v2 #enum_task_names with new task onlies return compatible tasks if specified Skipped: Not on Windows platform
compatibility = [subject::TASK_COMPATIBILITY::TASK_COMPATIBILITY_V1]
subject_count = subject.enum_task_names(subject::ROOT_FOLDER, include_compatibility: compatibility).count
ps_cmd = '(Get-ScheduledTask | ? { [Int]$_.Settings.Compatibility -eq 1 } | Measure-Object).count'
Expand Down Expand Up @@ -154,19 +154,19 @@
end

context 'given a test task fixture' do
it 'is enabled by default' do

Check warning on line 157 in spec/integration/puppet_x/puppet_labs/scheduled_task/task_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Scheduled Tasks API v2 When directly calling Scheduled Tasks API v2 create a task in the root folder given a test task fixture is enabled by default Skipped: Not on Windows platform
expect(task_definition.Settings.Enabled).to be(true)
end

it 'is V2 compatible' do

Check warning on line 161 in spec/integration/puppet_x/puppet_labs/scheduled_task/task_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Scheduled Tasks API v2 When directly calling Scheduled Tasks API v2 create a task in the root folder given a test task fixture is V2 compatible Skipped: Not on Windows platform
expect(task_definition.Settings.Compatibility).to eq(subject::TASK_COMPATIBILITY::TASK_COMPATIBILITY_V2)
end

it 'has a single trigger' do

Check warning on line 165 in spec/integration/puppet_x/puppet_labs/scheduled_task/task_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Scheduled Tasks API v2 When directly calling Scheduled Tasks API v2 create a task in the root folder given a test task fixture has a single trigger Skipped: Not on Windows platform
expect(task_definition.Triggers.count).to eq(1)
end

it 'has a trigger of type TimeTrigger' do

Check warning on line 169 in spec/integration/puppet_x/puppet_labs/scheduled_task/task_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Scheduled Tasks API v2 When directly calling Scheduled Tasks API v2 create a task in the root folder given a test task fixture has a trigger of type TimeTrigger Skipped: Not on Windows platform
expect(task_definition.Triggers.Item(1).Type).to eq(ST::Trigger::V2::Type::TASK_TRIGGER_TIME)
end

Expand Down
14 changes: 7 additions & 7 deletions spec/legacy_taskscheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ module COM
# LPCWSTR, IScheduledWorkItem *
AddWorkItem: [[:lpcwstr, :pointer], :hresult],
# LPCWSTR, REFIID
IsOfType: [[:lpcwstr, :pointer], :hresult]
IsOfType: [[:lpcwstr, :pointer], :hresult],
]

TaskScheduler = com::Factory[ITaskScheduler,
Expand All @@ -1065,7 +1065,7 @@ module COM
Skip: [[:win32_ulong], :hresult],
Reset: [[], :hresult],
# IEnumWorkItems ** ppEnumWorkItems
Clone: [[:pointer], :hresult]
Clone: [[:pointer], :hresult],
]

EnumWorkItems = com::Instance[IEnumWorkItems]
Expand Down Expand Up @@ -1118,7 +1118,7 @@ module COM
GetFlags: [[:pointer], :hresult],
SetAccountInformation: [[:lpcwstr, :lpcwstr], :hresult],
# LPWSTR *
GetAccountInformation: [[:pointer], :hresult]
GetAccountInformation: [[:pointer], :hresult],
]

# https://msdn.microsoft.com/en-us/library/windows/desktop/aa381311(v=vs.85).aspx
Expand All @@ -1141,7 +1141,7 @@ module COM
GetTaskFlags: [[:pointer], :hresult],
SetMaxRunTime: [[:dword], :hresult],
# DWORD *
GetMaxRunTime: [[:pointer], :hresult]
GetMaxRunTime: [[:pointer], :hresult],
]

Task = com::Instance[ITask]
Expand All @@ -1150,7 +1150,7 @@ module COM
IPersist = com::Interface[com::IUnknown,
FFI::WIN32::GUID['0000010c-0000-0000-c000-000000000046'],
# CLSID *
GetClassID: [[:pointer], :hresult]
GetClassID: [[:pointer], :hresult],
]

# https://msdn.microsoft.com/en-us/library/windows/desktop/ms687223(v=vs.85).aspx
Expand All @@ -1161,7 +1161,7 @@ module COM
Save: [[:lpcolestr, :win32_bool], :hresult],
SaveCompleted: [[:lpcolestr], :hresult],
# LPOLESTR *
GetCurFile: [[:pointer], :hresult]
GetCurFile: [[:pointer], :hresult],
]

PersistFile = com::Instance[IPersistFile]
Expand All @@ -1171,7 +1171,7 @@ module COM
FFI::WIN32::GUID['148BD52B-A2AB-11CE-B11F-00AA00530503'],
SetTrigger: [[:pointer], :hresult],
GetTrigger: [[:pointer], :hresult],
GetTriggerString: [[:pointer], :hresult]
GetTriggerString: [[:pointer], :hresult],
]

TaskTrigger = com::Instance[ITaskTrigger]
Expand Down
Loading