lindegroup / autopkgr

AutoPkgr is a free Mac app that makes it easy to install and configure AutoPkg.
http://www.lindegroup.com/autopkgr
Apache License 2.0
532 stars 51 forks source link

How does AutoPkgR build its notification information? #685

Open Daz-wallace opened 2 years ago

Daz-wallace commented 2 years ago

Hi folks,

I was wondering if anyone knows how AutoPkgR builds its notification information?

We have it AutoPkgR setup to send recipe run notifications to Slack and some of our titles will show with incorrect names and / or "Unknown version" for the version information under the "New software available for testing" heading. These recipes all run without error otherwise and all extract the name and version number correctly otherwise (as we name every package as %NAME%-%version%).

Any advice would be great :) Thanks!

homebysix commented 2 years ago

Hi @Daz-wallace - There were a few changes made to the notification templates in the latest version. Does the same behavior occur using both versions 1.5.7 and 1.6?

shawnhonsberger commented 2 years ago

Hi @Daz-wallace. Can you please send me an example of a recipe, which processors you are using in it, the portion of the report that is missing the version, as well as its full notification? Please note that depending on the processor, the Slack template can only pass on what that particular processor passes to it, e.g. if the recipe uses PkgCopier: https://github.com/autopkg/autopkg/blob/master/Code/autopkglib/PkgCopier.py#L93-L96.

Also, here is the Slack notification template for additional context, depending on what you are integrated with: https://github.com/lindegroup/autopkgr/blob/master/AutoPkgr/Supporting%20Files/slack_report.md.

Here is the relevant portion:

{{# updated_applications.count }} New software available for testing: {{# updated_applications }}

{{ name }}: {{ version }} {{/ updated_applications }}
Daz-wallace commented 2 years ago

Heya both, So I can recreate this with our internal ack recipe (attached recipe chain). Notification into Slack:


- ack-v3.5: Unknown version
The following new items were downloaded:
/Users/[USERNAME]/Library/AutoPkg/Cache/local.jamf-ack-pkg-upload/downloads/ack-v3.5.0```z
shawnhonsberger commented 2 years ago

Thanks @Daz-wallace! As you may know, there is a limitation in the Slack notification bot. The bot should pick up the version in the packages that are built. Have you tried adding another processor such as Versioner? If you can confirm that you are in fact passing the version out of that .pkg recipe, you may also want to consider customizing your Slack template on the device running AutoPkgr.

Using mostly public .pkg recipes, I'm not able to replicate this.

Daz-wallace commented 2 years ago

So for this specific recipe we're using @homebysix's Version splitter processor to determine the version as the downloaded software is a binary rather than an App. I'm not sure Versioner would be usable in this scenario?

However the version variable is outputted fine and actually used within PkgCreator to version and name the outputted package.

We're also seeing this with Rich Trouton's OneDrive recipe too. Not sure if that's easier for you to test with too?

shawnhonsberger commented 2 years ago

Hi @Daz-wallace. Does this Unknown version only display in the "The following new items were downloaded:" heading? Or also in other headings?

Daz-wallace commented 2 years ago

Hi @shawnhonsberger It shows under the "New software available for testing:" section

shawnhonsberger commented 2 years ago

Thanks @Daz-wallace!

Daz-wallace commented 1 year ago

Hi folks, Is there any other information I can pass on here that could be helpful? Thanks