[Reproducible-commits] [misc] 01/01: reports: more automation and consistency

Ximin Luo infinity0 at debian.org
Mon May 16 16:13:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository misc.

commit ad290cb5c4ed63e450f069a51002a1b8e8f19a4f
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon May 16 18:12:02 2016 +0200

    reports: more automation and consistency
    
    - always use UTC with date(1)
    - tweak week_1_end to the relevant UTC timestamp
    - add a "variables" file so we don't need to keep re-calculating dates
    - tweak the issues.yml shell snippet to use --since and --until; the @{} syntax
      only works on reflogs which you don't have right after you do a fresh clone
---
 reports/README               | 10 ++++++----
 reports/bin/get-latest-data  | 15 ++++++++++-----
 reports/bin/mutt-all-uploads |  2 +-
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/reports/README b/reports/README
index 5ee4204..8e87bd8 100644
--- a/reports/README
+++ b/reports/README
@@ -59,9 +59,10 @@ Process
 
    Make sure you get a recent copy of `notes.git`. Then:
 
+       $ . ../misc/reports/latest/variables
        $ ../misc/reports/bin/review-stats \
-              <(git show "master@{$(LC_ALL=C date --date='a week ago' +'%b %d')}":packages.yml) \
-              <(git show "master@{$(LC_ALL=C date +'%b %d')}":packages.yml)
+              <(git show "master@{@$RB_REPORT_WEEK_START}":packages.yml) \
+              <(git show "master@{@$RB_REPORT_WEEK_END}":packages.yml)
 
    The UDD query to know who reported how many FTBFS follows:
 
@@ -78,11 +79,12 @@ Process
 
    Make sure you get a recent copy of `notes.git`. Then:
 
-       $ git diff "master@{$(LC_ALL=C date --date='a week ago' +'%b %d')}..master@{$(LC_ALL=C date +'%b %d')}" issues.yml
+       $ . ../misc/reports/latest/variables
+       $ git log --since @$RB_REPORT_WEEK_START --until @$RB_REPORT_WEEK_END --graph -p master -- issues.yml
 
 6. Manually reported:
 
-   Look at `/home/groups/reproducible/weekly-log.txt` on Alioth.
+       $ ssh -t alioth.debian.org less /home/groups/reproducible/weekly-log.txt
 
 7. Git repositories and custom toolchain:
 
diff --git a/reports/bin/get-latest-data b/reports/bin/get-latest-data
index 4e341dd..49c270e 100755
--- a/reports/bin/get-latest-data
+++ b/reports/bin/get-latest-data
@@ -2,7 +2,7 @@
 set -e
 
 scriptdir="$(readlink -f "$(dirname "$0")")"
-week_1_end=1430604000 # May 3 2015, 00:00, Sunday
+week_1_end=1430611200 # May 3 2015, 00:00 UTC, Sunday
 
 mkdir -p data
 now="$(date +%s)"
@@ -20,14 +20,19 @@ done
 week="${week:-$prev_week}"
 week_end=$((week_1_end + (week - 1)*7*24*3600))
 week_start=$((week_end - 7*24*3600))
-week_path="week_${week}_ending_$(date -d@${week_end} +%Y-%m-%d)"
+week_path="week_${week}_ending_$(date -u -d@${week_end} +%Y-%m-%d)"
 
-echo >&2 "Getting data for the period $(date -d@${week_start} +%Y-%m-%d) to $(date -d@${week_end} +%Y-%m-%d)"
+echo >&2 "Getting data for the period $(date -u -d@${week_start} +%Y-%m-%d) to $(date -u -d@${week_end} +%Y-%m-%d)"
 
-#rm -rf "data/$week_path"
 mkdir -p "data/$week_path"
 (cd "data/$week_path"
 
+cat >variables <<eof
+export RB_REPORT_WEEK_NUMBER=$week
+export RB_REPORT_WEEK_START=$week_start
+export RB_REPORT_WEEK_END=$week_end
+eof
+
 echo >&2 "- reproducible.db"
 wget -q -N https://reproducible.debian.net/reproducible.db
 
@@ -44,4 +49,4 @@ echo "SELECT DISTINCT bugs.id FROM bugs_usertags, bugs WHERE email = 'reproducib
   | awk '/[0-9]/ { print $1 }' > bugs
 )
 
-ln -sf "data/$week_path" latest
+rm -f latest && ln -sf "data/$week_path" latest
diff --git a/reports/bin/mutt-all-uploads b/reports/bin/mutt-all-uploads
index 2c8e68a..6af80d9 100755
--- a/reports/bin/mutt-all-uploads
+++ b/reports/bin/mutt-all-uploads
@@ -7,6 +7,6 @@ pattern="${1:-reproduc\|SOURCE_DATE_EPOCH}"
 
 quote() { printf "'%s'" "${1//\'/\'\\\'\'}"; }
 command="mutt -e \"push 'l ~b $pattern<Enter>';\" \
-  -R -f /srv/mail-archives/lists/debian-devel-changes/debian-devel-changes.$(date +%Y%m)"
+  -R -f /srv/mail-archives/lists/debian-devel-changes/debian-devel-changes.$(date -u +%Y%m)"
 
 ssh -t master.debian.org sh -c "$(quote "$command")"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list