Last active
January 26, 2020 21:06
-
-
Save ecstatic-morse/be799bfa4d3b3d6e163fa61a9c30706f to your computer and use it in GitHub Desktop.
Extract regressed crates from crater's `results.json`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
function find_crates { | |
file=$1 | |
origin=$2 | |
result=$3 | |
case "$origin" in | |
github) | |
domain=https://github.com | |
;; | |
cratesio) | |
domain=https://crates.io | |
;; | |
*) | |
echo >2 "Unknown crate origin" | |
exit 1 | |
esac | |
jq -r ".crates[] | select(.res == \"$result\") | select(.url | startswith(\"$domain\")) | .url" "$file" | |
} | |
find_crates "$1" github regressed | sed -r 's|^https://github.com/([^/]+)/([^/]+)/.*$|\1/\2|' | |
find_crates "$1" cratesio regressed | sed -r 's|^https://crates.io/crates/([^/]+)/.*$|\1|' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the sample output for this
results.json
.You can pass a link to the generated text file to
craterbot
e.g.@craterbot run mode=check-only crates=http://some.site/crate-list.txt
. This will create an experiment that runs only on those crates.