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

slack: add auto-updater script #102694

Merged
merged 3 commits into from Nov 5, 2020
Merged

Conversation

samuela
Copy link
Member

@samuela samuela commented Nov 4, 2020

Motivation for this change

Save hooman time by spending computer time. This will enable adding slack to https://github.com/samuela/nixpkgs-upkeep.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@samuela
Copy link
Member Author

samuela commented Nov 4, 2020

cc maintainer @mmahut

@mmahut
Copy link
Member

mmahut commented Nov 4, 2020

@samuela what is the advantage of this approach versus using @r-ryantm?

@samuela
Copy link
Member Author

samuela commented Nov 4, 2020

@samuela what is the advantage of this approach versus using @r-ryantm?

They're more or less the same, with the main difference being that nixpkgs-upkeep does packages that @r-ryantm is not auto-updating. A few other differences: nixpkgs-upkeep has build logs available for all to see on GitHub Actions, only is based on the auto-update scripts that are already in nixpkgs for convenience, and runs every 12 hours.

It's not really meant to be a competition though. I mainly created this PR so that slack could have all of the update.sh conveniences that other packages like vscode and spotify have.

@doronbehar
Copy link
Contributor

You should also set passthru.updateScript.

@samuela
Copy link
Member Author

samuela commented Nov 5, 2020

Ok, added passthru.updateScript in 3037318.

@mmahut
Copy link
Member

mmahut commented Nov 5, 2020

@samuela I really appreciate this effort, but I feel like it would be better to work on the @r-ryantm bot as a community tool instead of creating an alternative? I do not personally like including scripts with such a limited usage in nixpkgs, the repo as well as the nix store is growing painfully and I feel like we need to work on tech debt and not I feel like this is just creating another one.

@samuela
Copy link
Member Author

samuela commented Nov 5, 2020

We could also just merge this update script but not add slack to nixpkgs-upkeep. I'd imagine that @r-ryantm could use an update script like this anyhow.

OTOH, if you're opposed to update scripts in nixpkgs that may not be favorable. As another option, this script could be added to nixpkgs-upkeep but not nixpkgs and run "out of sight, out of mind".

Wdyt?

@doronbehar
Copy link
Contributor

You are both confusing a few things:

  1. @r-ryantm is supposed to run passthru.updateScripts (since use passthru.updateScript ryantm/nixpkgs-update#205 ), but IIRC it doesn't run it for unfree packages.
  2. @mmahut the script added here, does something that @r-ryantm doesn't. nixpkgs-update has a limited number of methods to grab the latest version of a package:
    • Repology
    • GitHub releases.
    • Pypi releases
  3. Repology, which is not the most established way to get the latest versions, is essentially based on what other distro's repos are doing, but it's not really reliable because it's a bit disconnected from true upstream.

Hence, the script added here is justified because in order to programmatically find out "what is the latest slack version available?", one has to scrap their website, and not look it up in in one of the sources mentioned above.

@doronbehar doronbehar merged commit ce08cf0 into NixOS:master Nov 5, 2020
@mmahut
Copy link
Member

mmahut commented Nov 5, 2020

@doronbehar I would really appreciate it, that next time, you would wait for the package maintainer himself to merge a change after clearing up all questions about a change.

@ryantm
Copy link
Member

ryantm commented Nov 5, 2020

@mmahut r-ryantm uses passthru.updateScript so this change is likely to help it. It would have likely failed before because of multiple hashes being present.

@doronbehar r-ryantm updates unfree things

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

Successfully merging this pull request may close these issues.

None yet

4 participants