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

cask/artifact/abstract_uninstall: allow wildcard entries for launchctl #14123

Merged
merged 10 commits into from
Dec 29, 2022

Conversation

bevanjkay
Copy link
Member

@bevanjkay bevanjkay commented Nov 9, 2022

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This is an initial attempt to allow wildcard entries in Cask's uninstall launchctl stanza.
The code takes the list of launchctl services provided in the uninstall stanza, and when it finds an * it will search the loaded system launchctl items to find any that match, and then pass them to the existing system for uninstalling. There may well be a more efficient/effective way to do this, however I just wanted to get the ball rolling here.
This will likely require new tests to be written, I have little knowledge on unit testing so some guidance here would be great.

Homebrew/homebrew-cask-drivers#3104
Homebrew/homebrew-cask#79661

@BrewTestBot
Copy link
Member

Review period will end on 2022-11-10 at 02:25:11 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Nov 9, 2022
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Good work so far! Some style comments and I'd like to see some test coverage here.

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Nov 10, 2022
@BrewTestBot
Copy link
Member

Review period ended.

@github-actions
Copy link

github-actions bot commented Dec 2, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Dec 2, 2022
@bevanjkay bevanjkay added the in progress Maintainers are working on this label Dec 2, 2022
@github-actions github-actions bot removed the stale No recent activity label Dec 3, 2022
@bevanjkay
Copy link
Member Author

I have made some of the suggested changes here. I'm getting stuck on writing tests for this, would love some direction/help with this.

@MikeMcQuaid
Copy link
Member

I'm getting stuck on writing tests for this, would love some direction/help with this.

@bevanjkay Happy to help! Can you ask a more specific question here?

@bevanjkay
Copy link
Member Author

I have added an initial test that ensures that a system command is sent to search for all running launchctl items when a wildcard is passed through.
I am not sure if there is a way to simulate what the specific method (find_launchctl_with_wildcard) returns within the test to ensure that the entire process is working as expected.

@MikeMcQuaid MikeMcQuaid changed the title cask/artifiact/abstract_uninstall: allow wildcard entries for launchctl cask/artifact/abstract_uninstall: allow wildcard entries for launchctl Dec 12, 2022
@MikeMcQuaid
Copy link
Member

@bevanjkay good job getting things 💚. would still love if you can investigate or reply to remaining comments from me and CodeCov, thanks!

@MikeMcQuaid MikeMcQuaid merged commit 5994f16 into Homebrew:master Dec 29, 2022
@MikeMcQuaid
Copy link
Member

Thanks again @bevanjkay!

@github-actions github-actions bot added the outdated PR was locked due to age label Jan 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in progress Maintainers are working on this outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants