mkevenaar / chocolatey-packages

My chocolatey packages
https://mkevenaar.github.io/chocolatey-packages/
Apache License 2.0
42 stars 66 forks source link

(mysql.workbench) Fix automatic MySQL Workbench update in `update.ps1` #215

Closed lauxjpn closed 7 months ago

lauxjpn commented 9 months ago

Description

Motivation and Context

It is currently not possible to get the latest version, because the MySQL website requires a JavaScript enabled browser.

Fixes #197

How Has this Been Tested?

I ran the update script locally:

PS C:\Repositories\chocolatey-packages\automatic\mysql.workbench> .\update.ps1
mysql.workbench - checking updates using au version 2022.10.24

URL check
  https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-8.0.34-winx64.msi
nuspec version: 8.0.31
remote version: 8.0.34
New version is available
Automatic checksum started
Using system proxy server ''.
Downloading chocolatey\mysql.workbench 32 bit
  from 'https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-8.0.34-winx64.msi'
Using system proxy server ''.

Download of mysql-workbench-community-8.0.34-winx64.msi (46,37 MB) completed.
Package downloaded and hash calculated for 32 bit version
Setting package description from README.md
Updating files
  $Latest data:
    Checksum32                (String)     231e6ad0d1e99707a90fc6e0f52a57242227dd28a8cb043a8ffbf0299fa1ef55
    ChecksumType32            (String)     sha256
    FileType                  (String)     msi
    NuspecVersion             (String)     8.0.31
    PackageName               (String)     mysql.workbench
    URL32                     (String)     https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-8.0.34-winx64.msi
    Version                   (String)     8.0.34
  mysql.workbench.nuspec
    setting id: mysql.workbench
    updating version: 8.0.31 -> 8.0.34
  tools\chocolateyInstall.ps1
    (^[$]checksumType\s*=\s*)('.*')     = $1'sha256'
    (^[$]url\s*=\s*)('.*')              = $1'https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-8.0.34-winx64.msi'
    (^[$]checksum\s*=\s*)('.*')         = $1'231e6ad0d1e99707a90fc6e0f52a57242227dd28a8cb043a8ffbf0299fa1ef55'
Running au_AfterUpdate
Downloading to mysql-workbench-community-8.0.34-winx64.msi - https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-8.0.34-winx64.msi
vt.exe: C:\Repositories\chocolatey-packages\automatic\mysql\update.ps1:42:9
Line |
  42 |          vt.exe scan file $file --apikey $env:VT_APIKEY
     |          ~~~~~~
     | The term 'vt.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
     | again.

Package updated

Path          : C:\Repositories\chocolatey-packages\automatic\mysql.workbench
Name          : mysql.workbench
Updated       : True
Pushed        : False
RemoteVersion : 8.0.34
NuspecVersion : 8.0.31
Result        : {mysql.workbench - checking updates using au version 2022.10.24, , URL check,   https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-8.0.34-winx64.msi…}
Error         :
NuspecPath    : C:\Repositories\chocolatey-packages\automatic\mysql.workbench\mysql.workbench.nuspec
NuspecXml     : #document
Ignored       : False
IgnoreMessage :
StreamsPath   : C:\Repositories\chocolatey-packages\automatic\mysql.workbench\mysql.workbench.json
Streams       :

Screenshot (if appropriate, usually isn't needed):

Types of changes

Checklist:

AppVeyorBot commented 9 months ago

:white_check_mark: Package verification completed without issues. PR is now pending human review

Zoullx commented 8 months ago

Can I ask why you're limiting this script by adding the check of the mainline version prefix when you're already sorting the versions to grab the latest one? It makes it to where the script would require manual update when they go to release a new minor version like 8.1.X let alone if there's a major update released.

lauxjpn commented 8 months ago

@Zoullx A new mainline version is usually not yet stable. For example, version 8.0.11 was still an (potentially unstable) prerelease. So making it necessary to manually update the mainline version was a deliberate choice a made.

If we want to get rid of it, it should be possible to detect prereleases other ways.

Zoullx commented 8 months ago

Gotcha. There's probably no way to get a list of just the stable releases so that we don't even have to worry about prereleases without introducing a limitation like that, huh?

mkevenaar commented 7 months ago

No response, I have changed the changes myself where needed.