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

batt 0.2.1 (new formula) #166340

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Conversation

Jerry1144
Copy link
Contributor

@Jerry1144 Jerry1144 commented Mar 16, 2024

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Add batt, a utility to manually control charging of Apple Silicon Macbooks, instead of hoping macOS limit charging to 80% for us. I tried to use brew services to handle installing the relevant launchd.plist, although the tool itself has a built-in routine to do so.

I wonder if, instead of hardcoding them, there's a more elegant way of fetching VERSION and GIT_COMMIT variables from the URL. Having Ruby variables holding these two means we don't forget about those in the test do block below.

I cannot decide whether to use system "plutil" or inreplace to modify the plist file, too. The former won't work on Linux, but it handles insertion better than the inflexible replacement syntax.

The uses_from_macos "curl" documents the peculiar fact that IPC is handled using http. Should I remove it instead?

@github-actions github-actions bot added go Go use is a significant feature of the PR or issue new formula PR adds a new formula to Homebrew/homebrew-core labels Mar 16, 2024
@Jerry1144 Jerry1144 force-pushed the batt-new-formula branch 2 times, most recently from cdce86f to e99fe6a Compare March 20, 2024 12:07
@Jerry1144
Copy link
Contributor Author

Jerry1144 commented Mar 20, 2024

I think that's about it, a Formula with a sane test. Sort of. No idea why the batt daemon test does not generate the config file that I can test for existence at a later stage. There's nothing in testpath, it can find the config if there's one leftover at HomebrewPrefix/etc, but it cannot write one anew or that it got deleted right after the first test exited.

TODO: learn more about launchd.plist to see whether the SocketPath key makes no sense in this case.

@charlie0129
Copy link
Contributor

The uses_from_macos "curl" documents the peculiar fact that IPC is handled using http. Should I remove it instead?

I think it can be removed because the ipc http client is contained in the binary itself.

Copy link
Contributor

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 Apr 15, 2024
@Jerry1144
Copy link
Contributor Author

The failing test should have been resolved by Homebrew/brew#16914, a relatively new change. Now the tests should not be failing anymore.

@chenrui333
Copy link
Member

@Jerry1144 can you rebase your pr to the latest master and give it a rerun? Thanks!

Add [batt], a tool to manipulate charging limit on Apple Silicon Macbooks
in place of macOS's opaque Optimize Battry settings.

A service do block was also supplied to utilize brew services.

[batt]:https://github.com/charlie0129/batt
@p-linnane p-linnane removed the stale No recent activity label Jun 7, 2024
@p-linnane p-linnane requested a review from a team June 7, 2024 23:10
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.

Looks good, nice work @Jerry1144!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jun 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 10, 2024
Copy link
Contributor

🤖 An automated task has requested bottles to be published to this PR.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Jun 10, 2024
@BrewTestBot BrewTestBot enabled auto-merge June 10, 2024 07:51
@BrewTestBot BrewTestBot added this pull request to the merge queue Jun 10, 2024
Merged via the queue into Homebrew:master with commit 8889b83 Jun 10, 2024
14 checks passed
@github-actions github-actions bot added the outdated PR was locked due to age label Jul 10, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. go Go use is a significant feature of the PR or issue macos-only Formula depends on macOS new formula PR adds a new formula to Homebrew/homebrew-core outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants