Skip to content

Conversation

@DocEmmetBrown
Copy link
Contributor

@DocEmmetBrown DocEmmetBrown commented Dec 31, 2024

Implementation of option 5.1 from blueprint #8476

It adds a new auto_updates column, that will be 0 or 1 for casks, and empty for formulas.

It also adds an app_name column that will provide the name of the installed app (usually linked in the Application folder)

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 31, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@DocEmmetBrown DocEmmetBrown force-pushed the guillaume/add-auto-update-field-for-casks branch from c0bd4cb to a1a1610 Compare December 31, 2024 16:41
@DocEmmetBrown DocEmmetBrown changed the title Guillaume/add auto update field for casks add auto update field for casks Jan 4, 2025
@michael-myers michael-myers changed the title add auto update field for casks Add auto_update column to homebrew_packages table Jan 10, 2025
@michael-myers michael-myers added the needs CLA Waiting for contributor to sign the CLA label Jan 10, 2025
Copy link
Member

@directionless directionless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I'd generally prefer to see the two tables updated in different PRs

@DocEmmetBrown DocEmmetBrown force-pushed the guillaume/add-auto-update-field-for-casks branch from a1a1610 to bb12da7 Compare January 12, 2025 09:34
@DocEmmetBrown
Copy link
Contributor Author

FWIW I'd generally prefer to see the two tables updated in different PRs

I removed the commits regarding #8502 as they were not adding anything useful to this PR.

@DocEmmetBrown DocEmmetBrown changed the title Add auto_update column to homebrew_packages table Add auto_update and app_name column to homebrew_packages table Jan 13, 2025
@DocEmmetBrown
Copy link
Contributor Author

@directionless : I refactored a bit, in order to be able to add the app_name column .
An output would look something like:

+---------------------------+--------------------------------------------------+----------------------------------------+------+--------------+----------------------------------+
| name                      | path                                             | version                                | type | auto_updates | app_name                         |
+---------------------------+--------------------------------------------------+----------------------------------------+------+--------------+----------------------------------+
| nextcloud                 | /opt/homebrew/Caskroom/nextcloud                 | 3.8.2                                  | cask | 1            |                                  |
| sweet-home3d              | /opt/homebrew/Caskroom/sweet-home3d              | 7.5                                    | cask | 0            | Sweet Home 3D.app                |
| visual-studio-code        | /opt/homebrew/Caskroom/visual-studio-code        | 1.78.2                                 | cask | 1            | Visual Studio Code.app           |
| macwhisper                | /opt/homebrew/Caskroom/macwhisper                | 9.7,865                                | cask | 1            | MacWhisper.app                   |
| google-chrome             | /opt/homebrew/Caskroom/google-chrome             | 131.0.6778.205                         | cask | 1            | Google Chrome.app                |
| steam                     | /opt/homebrew/Caskroom/steam                     | 4.0                                    | cask | 1            | Steam.app                        |
| opencore-patcher          | /opt/homebrew/Caskroom/opencore-patcher          | 2.0.1                                  | cask | 1            |                                  |
| podman-desktop            | /opt/homebrew/Caskroom/podman-desktop            | 1.8.0                                  | cask | 0            | Podman Desktop.app               |
| multipass                 | /opt/homebrew/Caskroom/multipass                 | 1.15.0                                 | cask | 0            |                                  |
| postman                   | /opt/homebrew/Caskroom/postman                   | 10.14.2                                | cask | 1            | Postman.app                      |
+---------------------------+--------------------------------------------------+----------------------------------------+------+--------------+----------------------------------+

Copy link
Member

@directionless directionless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is adding a lot of complexity, but maybe that's okay

@DocEmmetBrown
Copy link
Contributor Author

This is adding a lot of complexity, but maybe that's okay

@directionless: I can go back to the drawing board if y'all think it's too complex. Happy to chat about it

@DocEmmetBrown DocEmmetBrown marked this pull request as ready for review February 10, 2025 17:18
@DocEmmetBrown DocEmmetBrown requested review from a team as code owners February 10, 2025 17:18
@Smjert
Copy link
Member

Smjert commented Feb 10, 2025

/easycla

@DocEmmetBrown
Copy link
Contributor Author

Regarding this PR, I'm honestly wondering if this would be worth creating a brand new table specifically for homebrew casks, and slowly add as much details as we could, given that the homebrew "formulas" are much more static, if that makes sense.
But that would be a major breaking change, so...
Happy to discuss it in the associated blueprint, or in another more appropriate forum :)

@michael-myers michael-myers added ready for review Pull requests that are ready to be reviewed by a maintainer and removed needs CLA Waiting for contributor to sign the CLA labels Feb 11, 2025
@zwass
Copy link
Member

zwass commented Mar 11, 2025

Apologies for the delay here. We discussed this in the last office hours and think the approach of updating the existing table makes sense. I can give this a review to help move it forward.

Copy link
Member

@zwass zwass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's ready to merge after updating the foreach. Thanks!

@DocEmmetBrown DocEmmetBrown force-pushed the guillaume/add-auto-update-field-for-casks branch from 2ba840d to a020dc9 Compare March 12, 2025 08:27
@DocEmmetBrown
Copy link
Contributor Author

IMO it's ready to merge after updating the foreach. Thanks!

It should be good now @zwass, thanks for taking the time to review my code.

Copy link
Member

@zwass zwass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@zwass zwass merged commit 7e4c11a into osquery:master Mar 25, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macOS ready for review Pull requests that are ready to be reviewed by a maintainer virtual tables

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants