-
Notifications
You must be signed in to change notification settings - Fork 4k
scripts: add summarize-l3.sh #156631
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
Merged
Merged
scripts: add summarize-l3.sh #156631
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Copyright 2025 The Cockroach Authors. | ||
| # | ||
| # Use of this software is governed by the CockroachDB Software License | ||
| # included in the /LICENSE file. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if [ -z "$(which gdate)" ]; then | ||
| echo "gdate not found, run: brew install coreutils" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ -z "$(which jq)" ]; then | ||
| echo "jq not found, run: brew install jq" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ -z "${1-}" ]; then | ||
| cat <<EOF | ||
| Usage: $(basename "$0") <base date> | ||
|
|
||
| <base date> should be the date of the Monday following the L3 shift. You can use | ||
| 'today' if it is today. | ||
|
|
||
| This should be run on the Monday following the L3 shift to generate an | ||
| up-to-date summary of the various queues, ideally immediately before the on-call | ||
| meeting. | ||
|
|
||
| EOF | ||
| exit 1 | ||
| fi | ||
|
|
||
| base="${1}" | ||
|
|
||
| # We care about the recently completed interval | ||
| # which started Saturday last week and finished | ||
| # Friday EOD, i.e. Sat <= t <= Fri. | ||
| # | ||
| # To a lesser degree, we also care about what came | ||
| # in since the new shift # started, i.e. Sat2 <= t <= Sun. | ||
| # The assignee will not necessarily have had time to work | ||
| # on these. | ||
| # | ||
| # [Sat1] Sun Mon Tues Wed Thurs [Fri] [Sat2] [Sun] | ||
| sat1=$(gdate -d "${base} - 9 days" "+%Y-%m-%d") | ||
| fri=$(gdate -d "${base} - 3 days" "+%Y-%m-%d") | ||
| #sat2=$(gdate -d "${base} - 3 days" "+%Y-%m-%d") | ||
| #sun=$(gdate -d "${base} - 1 days" "+%Y-%m-%d") | ||
|
|
||
| function count() { | ||
| # args: all|open|closed github_query | ||
| gh issue list --json number,title -L 999 -s "${1}" -q 'length' -S "$2" | ||
| } | ||
|
|
||
| function ghurl() { | ||
| echo -n "https://github.com/cockroachdb/cockroach/issues?q=" | ||
| echo -n "$1" | jq -sRr @uri | ||
| } | ||
|
|
||
| function mdghurl() { | ||
| echo -n "[${1}]($(ghurl "${2}"))" | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
| q_open_rel_blockers="is:issue is:open label:C-test-failure label:release-blocker,GA-blocker label:T-kv,T-kv-replication,T-admission-control" | ||
| open_rel_blockers_count=$(count open "${q_open_rel_blockers}") | ||
| relblockersmd=$(mdghurl "Release Blockers" "${q_open_rel_blockers}") | ||
|
|
||
| q_roachtest_queue="is:issue label:O-roachtest label:T-kv,T-kv-replication,T-admission-control -label:C-bug,X-infra-flake,X-duplicate,X-unactionable,X-invalid,X-stale" | ||
| roachtest_queue_count=$(count all "${q_roachtest_queue}") | ||
| roachtestqueuemd=$(mdghurl "Roachtest Triage" "${q_roachtest_queue}") | ||
|
|
||
| q_triage_queue="is:issue label:O-robot -label:O-roachtest label:C-test-failure label:T-kv,T-kv-replication,T-admission-control -label:C-bug,X-infra-flake,X-duplicate,X-unactionable,X-invalid,X-stale" | ||
| triage_queue_count=$(count all "${q_triage_queue}") | ||
| triagequeuemd=$(mdghurl "Unit Test Triage" "${q_triage_queue}") | ||
|
|
||
| q_open_test_failures="is:issue is:open label:C-test-failure,skipped-test label:T-kv,T-kv-replication,T-admission-control" | ||
| open_test_failures_count=$(count open "${q_open_test_failures}") | ||
| q_open_test_failures_dedup="is:issue is:open label:C-test-failure,skipped-test label:T-kv,T-kv-replication,T-admission-control -label:X-infra-flake -label:X-duplicate -label:X-unactionable -label:X-invalid -label:X-stale -label:O-perturbation" | ||
| open_test_failures_dedup_count=$(count open "${q_open_test_failures_dedup}") | ||
| openfailuresmd=$(mdghurl "Open Test Failures" "${q_open_test_failures_dedup}") | ||
|
|
||
| # Github `..` issue filtering is inclusive on the end day. | ||
| ghweek="${sat1}..${fri}" | ||
|
|
||
| q_created_in_week="created:$ghweek is:issue label:C-test-failure label:T-kv,T-kv-replication,T-admission-control" | ||
| created=$(count all "${q_created_in_week}") | ||
| createdmd=$(mdghurl "Created" "${q_created_in_week}") | ||
|
|
||
| q_closed_in_week="closed:$ghweek is:issue label:C-test-failure label:T-kv,T-kv-replication,T-admission-control" | ||
| closed=$(count all "${q_closed_in_week}") | ||
| closedmd=$(mdghurl "Closed" "${q_closed_in_week}") | ||
|
|
||
| from=$(gdate -d "${sat1}" +"%a %Y-%m-%d") | ||
| to=$(gdate -d "${fri}" +"%a %Y-%m-%d") | ||
| now=$(env TZ='America/New_York' gdate +"%a %Y-%m-%d %H:%M:%S ET") | ||
|
|
||
| cat <<EOF | ||
| - Test failure trends over ${from} to ${to} (incl): | ||
| - ${createdmd}: ${created} | ||
| - ${closedmd}: ${closed} | ||
| - Net change: $((created-closed)) | ||
| - Queues (as of $now): | ||
| - ${relblockersmd}: $open_rel_blockers_count | ||
| - ${roachtestqueuemd}: $roachtest_queue_count | ||
| - ${triagequeuemd}: $triage_queue_count | ||
| - ${openfailuresmd}: $open_test_failures_dedup_count (+$((open_test_failures_count - open_test_failures_dedup_count)) duplicates) | ||
| EOF | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.