Deprecate and neuter MunkiCatalogBuilder processor; update MunkiImporter processor #913
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements some changes discussed today in the #autopkg channel in MacAdmins Slack today. Namely, it deprecates and neuters the old, mostly abandoned MunkiCatalogBuilder processor. This processor was used in only two publicly shared recipes, and repo containing those recipes is being archived.
With this change, running a recipe containing a MunkiCatalogBuilder step results in a deprecation warning and no action is performed for that step:
The second change is to the MunkiImporter processor. Previously, it did not reset the value of the
munki_repo_changed
variable between recipe runs, so if you were running multiple recipes, and one changed the repo,munki_repo_changed
was reported as True for all remaining recipes. This behavior was intended to tell a processor to runmakecatalogs
after running a list of recipes if any of them changed the repo. But this ended up being implemented a different way that did not rely on themunki_repo_changed
variable. Therefore, the behavior of this has been changed to reflect the documentation, that is, it reports if the current recipe caused a change to the repo.Consider a run that runs a Firefox and a Chrome recipe. A new Firefox version is imported, but the Chrome version is already current in the repo. The prior behavior reported
munki_repo_changed
after running the Firefox recipe, and also after running the Chrome recipe.In the new behavior,
munki_repo_changed
is reported as True only after the Firefox recipe:followed by
Note that in the results for the Chrome recipe,
munki_repo_changed
is not reported as False; instead it is not reported at all. This is because of this existing code:https://github.com/autopkg/autopkg/blob/dev/Code/autopkglib/__init__.py#L894-L905
Which causes an output variable to be printed only if it's Python "truthy" -- that is, empty dicts, arrays, and strings will not be printed, booleans with a value of False will not be printed, and numbers with a value of 0 will not be printed. Whether or not that is behavior to address is outside the scope of this PR.