How to handle Beta version with HPM?

Thank you @mavrrick58 and @csteele for the great work — I’ll start using the new HPM Beta options as soon as possible and will share feedback after some testing.
:+1:

3 Likes

I think I would modify that a bit. I like were it is going, but it could still be made clearer. I am not sure i could follow that page and easily implement a beta package easily. Lets see if we make it clearer.


Introduction to HPM Beta/Early Release Channel
HPM supports the ability for you to provide a Stable install channel as well as a Beta/Early Release channel. It uses some optional tags in your maifest that will help HPM know when to load the Beta/Early Release code, and provide information to users about what the beta channel does.

How to use Beta/Early Release Channel
The optional tags used by the HPM Beta functionality are betaReleaseNotes, betaVersion, and betaLocation. Each tag serves a specific purpose. If you decide to use the Beta/Early Release channel you are required to include betaVersion, and betaLocation for the Beta/Early Release channel to work properly.

To provide release notes about your Beta package you can do one of two things. The first option which is less then ideal is you can include beta information as part of your standard release notes. The other option is you can add the "betaReleaseNotes" value to the main section of your package manifest and provide a dedicated release notes for your Beta/Early release channel. A example of is shown below

{
      "packageName": "My Package",
      "minimumHEVersion": "2.1.9",
      "author": "Dominick Meglio",
      "version": "1.0.1",
      "betaVersion": "1.0.2",
      "dateReleased": "2020-04-07",
      "licenseFile": "",
	"documentationLink": "",
	"communityLink": "",
	"gitHubUrl": "https://github.com/dcmeglio",
	"payPalUrl": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7LBRPJRLJSDDN&source=url",
      "releaseNotes": "A standard Release Note",
      "betaReleaseNotes": "A Beta Release Note",
      "apps" : [
                {

This this example a user would see the text "A Beta Release Note" when then perform the install or upgrade.

The "betaVersion" tag is used heavily by HPM to know when a package is part Beta/Early release channel and if it is new. One unique aspect of the "betaVersion" is that it can be used in one of two ways.

If your application is managed by a single version value used in the main part of the manifest. You can simply add betaVersion as shown in the example below with a version number that is either the same or higher then then stable channel's verion number.

{
      "packageName": "My Package",
      "minimumHEVersion": "2.1.9",
      "author": "Dominick Meglio",
      "version": "1.0.1",
      "betaVersion": "1.0.2",
      "dateReleased": "2020-04-07",
      "licenseFile": "",
	"documentationLink": "",
	"communityLink": "",
	"gitHubUrl": "https://github.com/dcmeglio",
	"payPalUrl": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7LBRPJRLJSDDN&source=url",

If your package has several parts like drivers that may be managed independently you can use the version and betaVersion values as part of app/driver/bundle that is being managed instead. This allows you to manage versioning on a piece by piece basis. You can see this in the example below

      "apps" : [
                {
                        "id" : "67d9cc01-a5cb-453c-832a-e78c5a6b978b",
                        "name": "The App",
                        "namespace": "abc.theapp",
                        "location": "https://raw.githubusercontent.com/app.groovy",
                        "betaLocation": "https://raw.githubusercontent.com/betaApp.groovy",        
                        "required": true,
                        "oauth": false,
                        "version": "1.0.1",
                        "betaVersion": "1.0.2",
                }
        ]

You do not want to have the betaVersion or version tags in both the main section or the app/drivers/bundles. That can confuse HPM for upgrades when it does upgrade checks

The "betaLocation" tag is used to tell HPM where your beta/Early Release channel is located. It is associated with each app/driver/bundle and should point to a alternate location you have setup as a repo for your package. This can be anything from a beta repo on github to a whole alternate website you host your code on. The only requirement is that it is accessable via HTTP so HPM can retrieve the code. In this example below i am using a secondary beta repo for my beta location

      "apps" : [
                {
                        "id" : "67d9cc01-a5cb-453c-832a-e78c5a6b978b",
                        "name": "The App",
                        "namespace": "abc.theapp",
                        "location": "https://raw.githubusercontent.com/app.groovy",
                        "betaLocation": "https://raw.githubusercontent.com/betaApp.groovy",        
                        "required": true,
                        "oauth": false
                }
        ]

Example of a full package manifest with Beta/Early Release

{
      "packageName": "My Package",
      "minimumHEVersion": "2.1.9",
      "author": "Dominick Meglio",
      "version": "1.0.1",
      "betaVersion": "1.0.2",
      "dateReleased": "2020-04-07",
      "licenseFile": "",
	"documentationLink": "",
	"communityLink": "",
	"gitHubUrl": "https://github.com/dcmeglio",
	"payPalUrl": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7LBRPJRLJSDDN&source=url",
      "releaseNotes": "A standard Release Note",
      "betaReleaseNotes": "A Beta Release Note",
      "apps" : [
                {
                        "id" : "67d9cc01-a5cb-453c-832a-e78c5a6b978b",
                        "name": "The App",
                        "namespace": "abc.theapp",
                        "location": "https://raw.githubusercontent.com/app.groovy",
                        "betaLocation": "https://raw.githubusercontent.com/betaApp.groovy",        
                        "required": true,
                        "oauth": false
                }
        ]
}

What do you think of that info?

I've replaced the Beta Options page to the HPM Documentation per the above suggestion(s).

https://hubitatpackagemanager.hubitatcommunity.com/betaOpts.html

2 Likes

Suggested updates. Bold are some corrections. Also made the URL example more realistic if you were to use a branch in GitHub. (The final example could also be updated with this chunk)


You do not want to have the betaVersion or version tags in both the main section and the app/drivers/bundles. That can confuse HPM for upgrades when it does upgrade checks. The "betaLocation" tag is used to tell HPM where your beta/Early Release channel is located. It is associated with each app/driver/bundle and should point to a alternate location you have setup as a repo for your package. This can be anything from a beta branch on GitHub to a whole alternate website you host your code on. The only requirement is that it is accessible via HTTP so HPM can retrieve the code. In this example below, after creating a secondary beta branch, the betaLocation points to the code.

  "apps" : [
            {
                    "id" : "67d9cc01-a5cb-453c-832a-e78c5a6b978b",
                    "name": "The App",
                    "namespace": "abc.theapp",
                    "location": "https://raw.githubusercontent.com/user/repo/main/app.groovy",
                    "betaLocation": "https://raw.githubusercontent.com/user/repo/beta/app.groovy",        
                    "required": true,
                    "oauth": false
            }
    ]
1 Like

I've updated the Beta Options page in the HPM Documentation per the above suggestion(s).

I hope...
maybe...

:slight_smile:

4 Likes