Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple possible Cask versions (e.g. per-OS) are not shown on formulae.brew.sh #965

Closed
jonathandhn opened this issue Sep 20, 2023 · 14 comments
Labels
help wanted Extra attention is needed

Comments

@jonathandhn
Copy link

There is a cask version mismatch between cask formula and formulae.brew.sh on the MySQL Workbench cask

formulae.brew.sh show as of UTC 9:40 pm 20th of september 2023 :

When copied and pasted
Current version: [8.0.32](https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-8.0.32-macos-x86_64.dmg)

While cask code on the same time shows :

  on_ventura :or_newer do
    version "8.0.34"
    sha256 arm:   "aea67c39354d76c38f2e9aca4390dbe4f75ecc3f12110ff598bf2fc46f48bf8c",
           intel: "9fba65a06db4c67e353014b49c41d7cd0e915dd6584df43d6cb099f38cf841e2"

    url "https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-#{version}-macos-#{arch}.dmg"

    livecheck do
      url "https://dev.mysql.com/downloads/workbench/"
      regex(/MySQL\s*Workbench\s*(\d+(?:\.\d+)+)/i)
    end

and

brew info --cask mysqlworkbench
==> mysqlworkbench: 8.0.34
https://www.mysql.com/products/workbench/
Not installed
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/m/mysqlworkbench.rb
==> Name
MySQL Workbench
==> Description
Visual tool to design, develop and administer MySQL servers
==> Artifacts
MySQLWorkbench.app (App)
==> Analytics
install: 2,212 (30 days), 5,711 (90 days), 12,706 (365 days)
@Bo98
Copy link
Member

Bo98 commented Sep 20, 2023

Probably because site generation runs on macOS 12 still (macos-latest still points to macos-12, but we could manually point to macos-13).

@MikeMcQuaid MikeMcQuaid changed the title MySQL Workbench cask shows a wrong version numbers on formulae.brew.sh Multiple possible Cask versions (e.g. per-OS) are not shown on formulae.brew.sh Sep 21, 2023
@MikeMcQuaid MikeMcQuaid added the help wanted Extra attention is needed label Sep 21, 2023
@MikeMcQuaid
Copy link
Member

robably because site generation runs on macOS 12 still (macos-latest still points to macos-12, but we could manually point to macos-13).

Yup. Addressed the title because I think the actual good fix for this is to use the brew info --json --cask output (adding the new data if needed) to display a table of possible versions in cases like this because this pattern is so commonplace.

@SMillerDev
Copy link
Member

So do we want to show the latest macOS version? Or all of the supported ones?

@MikeMcQuaid
Copy link
Member

@SMillerDev All supported.

@Rylan12
Copy link
Member

Rylan12 commented Dec 21, 2023

For anyone interested in tackling this: right now all of this info exists in the variations part of the JSON. We used to have a versions item in the JSON that contained exactly this info (added in #539 and Homebrew/brew#11915, and removed in b5704d4 and Homebrew/brew#15240).

It might be worth looking into re-adding versions to the APIs, only to be added when running --variations to not slow down generation too much except for when we're generating for the website

Edit: oops, now I see there's already a PR open for this

@MikeMcQuaid
Copy link
Member

It might be worth looking into re-adding versions to the APIs, only to be added when running --variations to not slow down generation too much except for when we're generating for the website

@Rylan12 I think we need to have Homebrew/brew do the same as what we're doing for the website. I'm open to @Bo98 and @apainintheneck thoughts on how best to balance this as I agree including this information would be nice.

@apainintheneck
Copy link
Contributor

Which APIs are we planning on adding cask variations to? I checked brew info --json=v2 --variations and the JSON representation of casks on formulae.brew.sh and both already included variations.

@Bo98
Copy link
Member

Bo98 commented Dec 22, 2023

I'm not convinced anything more needs done here?

Only remaining improvement to the webpages is I'd make is to fold "Current version" into the variations table as that version actually means "Version of the machine that generated this page (Monterey)". Example (note how Monterey is missing): https://formulae.brew.sh/cask/mysqlworkbench

@SMillerDev
Copy link
Member

Could we get that info though?

@Bo98
Copy link
Member

Bo98 commented Dec 22, 2023

"Current version" applies to all missing variations, so the extra information we would need is the set of possible macOS versions. We could extract that from brew at build time perhaps - we have full control of the build now and can execute arbitrary Ruby code during the Jekyll build unlike the other brew.sh repos.

It would fill up the table on e.g. https://formulae.brew.sh/cask/amethyst a bit but it would behave consistently so would probably look ok (though that cask doesn't make sense anyway because of the >= 10.15, but that's an issue for homebrew-cask).

@Bo98
Copy link
Member

Bo98 commented Dec 22, 2023

In addition, we probably should also make it so API generation more system-agnostic. i.e. it simulates the latest x86_64 macOS so "current version" refers to macOS 14 even if generated on macOS 12. GitHub-hosted runners lagging over a year behind is probably not going to change anytime soon.

@MikeMcQuaid
Copy link
Member

In addition, we probably should also make it so API generation more system-agnostic. i.e. it simulates the latest x86_64 macOS so "current version" refers to macOS 14 even if generated on macOS 12.

Agreed 👍🏻


I think a happy middle ground could be a new field added to the API clarifying what the machine it was generated on is.

@SMillerDev
Copy link
Member

Looking at https://formulae.brew.sh/cask/mysqlworkbench#default, this can be closed right?

@MikeMcQuaid
Copy link
Member

Yes, thanks @SMillerDev!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants