Skip to content

Commit 08243bc

Browse files
authored
Merge branch 'main' into master
2 parents fc0237f + 1b78904 commit 08243bc

30 files changed

Lines changed: 284 additions & 324 deletions

.fixtures.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ fixtures:
66
"provision": "https://github.com/puppetlabs/provision.git"
77
puppet_agent:
88
repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
9-
ref: v4.21.0

.github/workflows/ci.yml

Lines changed: 24 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -4,100 +4,34 @@ on:
44
pull_request:
55
branches:
66
- "main"
7+
pull_request_target:
8+
types: [labeled, reopened]
9+
branches:
10+
- "main"
711
workflow_dispatch:
8-
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
920
jobs:
1021
Spec:
22+
if: github.event_name != 'pull_request_target'
1123
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
12-
with:
13-
runs_on: "ubuntu-24.04"
1424
secrets: "inherit"
1525

16-
setup_matrix:
17-
name: "Setup Test Matrix"
18-
needs: "Spec"
19-
runs-on: ubuntu-24.04
20-
outputs:
21-
matrix: ${{ steps.get-matrix.outputs.matrix }}
22-
23-
steps:
24-
- name: Checkout Source
25-
uses: actions/checkout@v3
26-
27-
- name: Activate Ruby 3.1
28-
uses: ruby/setup-ruby@v1
29-
with:
30-
ruby-version: "3.1"
31-
bundler-cache: true
32-
33-
- name: Print bundle environment
34-
run: |
35-
echo ::group::bundler environment
36-
bundle env
37-
echo ::endgroup::
38-
39-
- name: Setup Acceptance Test Matrix
40-
id: get-matrix
41-
run: |
42-
bundle exec matrix_from_metadata_v2 --exclude-platforms '["Debian-12-arm", "Ubuntu-22.04-arm", "RedHat-9-arm"]'
43-
4426
Acceptance:
45-
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
46-
needs:
47-
- setup_matrix
48-
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}
49-
50-
runs-on: ubuntu-24.04
51-
strategy:
52-
fail-fast: false
53-
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
54-
55-
env:
56-
PUPPET_GEM_VERSION: '~> 7.24'
57-
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main'
58-
59-
steps:
60-
- name: Checkout Source
61-
uses: actions/checkout@v3
62-
63-
- name: Activate Ruby 3.1
64-
uses: ruby/setup-ruby@v1
65-
with:
66-
ruby-version: "3.1"
67-
bundler-cache: true
68-
69-
- name: Print bundle environment
70-
run: |
71-
bundle env
72-
73-
- name: "Disable mysqld apparmor profile"
74-
if: ${{matrix.platforms.provider == 'docker'}}
75-
run: |
76-
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
77-
sudo apparmor_parser -R /etc/apparmor.d/disable/usr.sbin.mysqld
78-
sudo systemctl disable apparmor
79-
sudo systemctl stop apparmor
80-
81-
- name: Provision test environment
82-
run: |
83-
bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
84-
FILE='spec/fixtures/litmus_inventory.yaml'
85-
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
86-
87-
- name: Install agent
88-
run: |
89-
bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
90-
91-
- name: Install module
92-
run: |
93-
bundle exec rake 'litmus:install_module'
94-
95-
- name: Run acceptance tests
96-
run: |
97-
bundle exec rake 'litmus:acceptance:parallel'
98-
99-
- name: Remove test environment
100-
if: ${{ always() }}
101-
continue-on-error: true
102-
run: |
103-
bundle exec rake 'litmus:tear_down'
27+
if: >-
28+
github.event_name == 'workflow_dispatch' ||
29+
(github.event_name == 'pull_request' &&
30+
github.event.pull_request.head.repo.fork == false) ||
31+
(github.event_name == 'pull_request_target' &&
32+
github.event.pull_request.head.repo.fork == true &&
33+
contains(github.event.pull_request.labels.*.name, 'allowed-for-ci'))
34+
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
35+
with:
36+
flags: "--nightly --platform-exclude centos-7 --platform-exclude scientific-7 --platform-exclude oraclelinux-7 --platform-exclude almalinux-8 --arch-exclude arm"
37+
secrets: "inherit"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Fork CI Label Guard"
2+
3+
on:
4+
pull_request_target:
5+
types: [synchronize, closed]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
strip:
12+
uses: "puppetlabs/cat-github-actions/.github/workflows/fork_ci_label_guard.yml@main"

.github/workflows/nightly.yml

Lines changed: 5 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -8,95 +8,11 @@ on:
88
jobs:
99
Spec:
1010
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
11-
with:
12-
runs_on: "ubuntu-24.04"
1311
secrets: "inherit"
1412

15-
setup_matrix:
16-
name: "Setup Test Matrix"
17-
needs: "Spec"
18-
runs-on: ubuntu-24.04
19-
outputs:
20-
matrix: ${{ steps.get-matrix.outputs.matrix }}
21-
22-
steps:
23-
- name: Checkout Source
24-
uses: actions/checkout@v3
25-
26-
- name: Activate Ruby 3.1
27-
uses: ruby/setup-ruby@v1
28-
with:
29-
ruby-version: "3.1"
30-
bundler-cache: true
31-
32-
- name: Print bundle environment
33-
run: |
34-
echo ::group::bundler environment
35-
bundle env
36-
echo ::endgroup::
37-
38-
- name: Setup Acceptance Test Matrix
39-
id: get-matrix
40-
run: |
41-
bundle exec matrix_from_metadata_v2 --exclude-platforms '["Debian-12-arm", "Ubuntu-22.04-arm", "RedHat-9-arm"]'
42-
4313
Acceptance:
44-
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
45-
needs:
46-
- setup_matrix
47-
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}
48-
49-
runs-on: ubuntu-24.04
50-
strategy:
51-
fail-fast: false
52-
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
53-
54-
env:
55-
PUPPET_GEM_VERSION: '~> 7.24'
56-
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main'
57-
58-
steps:
59-
- name: Checkout Source
60-
uses: actions/checkout@v3
61-
62-
- name: Activate Ruby 3.1
63-
uses: ruby/setup-ruby@v1
64-
with:
65-
ruby-version: "3.1"
66-
bundler-cache: true
67-
68-
- name: Print bundle environment
69-
run: |
70-
bundle env
71-
72-
- name: "Disable mysqld apparmor profile"
73-
if: ${{matrix.platforms.provider == 'docker'}}
74-
run: |
75-
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
76-
sudo apparmor_parser -R /etc/apparmor.d/disable/usr.sbin.mysqld
77-
sudo systemctl disable apparmor
78-
sudo systemctl stop apparmor
79-
80-
- name: Provision test environment
81-
run: |
82-
bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
83-
FILE='spec/fixtures/litmus_inventory.yaml'
84-
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
85-
86-
- name: Install agent
87-
run: |
88-
bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
89-
90-
- name: Install module
91-
run: |
92-
bundle exec rake 'litmus:install_module'
93-
94-
- name: Run acceptance tests
95-
run: |
96-
bundle exec rake 'litmus:acceptance:parallel'
97-
98-
- name: Remove test environment
99-
if: ${{ always() }}
100-
continue-on-error: true
101-
run: |
102-
bundle exec rake 'litmus:tear_down'
14+
needs: Spec
15+
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
16+
with:
17+
flags: "--nightly --platform-exclude centos-7 --platform-exclude scientific-7 --platform-exclude oraclelinux-7 --platform-exclude almalinux-8 --arch-exclude arm"
18+
secrets: "inherit"

.puppet-lint.rc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
--fail-on-warnings
12
--relative
3+
--no-80chars-check
4+
--no-140chars-check
5+
--no-class_inherits_from_params_class-check
6+
--no-autoloader_layout-check
7+
--no-documentation-check
8+
--no-single_quote_string_with_variables-check
29
--no-anchor_resource-check
310
--no-params_empty_string_assignment-check
11+
--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp

.rubocop.yml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
22
inherit_from: .rubocop_todo.yml
3-
require:
3+
plugins:
44
- rubocop-performance
5+
- rubocop-hash_inspect
56
- rubocop-rspec
7+
- rubocop-rspec_rails
8+
- rubocop-factory_bot
9+
- rubocop-capybara
610
AllCops:
711
NewCops: enable
812
DisplayCopNames: true
9-
TargetRubyVersion: '2.6'
13+
TargetRubyVersion: 3.1
1014
Include:
1115
- "**/*.rb"
1216
Exclude:
@@ -107,6 +111,8 @@ Performance/StringInclude:
107111
Enabled: true
108112
Performance/Sum:
109113
Enabled: true
114+
Security/IoMethods:
115+
Enabled: true
110116
Style/CollectionMethods:
111117
Enabled: true
112118
Style/MethodCalledOnDoEndBlock:
@@ -121,6 +127,12 @@ Capybara/CurrentPathExpectation:
121127
Enabled: false
122128
Capybara/VisibilityMatcher:
123129
Enabled: false
130+
FactoryBot/AttributeDefinedStatically:
131+
Enabled: false
132+
FactoryBot/CreateList:
133+
Enabled: false
134+
FactoryBot/FactoryClassName:
135+
Enabled: false
124136
Gemspec/DuplicatedAssignment:
125137
Enabled: false
126138
Gemspec/OrderedDependencies:
@@ -295,8 +307,6 @@ Performance/UriDefaultParser:
295307
Enabled: false
296308
RSpec/Be:
297309
Enabled: false
298-
RSpec/Capybara/FeatureMethods:
299-
Enabled: false
300310
RSpec/ContainExactly:
301311
Enabled: false
302312
RSpec/ContextMethod:
@@ -305,6 +315,8 @@ RSpec/ContextWording:
305315
Enabled: false
306316
RSpec/DescribeClass:
307317
Enabled: false
318+
RSpec/Dialect:
319+
Enabled: false
308320
RSpec/EmptyHook:
309321
Enabled: false
310322
RSpec/EmptyLineAfterExample:
@@ -321,12 +333,6 @@ RSpec/ExpectChange:
321333
Enabled: false
322334
RSpec/ExpectInHook:
323335
Enabled: false
324-
RSpec/FactoryBot/AttributeDefinedStatically:
325-
Enabled: false
326-
RSpec/FactoryBot/CreateList:
327-
Enabled: false
328-
RSpec/FactoryBot/FactoryClassName:
329-
Enabled: false
330336
RSpec/HooksBeforeExamples:
331337
Enabled: false
332338
RSpec/ImplicitBlockExpectation:
@@ -375,8 +381,6 @@ RSpec/VoidExpect:
375381
Enabled: false
376382
RSpec/Yield:
377383
Enabled: false
378-
Security/Open:
379-
Enabled: false
380384
Style/AccessModifierDeclarations:
381385
Enabled: false
382386
Style/AccessorGrouping:
@@ -501,6 +505,12 @@ Capybara/SpecificFinders:
501505
Enabled: false
502506
Capybara/SpecificMatcher:
503507
Enabled: false
508+
FactoryBot/ConsistentParenthesesStyle:
509+
Enabled: false
510+
FactoryBot/FactoryNameStyle:
511+
Enabled: false
512+
FactoryBot/SyntaxMethods:
513+
Enabled: false
504514
Gemspec/DeprecatedAttributeAssignment:
505515
Enabled: false
506516
Gemspec/DevelopmentDependencies:
@@ -601,28 +611,12 @@ RSpec/DuplicatedMetadata:
601611
Enabled: false
602612
RSpec/ExcessiveDocstringSpacing:
603613
Enabled: false
604-
RSpec/FactoryBot/ConsistentParenthesesStyle:
605-
Enabled: false
606-
RSpec/FactoryBot/FactoryNameStyle:
607-
Enabled: false
608-
RSpec/FactoryBot/SyntaxMethods:
609-
Enabled: false
610614
RSpec/IdenticalEqualityAssertion:
611615
Enabled: false
612616
RSpec/NoExpectationExample:
613617
Enabled: false
614618
RSpec/PendingWithoutReason:
615619
Enabled: false
616-
RSpec/Rails/AvoidSetupHook:
617-
Enabled: false
618-
RSpec/Rails/HaveHttpStatus:
619-
Enabled: false
620-
RSpec/Rails/InferredSpecType:
621-
Enabled: false
622-
RSpec/Rails/MinitestAssertions:
623-
Enabled: false
624-
RSpec/Rails/TravelAround:
625-
Enabled: false
626620
RSpec/RedundantAround:
627621
Enabled: false
628622
RSpec/SkipBlockInsideExample:
@@ -633,9 +627,17 @@ RSpec/SubjectDeclaration:
633627
Enabled: false
634628
RSpec/VerifiedDoubleReference:
635629
Enabled: false
636-
Security/CompoundHash:
630+
RSpecRails/AvoidSetupHook:
637631
Enabled: false
638-
Security/IoMethods:
632+
RSpecRails/HaveHttpStatus:
633+
Enabled: false
634+
RSpecRails/InferredSpecType:
635+
Enabled: false
636+
RSpecRails/MinitestAssertions:
637+
Enabled: false
638+
RSpecRails/TravelAround:
639+
Enabled: false
640+
Security/CompoundHash:
639641
Enabled: false
640642
Style/ArgumentsForwarding:
641643
Enabled: false

0 commit comments

Comments
 (0)