Skip to content

Commit 174898c

Browse files
authored
Merge pull request #49 from homebysix/dev
1.11.0 merge to main
2 parents 0db1d73 + 696474d commit 174898c

5 files changed

Lines changed: 96 additions & 32 deletions

File tree

CHANGELOG.md

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,232 +2,270 @@
22

33
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
<!-- markdownlint-configure-file
6+
{
7+
"no-duplicate-heading": {
8+
"siblings_only": true
9+
}
10+
}
11+
-->
12+
13+
## [Unreleased]
14+
15+
Nothing yet.
16+
17+
## [1.11.0] - 2021-11-20
18+
19+
### Added
20+
21+
- Added processor type conventions for [JamfUploader](https://grahamrpugh.com/2020/12/14/introducing-jamf-upload.html) (`.jamf`), [PkgSigner](https://derflounder.wordpress.com/2021/07/30/signing-autopkg-built-packages-using-a-sign-recipe/) (`.sign`), and [GPGSignatureVerifier](https://github.com/autopkg/gerardkok-recipes/blob/master/SharedProcessors/GPGSignatureVerifier.py) (`.verify`) families of recipes.
22+
- `BrewCaskInfoProvider` has been added to the list of deprecated AutoPkg processors.
23+
- More output when `check-git-config-email` fails.
24+
525
## [1.10.1] - 2021-02-21
626

727
### Added
28+
829
- In anticipation of AutoPkg 2.3, now supports checking YAML recipes (must have extension `.recipe.yaml`).
930
- In anticipation of AutoPkg 2.3, supports additional AutoPkg plist extension `.recipe.plist`.
1031
- Supports JSON AutoPkg recipes (must have extension `.recipe.json`). NOTE: AutoPkg itself does not yet support JSON recipes.
1132
- Built placeholder for checking for unused AutoPkg recipe input variables in the future. Check is disabled for now.
1233

1334
### Fixed
35+
1436
- Fixed a bug preventing display of AutoPkg recipe path and identifier if duplicate identifier is found in the repo.
1537

1638
## [1.9.0] - 2021-01-18
1739

1840
### Added
41+
1942
- Added check for any unexpected processor arguments in any AutoPkg processor.
2043

2144
### Removed
45+
2246
- CodeSignatureVerifier processor argument verification (added in v1.8.2) has been replaced by the above.
2347

2448
## [1.8.2] - 2021-01-18
2549

2650
### Added
51+
2752
- Added check for unexpected processor arguments in CodeSignatureVerifier.
2853

2954
### Changed
55+
3056
- Renamed default branch to `main`.
3157

3258
## [1.8.1] - 2020-12-08
3359

3460
### Removed
61+
3562
- Removed warning about setting MinimumVersion of AutoPkg recipes to 2.0+.
3663
- Reverted 1.4 minimum version requirement for processors that use URLGetter (introduced in 1.7.0).
3764

38-
3965
## [1.8.0] - 2020-10-08
4066

4167
### Changed
42-
- Replaced `plistlib.readPlist()` with `plistlib.load()`
4368

69+
- Replaced `plistlib.readPlist()` with `plistlib.load()`
4470

4571
## [1.7.0] - 2020-10-06
4672

4773
### Added
74+
4875
- Added pre-commit-macadmin change log (this file)
4976
- Ensure no superclass processors (e.g. URLGetter) are used, as these are intended to be referred to by other processors rather than directly used in recipes
5077
- Warn if setting a MinimumVersion greater than or equal to 2 in AutoPkg recipes, because some administrators may be running 1.4.1 and waiting for processor authors to add Python 3 compatibility
5178
- Validate `minimum_os_version` and `maximum_os_version` keys in Munki pkginfo files
5279

5380
### Changed
81+
5482
- Set MinimumVersion needed for [C]URL* processors to 1.4, to ensure utilization of URLGetter
5583
- Updated valid Munki script shebangs to include Munki embedded Python symlink and path
5684

57-
5885
## [1.6.2] - 2020-01-20
5986

6087
### Fixed
61-
- Added missing sys module for Python version determination
6288

89+
- Added missing sys module for Python version determination
6390

6491
## [1.6.1] - 2019-12-26
6592

6693
### Fixed
67-
- Convert subprocess output to string
6894

95+
- Convert subprocess output to string
6996

7097
## [1.6.0] - 2019-12-26
7198

7299
### Added
100+
73101
- Validate possible values of RestartAction key in Munki pkginfo
74102
- New hook to check Git user email configuration (`git config user.email`)
75103

76-
77104
## [1.5.2] - 2019-11-26
78105

79106
### Fixed
107+
80108
- Removed redundant EndOfCheckPhase check
81109
- Added URLGetter minimum version (although we should never need this since URLGetter is not meant to be called directly)
82110

83-
84111
## [1.5.1] - 2019-09-21
85112

86113
### Added
87-
- Checking for downloader processors without EndOfCheckPhase
88114

115+
- Checking for downloader processors without EndOfCheckPhase
89116

90117
## [1.5.0] - 2019-09-17
91118

92119
### Added
120+
93121
- Warn if using deprecated AutoPkg processors (only one exists now: CURLDownloader)
94122
- Allow specifying multiple acceptable recipe prefixes
95123

96124
### Fixed
97-
- Updated minimum AutoPkg versions required for processors to only include significant digits for LooseVersion comparison
98125

126+
- Updated minimum AutoPkg versions required for processors to only include significant digits for LooseVersion comparison
99127

100128
## [1.4.0] - 2019-08-22
101129

102130
### Added
131+
103132
- Detect and warn on AutoPkg recipe identifier duplication
104133
- Warn if any Munki pkginfo script is missing a shebang
105134

106-
107135
## [1.3.0] - 2019-07-03
108136

109137
### Added
138+
110139
- `--strict` mode for check-autopkg-recipes hook, along with numerous conventions that it can validate
111140
- Catch identifier loops, where recipe and its parent have the same identifier
112141

113142
### Fixed
143+
114144
- Better handling of unicode
115145
- Fixed warning output when recipe list is invalid
116146
- Fixed shared FileWaveImporter processor identifier
117147

118148
### Changed
149+
119150
- Handle recipe lists that have prefixes
120151
- Allow pkg recipes with no process (stubs for software already in pkg format at time of download)
121152

122-
123153
## [1.2.1] - 2019-06-28
124154

125155
### Added
156+
126157
- Better parsing of MunkiPkg build-info files, and validation of keys
127158
- Better handle processors with missing Processor keys
128159
- Warn if MunkiPkg project target disk is not the startup disk
129160
- Validate required keys in MunkiPkg build-info files
130161
- Validate bundle identifier in MunkiPkg build-info files
131162

132-
133163
## [1.2.0] - 2019-06-27
134164

135165
### Added
166+
136167
- Checking AutoPkg recipe processors for missing Processor key
137168
- Validation of EndOfCheckPhase placement within download recipes
138169

139170
### Changed
171+
140172
- Created shared function for checking required keys for pkginfo files and AutoPkg recipes
141173
- No longer requiring an Input key for AutoPkg recipes
142174

143-
144175
## [1.1.4] - 2019-06-24
145176

146177
### Changed
147-
- Skip processor checks for AutoPkg recipes without a Process
148178

179+
- Skip processor checks for AutoPkg recipes without a Process
149180

150181
## [1.1.3] - 2019-06-24
151182

152183
### Added
184+
153185
- Added `--ignore-min-vers-before` argument to check-autopkg-recipes hook
154186
- Added checking for `%NAME%.app` in check-autopkg-recipes hook
155187

156-
157188
## [1.1.2] - 2019-06-22
158189

159190
### Added
191+
160192
- Added validation of AutoPkg recipe MinimumVersion in check-autopkg-recipes hook
161193

162194
### Changed
163-
- Fail early and stop processing files that don't parse
164195

196+
- Fail early and stop processing files that don't parse
165197

166198
## [1.1.1] - 2019-06-13
167199

168200
### Fixed
169-
- Fixed issue that returned wrong pass/fail result for check-munki-pkgsinfo and check-autopkg-recipes hooks
170201

202+
- Fixed issue that returned wrong pass/fail result for check-munki-pkgsinfo and check-autopkg-recipes hooks
171203

172204
## [1.1.0] - 2019-06-13
173205

174206
### Added
207+
175208
- Added a note about combining list arguments in yaml config
176209
- Added note about multi-line list args
177210
- Ensure no trailing slashes on items_to_copy in check-munki-pkgsinfo
178211

179212
### Changed
213+
180214
- Specified which yaml loader to use
181215
- Removed zip as an package extension
182216

183217
### Fixed
184-
- Fixed issue that caused incorrect pass/fail for check-munki-pkgsinfo and check-autopkg-recipes hooks
185218

219+
- Fixed issue that caused incorrect pass/fail for check-munki-pkgsinfo and check-autopkg-recipes hooks
186220

187221
## [1.0.5] - 2019-03-15
188222

189223
### Added
190-
- Added args documentation to read me
191224

225+
- Added args documentation to read me
192226

193227
## [1.0.4] - 2019-03-14
194228

195229
### Added
196-
- Added check for approved catalogs
197230

231+
- Added check for approved catalogs
198232

199233
## [1.0.3] - 2019-03-13
200234

201235
### Fixed
202-
- Fixed variable capitalization
203236

237+
- Fixed variable capitalization
204238

205239
## [1.0.2] - 2019-03-13
206240

207241
### Added
242+
208243
- Enabled basic type checking for pkginfo dicts
209244

210245
### Changed
246+
211247
- Adjusted required keys in check-munki-pkgsinfo to include name and description by default
212248
- Temporarily skipping top level plist type (dict) checking
213249

214-
215250
## [1.0.1] - 2019-03-03
216251

217252
### Added
253+
218254
- Added forbid-autopkg-trust-info hook
219255
- Added check for recipe prefix enforcement
220256

221257
### Fixed
222-
- Fixed bug in check-autopkg-recipes hook
223258

259+
- Fixed bug in check-autopkg-recipes hook
224260

225261
## 1.0.0 - 2019-03-01
226262

227263
- Initial release
228264

229-
230-
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.8.2...HEAD
265+
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.11.0...HEAD
266+
[1.11.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.10.1...v1.11.0
267+
[1.10.1]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.9.0...v1.10.1
268+
[1.9.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.8.2...v1.9.0
231269
[1.8.2]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.8.1...v1.8.2
232270
[1.8.1]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.8.0...v1.8.1
233271
[1.8.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.7.0...v1.8.0

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For any hook in this repo you wish to use, add the following to your pre-commit
1515

1616
```yaml
1717
- repo: https://github.com/homebysix/pre-commit-macadmin
18-
rev: v1.10.1
18+
rev: v1.11.0
1919
hooks:
2020
- id: check-plists
2121
# - id: ...
@@ -121,7 +121,7 @@ When combining arguments that take lists (for example: `--required-keys`, `--cat
121121

122122
```yaml
123123
- repo: https://github.com/homebysix/pre-commit-macadmin
124-
rev: v1.10.1
124+
rev: v1.11.0
125125
hooks:
126126
- id: check-munki-pkgsinfo
127127
args: ['--catalogs', 'testing', 'stable', '--']
@@ -131,7 +131,7 @@ But if you also use the `--categories` argument, you would move the trailing `--
131131

132132
```yaml
133133
- repo: https://github.com/homebysix/pre-commit-macadmin
134-
rev: v1.10.1
134+
rev: v1.11.0
135135
hooks:
136136
- id: check-munki-pkgsinfo
137137
args: ['--catalogs', 'testing', 'stable', '--categories', 'Design', 'Engineering', 'Web Browsers', '--']
@@ -143,7 +143,7 @@ If it looks better to your eye, feel free to use a multi-line list for long argu
143143

144144
```yaml
145145
- repo: https://github.com/homebysix/pre-commit-macadmin
146-
rev: v1.10.1
146+
rev: v1.11.0
147147
hooks:
148148
- id: check-munki-pkgsinfo
149149
args: [

pre_commit_hooks/check_autopkg_recipe_list.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,22 @@ def main(argv=None):
4646
elif filename.endswith(".plist"):
4747
try:
4848
with open(filename, "rb") as openfile:
49-
recipe_list = plistlib.load(openfile)
49+
recipe_list = plistlib.load(openfile).get("recipes")
5050
except (ExpatError, ValueError) as err:
5151
print("{}: plist parsing error: {}".format(filename, err))
5252
retval = 1
5353
elif filename.endswith((".yaml", ".yml")):
54+
# AutoPkg does not support YAML recipe lists, but AutoPkg users
55+
# may have developed custom tooling for this.
5456
try:
5557
with open(filename, "r") as openfile:
5658
recipe_list = yaml.load(openfile)
5759
except Exception as err:
5860
print("{}: yaml parsing error: {}".format(filename, err))
5961
retval = 1
6062
elif filename.endswith(".json"):
63+
# AutoPkg does not support JSON recipe lists, but AutoPkg users
64+
# may have developed custom tooling for this.
6165
try:
6266
with open(filename, "r") as openfile:
6367
recipe_list = json.load(openfile)

0 commit comments

Comments
 (0)