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

feat(updater): expose builder, allow setting a custom version checker #3792

Merged
merged 4 commits into from Mar 28, 2022

Conversation

lucasfernog
Copy link
Member

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

@lucasfernog lucasfernog requested a review from a team March 28, 2022 14:56
@lucasfernog lucasfernog requested a review from a team as a code owner March 28, 2022 14:56
@JonasKruckenberg
Copy link
Contributor

JonasKruckenberg commented Mar 28, 2022

Here is goes 😉: I felt version_comparator is a custom Ord implementation so I was confused that it didn't return std::cmp::Ordering.
updater_checker is better, but feels less descriptive and more like it's a callback that is responsible for checking the actual http endpoint.

I would suggest should_update instead. It's simple and returning a bool makes a lot of sense from the name alone.

Edit: We also already use should_update as the value name, so why not just make that the function name too?

@lucasfernog
Copy link
Member Author

should_update feels more like a builder method to set a bool than a closure though.

@lucasfernog
Copy link
Member Author

I changed it to version_checker recently btw.

@JonasKruckenberg
Copy link
Contributor

I changed it to version_checker recently btw.

Ah yeah sorry meant that 😅

@JonasKruckenberg
Copy link
Contributor

JonasKruckenberg commented Mar 28, 2022

should_update feels more like a builder method to set a bool than a closure though.

Good point...

How about should_install_update?

That way it's clearer that it means the noun update, not the verb.

@lucasfernog
Copy link
Member Author

should_update feels more like a builder method to set a bool than a closure though.

Good point...

How about should_install_update?

Better than should_update. If no one can come up with a better name, let's go with this one.

@JonasKruckenberg
Copy link
Contributor

JonasKruckenberg commented Mar 28, 2022

We can also shorten it to should_install maybe 🤔 though should_install_update is clearer

Edit: I think I prefer should_install, since it's already clear that it's about updates from the context (the getter is called updater() after all)
Plus App.updater().should_install_update() feel unnecessarily redundant. App.updater().should_install() just feels nicer to me

@lucasfernog
Copy link
Member Author

Good point @JonasKruckenberg

@lucasfernog lucasfernog merged commit c64268f into dev Mar 28, 2022
@lucasfernog lucasfernog deleted the feat/updater-custom-version-check branch March 28, 2022 16:58
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.

None yet

2 participants