Skip to content

Commit 1916981

Browse files
committed
pdksync_heads/main-0-gf3911d3
1 parent c58a2a8 commit 1916981

File tree

8 files changed

+62
-29
lines changed

8 files changed

+62
-29
lines changed

.devcontainer/README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# devcontainer
2+
3+
4+
For format details, see https://aka.ms/devcontainer.json.
5+
6+
For config options, see the README at:
7+
https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
8+
9+
``` json
10+
{
11+
"name": "Puppet Development Kit (Community)",
12+
"dockerFile": "Dockerfile",
13+
14+
// Set *default* container specific settings.json values on container create.
15+
"settings": {
16+
"terminal.integrated.shell.linux": "/bin/bash"
17+
},
18+
19+
// Add the IDs of extensions you want installed when the container is created.
20+
"extensions": [
21+
"puppet.puppet-vscode",
22+
"rebornix.Ruby"
23+
]
24+
25+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26+
"forwardPorts": [],
27+
28+
// Use 'postCreateCommand' to run commands after the container is created.
29+
"postCreateCommand": "pdk --version",
30+
}
31+
```
32+
33+
34+

.devcontainer/devcontainer.json

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
31
{
42
"name": "Puppet Development Kit (Community)",
53
"dockerFile": "Dockerfile",
64

7-
// Set *default* container specific settings.json values on container create.
85
"settings": {
9-
"terminal.integrated.shell.linux": "/bin/bash"
6+
"terminal.integrated.profiles.linux": {
7+
"bash": {
8+
"path": "bash",
9+
}
10+
}
1011
},
1112

12-
// Add the IDs of extensions you want installed when the container is created.
1313
"extensions": [
1414
"puppet.puppet-vscode",
1515
"rebornix.Ruby"
1616
]
17-
18-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19-
// "forwardPorts": [],
20-
21-
// Use 'postCreateCommand' to run commands after the container is created.
22-
// "postCreateCommand": "pdk --version",
2317
}

.github/workflows/auto_release.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
runs-on: ubuntu-20.04
1515

1616
steps:
17+
1718
- name: "Honeycomb: Start recording"
1819
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
1920
with:
@@ -25,7 +26,6 @@ jobs:
2526
run: |
2627
echo STEP_ID="auto-release" >> $GITHUB_ENV
2728
echo STEP_START=$(date +%s) >> $GITHUB_ENV
28-
2929
- name: "Checkout Source"
3030
if: ${{ github.repository_owner == 'puppetlabs' }}
3131
uses: actions/checkout@v2
@@ -46,8 +46,14 @@ jobs:
4646
run: |
4747
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
4848
49-
- name: "Commit changes"
49+
- name: "Check if a release is necessary"
5050
if: ${{ github.repository_owner == 'puppetlabs' }}
51+
id: check
52+
run: |
53+
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
54+
55+
- name: "Commit changes"
56+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
5157
run: |
5258
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
5359
git config --local user.name "GitHub Action"
@@ -57,7 +63,7 @@ jobs:
5763
- name: Create Pull Request
5864
id: cpr
5965
uses: puppetlabs/peter-evans-create-pull-request@v3
60-
if: ${{ github.repository_owner == 'puppetlabs' }}
66+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
6167
with:
6268
token: ${{ secrets.GITHUB_TOKEN }}
6369
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
@@ -73,11 +79,11 @@ jobs:
7379
labels: "maintenance"
7480

7581
- name: PR outputs
76-
if: ${{ github.repository_owner == 'puppetlabs' }}
82+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
7783
run: |
7884
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
7985
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
80-
86+
8187
- name: "Honeycomb: Record finish step"
8288
if: ${{ always() }}
8389
run: |

.github/workflows/spec.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
workflow_dispatch:
77
pull_request:
88

9+
910
env:
1011
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
1112
HONEYCOMB_DATASET: litmus tests
@@ -18,6 +19,7 @@ jobs:
1819
spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }}
1920

2021
steps:
22+
2123
- name: "Honeycomb: Start recording"
2224
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
2325
with:
@@ -29,7 +31,6 @@ jobs:
2931
run: |
3032
echo STEP_ID=setup-environment >> $GITHUB_ENV
3133
echo STEP_START=$(date +%s) >> $GITHUB_ENV
32-
3334
- name: Checkout Source
3435
uses: actions/checkout@v2
3536
if: ${{ github.repository_owner == 'puppetlabs' }}
@@ -47,13 +48,16 @@ jobs:
4748
echo ::group::bundler environment
4849
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
4950
echo ::endgroup::
50-
5151
- name: "Honeycomb: Record Setup Environment time"
5252
if: ${{ github.repository_owner == 'puppetlabs' }}
5353
run: |
5454
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
5555
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
5656
echo STEP_START=$(date +%s) >> $GITHUB_ENV
57+
- name: Run Static & Syntax Tests
58+
if: ${{ github.repository_owner == 'puppetlabs' }}
59+
run: |
60+
buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
5761
5862
- name: Setup Spec Test Matrix
5963
id: get-matrix
@@ -63,12 +67,10 @@ jobs:
6367
else
6468
echo "::set-output name=spec_matrix::{}"
6569
fi
66-
6770
- name: "Honeycomb: Record Setup Test Matrix time"
6871
if: ${{ always() }}
6972
run: |
7073
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
71-
7274
Spec:
7375
name: "Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})"
7476
needs:
@@ -91,7 +93,6 @@ jobs:
9193
9294
- run: |
9395
echo 'puppet_version=${{ env.SANITIZED_PUPPET_VERSION }}' >> $BUILDEVENT_FILE
94-
9596
- name: "Honeycomb: Start first step"
9697
run: |
9798
echo "STEP_ID=${{ env.SANITIZED_PUPPET_VERSION }}-spec" >> $GITHUB_ENV
@@ -104,7 +105,6 @@ jobs:
104105
dataset: ${{ env.HONEYCOMB_DATASET }}
105106
job-status: ${{ job.status }}
106107
matrix-key: ${{ env.SANITIZED_PUPPET_VERSION }}
107-
108108
- name: Checkout Source
109109
uses: actions/checkout@v2
110110

@@ -120,10 +120,7 @@ jobs:
120120
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
121121
echo ::endgroup::
122122
123-
- name: Run Static & Syntax Tests
124-
run: |
125-
buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
126-
123+
127124
- name: Run parallel_spec tests
128125
run: |
129126
buildevents cmd $TRACE_ID $STEP_ID 'rake parallel_spec Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake parallel_spec

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require:
44
- rubocop-rspec
55
AllCops:
66
DisplayCopNames: true
7-
TargetRubyVersion: '2.4'
7+
TargetRubyVersion: '2.5'
88
Include:
99
- "**/*.rb"
1010
Exclude:

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ group :development do
2424
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
2525
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
2626
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27+
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false, platforms: [:ruby]
2728
gem "ruby-pwsh", require: false
2829
gem "github_changelog_generator", require: false
2930
end

Rakefile

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ end
4343

4444
PuppetLint.configuration.send('disable_relative')
4545

46+
4647
if Bundler.rubygems.find_name('github_changelog_generator').any?
4748
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
4849
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?

metadata.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"version_requirement": ">= 6.0.0 < 8.0.0"
6363
}
6464
],
65-
"pdk-version": "2.1.0",
65+
"pdk-version": "2.3.0",
6666
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
67-
"template-ref": "heads/main-0-g03daa92"
67+
"template-ref": "heads/main-0-gf3911d3"
6868
}

0 commit comments

Comments
 (0)