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

Add network_not_metered and custom check scripts #111

Merged
merged 8 commits into from
May 29, 2024

Conversation

cr7pt0gr4ph7
Copy link
Contributor

@cr7pt0gr4ph7 cr7pt0gr4ph7 commented Apr 18, 2024

This pull request contains four small-ish fixes/improvements:

  • Improve the documentation clarity in the main README.md
  • Allow specifying lowercase log levels via UBLUE_LOG to match the behavior of most other tools
  • Cleanup the config file loading logic, and avoid crashes when not all config options are specified.
  • Add a --config CLI option to allow alternate config files when testing

...as well as two new features related to the update precondition checks (these two were the main driver for this pull request):

  • Add a network_not_metered check to prevent downloading multiple GB of data when on metered/mobile connections
    (the latter of which happened to me while using my smartphone as a hotspot).
    This check should probably be enabled in all environments where NetworkManager is supported, to avoid annoying surprises on mobile data plans. It is currently disabled by default, though, to not break any existing installations.

  • Add a facility for using fully custom scripts to check for additional preconditions.
    My personal rationale for this is that I want to be able to prevent unnecessary background work when using my laptop for a DJ set, to avoid stutter. I'm not sure yet whether I want to use a manual settings toggle or automatic detection of the DJ software for this, but implementing it in a flexible manner allows me and other to solve these usecases without bloating up the ublue_update code too much.

Fixes #115

@cr7pt0gr4ph7
Copy link
Contributor Author

Hi 👋 Just as a heads-up: Do you have any further questions about this PR? I'll be happy to answer them.

@cr7pt0gr4ph7 cr7pt0gr4ph7 force-pushed the custom-preconditions branch from 8320439 to 91e481d Compare May 22, 2024 11:35
@gerblesh
Copy link
Collaborator

thanks so much for the PR! And thanks for giving this project some much needed love. LGTM, looks like it needs some formatting changes though. Sorry for the late reply, I've been pretty busy lately

@gerblesh
Copy link
Collaborator

gerblesh commented May 28, 2024

ok so formatting changes should probably work with just black but it looks like CI is kinda borked

@KyleGospo KyleGospo added this pull request to the merge queue May 29, 2024
Merged via the queue into ublue-os:main with commit b2bbbf0 May 29, 2024
2 of 4 checks passed
@cr7pt0gr4ph7 cr7pt0gr4ph7 deleted the custom-preconditions branch May 31, 2024 16:03
@cr7pt0gr4ph7
Copy link
Contributor Author

thanks so much for the PR! And thanks for giving this project some much needed love. LGTM, looks like it needs some formatting changes though. Sorry for the late reply, I've been pretty busy lately
You're welcome! This resolves one of the (actually very few) hiccups I've discovered after switching to Bluefin, so I'm happy to make a great idea like Bluefin just a tiny bit greater.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metered network connections are not respected
3 participants