Giter VIP home page Giter VIP logo

nix-review-tools's Introduction

nix-review-tools

Definitely the most original name I could conceive of

This is a WIP repo of tools I use to review stuff for nixos.

This is NOT a definitive project, and parts may split off in other projects, or this project could evolve and be renamed.


General usage notes

All commands should already self-handle their deps by relying on a nix-shell shebang.

The dependencies will be installed, and the scripts should start at that point.


eval-report

Given a list of eval IDs, it will spit out github-flavoured markdown in stdout, ready to be passed to gist or xclip.

This parses the output of the pages of hydra, as they contain more data than the API does.

It will cache HTML files to $PWD. This means:

  • Fills your $PWD with stuff.
  • Does not hit hydra in development.
  • Be mindful of stale data.

jobset-eval-failure

Can be run on a timer, it will automatically use gist to send a report with information about the currently failing jobset eval.

That is, if the jobset eval is failing.

This script is of limited use at large.

nix-review-tools's People

Contributors

bhipple avatar bobrik avatar jonringer avatar ma27 avatar malob avatar samueldr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nix-review-tools's Issues

Issues running latest version

now when i try to run it, i just get:

08:54:20] jon@jon-desktop /home/jon/projects/nix-review-tools/tmp (master)
$ ../eval-report 1570790 > index.html
Traceback (most recent call last):
	7: from -e:1:in `<main>'
	6: from -e:1:in `load'
	5: from /home/jon/projects/nix-review-tools/eval-report:3:in `<top (required)>'
	4: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	3: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	2: from /home/jon/projects/nix-review-tools/lib/hydra.rb:12:in `<top (required)>'
	1: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- active_support (LoadError)
	30: from -e:1:in `<main>'
	29: from -e:1:in `load'
	28: from /home/jon/projects/nix-review-tools/eval-report:3:in `<top (required)>'
	27: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	26: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	25: from /home/jon/projects/nix-review-tools/lib/hydra.rb:12:in `<top (required)>'
	24: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:156:in `require'
	23: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:168:in `rescue in require'
	22: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:168:in `require'
	21: from /nix/store/9cb55j9v6l95wklsiascn8bg99gvgykl-ruby2.6.5-activesupport-6.0.2.1/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support.rb:27:in `<top (required)>'
	20: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	19: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	18: from /nix/store/hb8q5xpqk3i5hcg969vfxg31gyrcmrkb-review-tools-dependencies/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies/autoload.rb:3:in `<top (required)>'
	17: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	16: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	15: from /nix/store/hb8q5xpqk3i5hcg969vfxg31gyrcmrkb-review-tools-dependencies/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/inflector/methods.rb:3:in `<top (required)>'
	14: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	13: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	12: from /nix/store/hb8q5xpqk3i5hcg969vfxg31gyrcmrkb-review-tools-dependencies/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/inflections.rb:3:in `<top (required)>'
	11: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	10: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	 9: from /nix/store/hb8q5xpqk3i5hcg969vfxg31gyrcmrkb-review-tools-dependencies/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/inflector/inflections.rb:4:in `<top (required)>'
	 8: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	 7: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	 6: from /nix/store/hb8q5xpqk3i5hcg969vfxg31gyrcmrkb-review-tools-dependencies/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/i18n.rb:15:in `<top (required)>'
	 5: from /nix/store/hb8q5xpqk3i5hcg969vfxg31gyrcmrkb-review-tools-dependencies/lib/ruby/gems/2.6.0/gems/i18n-1.8.2/lib/i18n.rb:55:in `load_path'
	 4: from /nix/store/hb8q5xpqk3i5hcg969vfxg31gyrcmrkb-review-tools-dependencies/lib/ruby/gems/2.6.0/gems/i18n-1.8.2/lib/i18n.rb:42:in `config'
	 3: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	 2: from /nix/store/12a7h4w68f96j56kzwxxpxbc4zq7n76p-ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	 1: from /nix/store/hb8q5xpqk3i5hcg969vfxg31gyrcmrkb-review-tools-dependencies/lib/ruby/gems/2.6.0/gems/i18n-1.8.2/lib/i18n/config.rb:5:in `<top (required)>'
/nix/store/hb8q5xpqk3i5hcg969vfxg31gyrcmrkb-review-tools-dependencies/lib/ruby/gems/2.6.0/gems/i18n-1.8.2/lib/i18n/config.rb:6:in `<module:I18n>': uninitialized constant I18n::Config (NameError)

Would be nice for items in the "problematic dependencies" table to have links

I tried to implement this in, malob@c47801c, but the links I'm inserting weren't always to the build page for the problematic dependency itself, and I'm not sure why. (I didn't try to hard to figure it out, and only have a very surface level understanding of how the code works.)

For example see: https://malob.github.io/nix-review-tools-reports/nixpkgs:trunk/nixpkgs_trunk_1753129.html

The first few links are what you'd expect, but the link on aarch64-linux python3.9-georss-client-0.15 goes to the build page for home-assistant-component-tests.qld_bushfire.aarch64-linux, which failed as a result of the former not building.

Usage help

I'm giving this a try for the first time to try to solve the following issue: as part of implementing NixOS/nixpkgs#79975, I tested a good portion of the Rust ecosystem, but regrettably there are a couple broken packages I missed (fixed in NixOS/nixpkgs#80153).

I would like to go through and scan Hydra logs for all failing Rust packages that recently started failing so that I can prioritize upgrading them (e.g., NixOS/nixpkgs#80197). It doesn't look like Hydra provides a particularly rich API, and I really like this tool's idea of just downloading all the build logs and munging them to produce a report, but I'm having the following issue:

λ brh nix-review-tools →  ./eval-report 1570625
Traceback (most recent call last):
        10: from -e:1:in `<main>'
         9: from -e:1:in `load'
         8: from /home/bhipple/src/nix-review-tools/eval-report:16:in `<top (required)>'
         7: from /home/bhipple/src/nix-review-tools/eval-report:16:in `map'
         6: from /home/bhipple/src/nix-review-tools/eval-report:16:in `block in <top (required)>'
         5: from /home/bhipple/src/nix-review-tools/lib/hydra/eval.rb:20:in `get'
         4: from /home/bhipple/src/nix-review-tools/lib/hydra/eval.rb:20:in `map'
         3: from /home/bhipple/src/nix-review-tools/lib/hydra/eval.rb:37:in `block in get'
         2: from /home/bhipple/src/nix-review-tools/lib/hydra/eval.rb:37:in `tap'
         1: from /home/bhipple/src/nix-review-tools/lib/hydra/eval.rb:39:in `block (2 levels) in get'
/home/bhipple/src/nix-review-tools/lib/hydra/build.rb:17:in `get': undefined method `next_element' for nil:NilClass (NoMethodError)

(After downloading a ton of build logs).

Two questions:

  1. Is this tool the right tool for the job I'm trying to solve or is there something better, and
  2. If it is the right tool, have you seen this error before? Am I doing something wrong?

Some hydra outputs crash `./eval-report`

Today's crash:

$ ./eval-report 1704065
...
Downloading https://hydra.nixos.org/build/152619227...
Parsing build_152619227
Traceback (most recent call last):
	10: from -e:1:in `<main>'
	 9: from -e:1:in `load'
	 8: from /home/slyfox/dev/git/nix-review-tools/eval-report:16:in `<top (required)>'
	 7: from /home/slyfox/dev/git/nix-review-tools/eval-report:16:in `map'
	 6: from /home/slyfox/dev/git/nix-review-tools/eval-report:16:in `block in <top (required)>'
	 5: from /home/slyfox/dev/git/nix-review-tools/lib/hydra/eval.rb:20:in `get'
	 4: from /home/slyfox/dev/git/nix-review-tools/lib/hydra/eval.rb:20:in `map'
	 3: from /home/slyfox/dev/git/nix-review-tools/lib/hydra/eval.rb:37:in `block in get'
	 2: from /home/slyfox/dev/git/nix-review-tools/lib/hydra/eval.rb:37:in `tap'
	 1: from /home/slyfox/dev/git/nix-review-tools/lib/hydra/eval.rb:39:in `block (2 levels) in get'
/home/slyfox/dev/git/nix-review-tools/lib/hydra/build.rb:19:in `get': undefined method `next_element' for nil:NilClass (NoMethodError)

fetch.rb:31:in `read': No such file or directory

Whenever I try to use it, it fails like

./eval-report 1571115
Downloading https://hydra.nixos.org/eval/1571115?full=1...
Downloading https://hydra.nixos.org/build/113104577...
Parsing build_113104577
Downloading https://hydra.nixos.org/build/113083476...
Parsing build_113083476
Downloading https://hydra.nixos.org/build/113082122...
Parsing build_113082122
Downloading https://hydra.nixos.org/build/113080561...
Parsing build_113080561
Downloading https://hydra.nixos.org/build/113081999...
Traceback (most recent call last):
	13: from -e:1:in `<main>'
	12: from -e:1:in `load'
	11: from /home/worldofpeace/Code/nix/nix-review-tools/eval-report:16:in `<top (required)>'
	10: from /home/worldofpeace/Code/nix/nix-review-tools/eval-report:16:in `map'
	 9: from /home/worldofpeace/Code/nix/nix-review-tools/eval-report:16:in `block in <top (required)>'
	 8: from /home/worldofpeace/Code/nix/nix-review-tools/lib/hydra/eval.rb:20:in `get'
	 7: from /home/worldofpeace/Code/nix/nix-review-tools/lib/hydra/eval.rb:20:in `map'
	 6: from /home/worldofpeace/Code/nix/nix-review-tools/lib/hydra/eval.rb:37:in `block in get'
	 5: from /home/worldofpeace/Code/nix/nix-review-tools/lib/hydra/eval.rb:37:in `tap'
	 4: from /home/worldofpeace/Code/nix/nix-review-tools/lib/hydra/eval.rb:39:in `block (2 levels) in get'
	 3: from /home/worldofpeace/Code/nix/nix-review-tools/lib/hydra/build.rb:13:in `get'
	 2: from /home/worldofpeace/Code/nix/nix-review-tools/lib/hydra/fetch.rb:44:in `build'
	 1: from /home/worldofpeace/Code/nix/nix-review-tools/lib/hydra/fetch.rb:31:in `_get'
/home/worldofpeace/Code/nix/nix-review-tools/lib/hydra/fetch.rb:31:in `read': No such file or directory @ rb_sysopen - build_113081999 (Errno::ENOENT)

Tried on different evals as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.