From c10471e3f98a9922a30896908cd7c31b2bdd8ba9 Mon Sep 17 00:00:00 2001 From: Peter Wilmott Date: Mon, 2 Mar 2015 12:47:12 +0000 Subject: Add new_* pages --- web/app.rb | 12 ++++++++++++ web/views/layout.erb | 11 ++++++++++- web/views/new_keywords.erb | 4 ++++ web/views/new_targets.erb | 4 ++++ web/views/new_versions.erb | 4 ++++ 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 web/views/new_keywords.erb create mode 100644 web/views/new_targets.erb create mode 100644 web/views/new_versions.erb diff --git a/web/app.rb b/web/app.rb index 3164863..6e578e1 100644 --- a/web/app.rb +++ b/web/app.rb @@ -67,6 +67,18 @@ class RubyTinderbox < Sinatra::Base erb :repoman_history, locals: { repomans: repomans } end + get '/new_targets' do + erb :new_targets + end + + get '/new_versions' do + erb :new_versions + end + + get '/new_keywords' do + erb :new_keywords + end + get '/visualizations' do # Timestamps update_timestamp = Package.first[:update_timestamp] diff --git a/web/views/layout.erb b/web/views/layout.erb index f424ee4..bf747d6 100644 --- a/web/views/layout.erb +++ b/web/views/layout.erb @@ -66,8 +66,17 @@
  • Ruby Targets
  • Outdated Gems
  • Build Status (CI)
  • -
  • Repoman Checks
  • +
  • Repoman Checks (QA)
  • +
  • Visualizations
  • + + diff --git a/web/views/new_keywords.erb b/web/views/new_keywords.erb new file mode 100644 index 0000000..9f96c63 --- /dev/null +++ b/web/views/new_keywords.erb @@ -0,0 +1,4 @@ +
    +

    New Keywords

    +
    +

    This page is a work in progress

    diff --git a/web/views/new_targets.erb b/web/views/new_targets.erb new file mode 100644 index 0000000..8ae1218 --- /dev/null +++ b/web/views/new_targets.erb @@ -0,0 +1,4 @@ +
    +

    New Targets

    +
    +

    This page is a work in progress

    diff --git a/web/views/new_versions.erb b/web/views/new_versions.erb new file mode 100644 index 0000000..0477f38 --- /dev/null +++ b/web/views/new_versions.erb @@ -0,0 +1,4 @@ +
    +

    New Versions

    +
    +

    This page is a work in progress

    -- cgit v1.2.3-65-gdbad From 7266717147d7998b86386f3e73667f0460b2a57a Mon Sep 17 00:00:00 2001 From: Peter Wilmott Date: Tue, 3 Mar 2015 18:59:58 +0000 Subject: Change the format used to store log files on disk. This allows packages to be linked to the sha1 sum of their ebuilds to prevent mixed information when ebuilds are edited but not bumped. It also lays the groundwork for including information about hypothetical build situations, next_target, next_keyword, ect. The db schema, web interface, and docker glue will need to be updated to account for this new layout. --- Dockerfile | 6 +-- bin/get_stage3.sh | 11 ++++++ bin/make.conf | 11 ++++++ bin/provision.sh | 17 +++++++++ bin/repoman.sh | 72 ++++++++++++++++++++++++++++++++++++ bin/tinder.sh | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++ conf/get_stage3.sh | 11 ------ conf/make.conf | 11 ------ conf/provision.sh | 22 ----------- repoman.sh | 49 ------------------------- tinder.sh | 82 ----------------------------------------- web/.rubocop.yml | 2 + 12 files changed, 219 insertions(+), 180 deletions(-) create mode 100755 bin/get_stage3.sh create mode 100644 bin/make.conf create mode 100755 bin/provision.sh create mode 100755 bin/repoman.sh create mode 100755 bin/tinder.sh delete mode 100755 conf/get_stage3.sh delete mode 100644 conf/make.conf delete mode 100755 conf/provision.sh delete mode 100755 repoman.sh delete mode 100755 tinder.sh diff --git a/Dockerfile b/Dockerfile index b5b6e43..3ef67f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,8 @@ MAINTAINER Peter Wilmott ADD cache/stage3-amd64.tar.bz2 / RUN mkdir /ruby-tinderbox -ADD conf/provision.sh /ruby-tinderbox/ -ADD conf/make.conf /ruby-tinderbox/ -ADD tinder.sh /ruby-tinderbox/ -ADD repoman.sh /ruby-tinderbox/ +ADD bin/* /ruby-tinderbox/ ADD web/lib/packages.py /ruby-tinderbox/ ADD web/lib/deps.py /ruby-tinderbox/ -RUN sed -i -e 's/sudo //g' /ruby-tinderbox/provision.sh RUN /ruby-tinderbox/provision.sh diff --git a/bin/get_stage3.sh b/bin/get_stage3.sh new file mode 100755 index 0000000..da04ec2 --- /dev/null +++ b/bin/get_stage3.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +DIST_MIRROR="http://mirror.bytemark.co.uk/gentoo/" +LATEST_STAGE3=$(curl -s $DIST_MIRROR/releases/amd64/autobuilds/latest-stage3-amd64.txt | tail -1 | awk '{print $1}') +STAGE3_URI="$DIST_MIRROR/releases/amd64/autobuilds/$LATEST_STAGE3" + +if [[ ! -f "$SCRIPT_DIR/../cache/stage3-amd64.tar.bz2" ]]; then + curl -o "$SCRIPT_DIR/../cache/stage3-amd64.tar.bz2" $STAGE3_URI +fi diff --git a/bin/make.conf b/bin/make.conf new file mode 100644 index 0000000..f16dbb7 --- /dev/null +++ b/bin/make.conf @@ -0,0 +1,11 @@ +CFLAGS="-O2 -pipe" +CXXFLAGS="" +CHOST="x86_64-pc-linux-gnu" + +USE="mmx sse sse2 -perl -python" +RUBY_TARGETS="ruby19 ruby20 ruby21 ruby22" + +GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/" +SYNC="rsync://mirror.bytemark.co.uk/gentoo-portage" +EMERGE_DEFAULT_OPTS="--color=n --nospinner" +PORTDIR_OVERLAY="/ruby-tinderbox/overlay" diff --git a/bin/provision.sh b/bin/provision.sh new file mode 100755 index 0000000..7cc5510 --- /dev/null +++ b/bin/provision.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +emerge-webrsync +emerge --metadata +cp "$SCRIPT_DIR/make.conf" /etc/portage/make.conf + +RUBIES="dev-lang/ruby:1.9 dev-lang/ruby:2.0 dev-lang/ruby:2.1 dev-lang/ruby:2.2" +set +e +emerge --pretend --quiet $RUBIES +if [[ $? == 1 ]]; then + emerge --autounmask-write $RUBIES + etc-update --automode -5 +fi +set -e +emerge --noreplace --quiet $RUBIES diff --git a/bin/repoman.sh b/bin/repoman.sh new file mode 100755 index 0000000..060d48e --- /dev/null +++ b/bin/repoman.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail +[[ $(whoami) == 'root' ]] || exit 1 +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +function ENV_SETUP() { + if [[ ! -d $SCRIPT_DIR/ci-logs/ ]]; then + mkdir "$SCRIPT_DIR/ci-logs" + fi +} + +function SETUP() { + mkdir -p "$SCRIPT_DIR/overlay" + mkdir -p "$SCRIPT_DIR/overlay/$CATEGORY/$NAME" + cp "/usr/portage/$CATEGORY/$NAME/$NAME-$VERSION.ebuild" "$SCRIPT_DIR/overlay/$CATEGORY/$NAME" + cp "/usr/portage/$CATEGORY/$NAME/metadata.xml" "$SCRIPT_DIR/overlay/$CATEGORY/$NAME" +} + +function REPOMAN() { + cd "$SCRIPT_DIR/overlay/$CATEGORY/$NAME" + repoman scan || true + repoman manifest + repoman full > /tmp/repoman_log_current || true + echo $? > /tmp/repoman_result_current + + sed -i -e "/^USE_RUBY/s/$CURR_TARGET/$CURR_TARGET $NEXT_TARGET/" "$NAME-$VERSION.ebuild" + repoman manifest + repoman full > /tmp/repoman_log_next || true + echo $? > /tmp/repoman_result_next + + LOG +} + +function LOG() { + DATE=$(date +%s) + SHA1=$(sha1sum "/usr/portage/$CATEGORY/$NAME/$NAME-$VERSION.ebuild" | awk '{print $1}') + mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/current_target/repomans/$DATE" + mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/next_target/repomans/$DATE" + + cp /tmp/repoman_log_current "$SCRIPT_DIR/ci-logs/$SHA1/current_target/repomans/$DATE/repoman_log" + cp /tmp/repoman_result_current "$SCRIPT_DIR/ci-logs/$SHA1/current_target/repomans/$DATE/repoman_result" + cp /tmp/repoman_log_next "$SCRIPT_DIR/ci-logs/$SHA1/next_target/repomans/$DATE/repoman_log" + cp /tmp/repoman_result_next "$SCRIPT_DIR/ci-logs/$SHA1/next_target/repomans/$DATE/repoman_result" + + chmod 755 -R "$SCRIPT_DIR/ci-logs" +} + +function CLEANUP() { + rm /tmp/repoman_log_current + rm /tmp/repoman_result_current + rm /tmp/repoman_log_next + rm /tmp/repoman_result_next + rm -r "$SCRIPT_DIR/overlay" +} + +ENV_SETUP + +PKG_ARR=($(qatom $1)) +CATEGORY="${PKG_ARR[0]}" +NAME="${PKG_ARR[1]}" +if [[ ${PKG_ARR[3]:=foo} == 'foo' ]]; then + VERSION="${PKG_ARR[2]}" +else + VERSION="${PKG_ARR[2]}-${PKG_ARR[3]}" +fi + +PACKAGE=$1 +CURR_TARGET=$2 +NEXT_TARGET=$3 +SETUP +REPOMAN +CLEANUP diff --git a/bin/tinder.sh b/bin/tinder.sh new file mode 100755 index 0000000..eb6d383 --- /dev/null +++ b/bin/tinder.sh @@ -0,0 +1,105 @@ +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail +[[ $(whoami) == 'root' ]] || exit 1 +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +function ENV_SETUP() { + eselect news read --quiet all + eselect ruby set 1 + if [[ ! -d /etc/portage/env/ ]]; then + mkdir /etc/portage/env/ + fi + echo 'FEATURES="${FEATURES} test keepwork"' > /etc/portage/env/test + + if [[ ! -d $SCRIPT_DIR/ci-logs/ ]]; then + mkdir "$SCRIPT_DIR/ci-logs" + fi +} + +function SETUP () { + cp /var/lib/portage/world /var/lib/portage/world.original + echo "" > /etc/portage/package.accept_keywords + echo "=$PACKAGE doc" > /etc/portage/package.use + echo "=$PACKAGE test" > /etc/portage/package.env + + if [[ -e /usr/portage/packages/$PACKAGE.tbz2 ]]; then + rm "/usr/portage/packages/$PACKAGE.tbz2" + fi + + set +e + emerge --pretend --quiet "=$PACKAGE" + if [[ $? == 1 ]]; then + emerge --autounmask-write "=$PACKAGE" + etc-update --automode -5 + fi + set -e +} + +function EMERGE() { + set +e + timeout 1000 emerge --usepkg --buildpkg "=$PACKAGE" + LOG "$?" + set -e +} + +function LOG() { + DATE=$(date +%s) + SHA1=$(sha1sum "/usr/portage/$CATEGORY/$NAME/$NAME-$VERSION.ebuild" | awk '{print $1}') + mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE" + + emerge --info "=$PACKAGE" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/emerge-info" + emerge -pqv "=$PACKAGE" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/emerge-pqv" + cp "/var/tmp/portage/$PACKAGE/temp/build.log" "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/build.log" + cp "/var/tmp/portage/$PACKAGE/temp/environment" "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/environment" + gem list > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/gem-list" + + if [[ $1 == 0 ]]; then + RESULT="\e[0;32mBUILD SUCCEEDED\e[0m" + touch "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/succeeded" + elif [[ $1 == 1 ]]; then + RESULT="\e[0;31mBUILD FAILED\e[0m" + touch "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/failed" + elif [[ $1 == 124 ]]; then + RESULT="\e[0;31mBUILD TIMED OUT\e[0m" + touch "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/timedout" + else + RESULT="\e[0;31mBUILD UNKNOWN\e[0m" + touch "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/unknown" + fi + + chmod 755 -R "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE" +} + +function CLEANUP() { + mv /var/lib/portage/world.original /var/lib/portage/world + rm -r /var/tmp/portage/* || true + emerge --depclean --quiet + echo -e "$PACKAGE : $RESULT" +} + +ENV_SETUP + +PKG_ARR=($(qatom $1)) +CATEGORY="${PKG_ARR[0]}" +NAME="${PKG_ARR[1]}" +if [[ ${PKG_ARR[3]:=foo} == 'foo' ]]; then + VERSION="${PKG_ARR[2]}" +else + VERSION="${PKG_ARR[2]}-${PKG_ARR[3]}" +fi + +if [[ $# -eq 1 ]]; then + TYPE='current_target' + PACKAGE=$1 + SETUP + EMERGE + CLEANUP +elif [[ $# -eq 3 ]]; then + TYPE='next_target' + PACKAGE=$1 + CURR_TARGET=$2 + NEXT_TARGET=$3 + SETUP + EMERGE + CLEANUP +fi diff --git a/conf/get_stage3.sh b/conf/get_stage3.sh deleted file mode 100755 index da04ec2..0000000 --- a/conf/get_stage3.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -set -o errexit -o nounset -o pipefail -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -DIST_MIRROR="http://mirror.bytemark.co.uk/gentoo/" -LATEST_STAGE3=$(curl -s $DIST_MIRROR/releases/amd64/autobuilds/latest-stage3-amd64.txt | tail -1 | awk '{print $1}') -STAGE3_URI="$DIST_MIRROR/releases/amd64/autobuilds/$LATEST_STAGE3" - -if [[ ! -f "$SCRIPT_DIR/../cache/stage3-amd64.tar.bz2" ]]; then - curl -o "$SCRIPT_DIR/../cache/stage3-amd64.tar.bz2" $STAGE3_URI -fi diff --git a/conf/make.conf b/conf/make.conf deleted file mode 100644 index 5496b1c..0000000 --- a/conf/make.conf +++ /dev/null @@ -1,11 +0,0 @@ -CFLAGS="-O2 -pipe" -CXXFLAGS="" -CHOST="x86_64-pc-linux-gnu" - -USE="mmx sse sse2 -perl -python" -RUBY_TARGETS="ruby19 ruby20 ruby21 ruby22" - -GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/" -SYNC="rsync://mirror.bytemark.co.uk/gentoo-portage" -EMERGE_DEFAULT_OPTS="--color=n --nospinner" -#PORTDIR_OVERLAY="/vagrant/ruby-overlay" diff --git a/conf/provision.sh b/conf/provision.sh deleted file mode 100755 index b03b905..0000000 --- a/conf/provision.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -set -o errexit -o nounset -o pipefail -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -sudo emerge-webrsync -sudo emerge --metadata - -if [[ -f $SCRIPT_DIR/make.conf ]]; then - sudo cp "$SCRIPT_DIR/make.conf" /etc/portage/make.conf -else - sudo cp /vagrant/conf/make.conf /etc/portage/make.conf -fi - -RUBIES="dev-lang/ruby:1.9 dev-lang/ruby:2.0 dev-lang/ruby:2.1 dev-lang/ruby:2.2" -set +e -sudo emerge --pretend --quiet $RUBIES -if [[ $? == 1 ]]; then - sudo emerge --autounmask-write $RUBIES - sudo etc-update --automode -5 -fi -set -e -sudo emerge --noreplace --quiet $RUBIES diff --git a/repoman.sh b/repoman.sh deleted file mode 100755 index da0ee57..0000000 --- a/repoman.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash -set -o errexit -o nounset -o pipefail -[[ $(whoami) == 'root' ]] || exit 1 -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -function ENV_SETUP() { - rm -r "$SCRIPT_DIR/.git" || true - mkdir -p "$SCRIPT_DIR/overlay" - mkdir -p "$SCRIPT_DIR/repo-logs" -} - -function SETUP() { - mkdir -p "$SCRIPT_DIR/overlay/$CATEGORY/$NAME" - cp "/usr/portage/$CATEGORY/$NAME/$NAME-$VERSION.ebuild" "$SCRIPT_DIR/overlay/$CATEGORY/$NAME" - cp "/usr/portage/$CATEGORY/$NAME/metadata.xml" "$SCRIPT_DIR/overlay/$CATEGORY/$NAME" -} - -function REPOMAN() { - DATE=$(date +%s) - mkdir -p "$SCRIPT_DIR/repo-logs/$CATEGORY/$NAME-$VERSION/$DATE" - cd "$SCRIPT_DIR/overlay/$CATEGORY/$NAME" - repoman scan || true - repoman manifest - repoman --digest=y full > "$SCRIPT_DIR/repo-logs/$CATEGORY/$NAME-$VERSION/$DATE/current.txt" || true - sed -i -e "/^USE_RUBY/s/$CURR_TARGET/$CURR_TARGET $NEXT_TARGET/" "$NAME-$VERSION.ebuild" - repoman --digest=y full > "$SCRIPT_DIR/repo-logs/$CATEGORY/$NAME-$VERSION/$DATE/next.txt" || true -} - -function CLEANUP() { - rm "$SCRIPT_DIR/overlay/$CATEGORY/$NAME/$NAME-$VERSION.ebuild" - rm "$SCRIPT_DIR/overlay/$CATEGORY/$NAME/Manifest" - rm "$SCRIPT_DIR/overlay/$CATEGORY/$NAME/metadata.xml" - rm -r /usr/portage/distfiles/* -} - -ENV_SETUP -PACKAGES=("$@") -for PACKAGE in "${PACKAGES[@]}"; do - read -a PKG_ARR <<< "$PACKAGE" - CATEGORY="${PKG_ARR[0]}" - NAME="${PKG_ARR[1]}" - VERSION="${PKG_ARR[2]}" - CURR_TARGET="${PKG_ARR[3]}" - NEXT_TARGET="${PKG_ARR[4]}" - - SETUP - REPOMAN - CLEANUP -done diff --git a/tinder.sh b/tinder.sh deleted file mode 100755 index 63bbd96..0000000 --- a/tinder.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env bash -set -o errexit -o nounset -o pipefail -[[ $(whoami) == 'root' ]] || exit 1 -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -function ENV_SETUP() { - eselect news read --quiet all - eselect ruby set 1 - if [[ ! -d /etc/portage/env/ ]]; then - mkdir /etc/portage/env/ - fi - echo 'FEATURES="${FEATURES} test keepwork"' > /etc/portage/env/test - - if [[ ! -d $SCRIPT_DIR/ci-logs/ ]]; then - mkdir "$SCRIPT_DIR/ci-logs" - fi -} - -function SETUP () { - cp /var/lib/portage/world /var/lib/portage/world.original - echo "" > /etc/portage/package.accept_keywords - echo "=$PACKAGE doc" > /etc/portage/package.use - echo "=$PACKAGE test" > /etc/portage/package.env - - if [[ -e /usr/portage/packages/$PACKAGE.tbz2 ]]; then - rm "/usr/portage/packages/$PACKAGE.tbz2" - fi - - set +e - emerge --pretend --quiet "=$PACKAGE" - if [[ $? == 1 ]]; then - emerge --autounmask-write "=$PACKAGE" - etc-update --automode -5 - fi - set -e -} - -function EMERGE() { - set +e - timeout 1000 emerge --usepkg --buildpkg "=$PACKAGE" - LOG "$?" "$PACKAGE" - set -e -} - -function LOG() { - DATE=$(date +%s) - mkdir -p "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE" - emerge --info "=$PACKAGE" > "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE/emerge-info" - emerge -pqv "=$PACKAGE" > "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE/emerge-pqv" - cp "/var/tmp/portage/$PACKAGE/temp/build.log" "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE/build.log" - cp "/var/tmp/portage/$PACKAGE/temp/environment" "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE/environment" - gem list > "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE/gem-list" - if [[ $1 == 0 ]]; then - RESULT="\e[0;32mBUILD SUCCEEDED\e[0m" - touch "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE/succeeded" - elif [[ $1 == 1 ]]; then - RESULT="\e[0;31mBUILD FAILED\e[0m" - touch "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE/failed" - elif [[ $1 == 124 ]]; then - RESULT="\e[0;31mBUILD TIMED OUT\e[0m" - touch "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE/timedout" - else - RESULT="\e[0;31mBUILD UNKNOWN\e[0m" - touch "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE/unknown" - fi - chmod 755 -R "$SCRIPT_DIR/ci-logs/$PACKAGE/$DATE" -} - -function CLEANUP() { - mv /var/lib/portage/world.original /var/lib/portage/world - emerge --depclean --quiet - rm -r /var/tmp/portage/* || true -} - -ENV_SETUP -PACKAGES=("$@") -for PACKAGE in "${PACKAGES[@]}"; do - SETUP $PACKAGE - EMERGE $PACKAGE - CLEANUP - echo -e "$PACKAGE : $RESULT" -done diff --git a/web/.rubocop.yml b/web/.rubocop.yml index fee096c..49ef5a1 100644 --- a/web/.rubocop.yml +++ b/web/.rubocop.yml @@ -16,5 +16,7 @@ Style/IndentHash: Enabled: false Style/IndentationWidth: Enabled: false +Style/MultilineOperationIndentation: + EnforcedStyle: indented Style/Tab: Enabled: false -- cgit v1.2.3-65-gdbad From a3f5c572716a481b7dcc0f9dcc45179a5b00bc02 Mon Sep 17 00:00:00 2001 From: Peter Wilmott Date: Sat, 21 Mar 2015 19:14:59 +0000 Subject: Bring build scripts and web interface inline with 7266717147d In addition to brining the build scripts inline with 7266717147d7998b86386f3e73667f0460b2a57a this change also removes the "Passed / Passed" format from the repoman page. This is to bring it inline with the style of the builds page and prepare for the new layout of hypothetical packages. --- .gitignore | 1 + bin/repoman.sh | 6 --- bin/tinder.sh | 16 +++--- web/Rakefile | 41 ++++----------- web/app.rb | 74 +++++++++++++------------- web/db/migrations/018_new_targets.rb | 22 ++++++++ web/lib/ci.rb | 85 +++++++++++++++--------------- web/lib/models.rb | 4 ++ web/lib/packages.rb | 13 +++-- web/lib/repoman.rb | 99 ++++++++++++++--------------------- web/repo-logs/.gitignore | 2 - web/views/build/build_history.erb | 20 +++++++ web/views/build/build_logs.erb | 55 +++++++++++++++++++ web/views/build/build_status.erb | 45 ++++++++++++++++ web/views/build_history.erb | 24 --------- web/views/build_logs.erb | 55 ------------------- web/views/build_status.erb | 49 ----------------- web/views/layout.erb | 23 ++++---- web/views/new_keywords.erb | 4 -- web/views/new_targets.erb | 4 -- web/views/new_versions.erb | 4 -- web/views/outdated_gems.erb | 38 -------------- web/views/overview/visualizations.erb | 57 ++++++++++++++++++++ web/views/package/outdated_gems.erb | 38 ++++++++++++++ web/views/package/ruby_targets.erb | 48 +++++++++++++++++ web/views/repoman/repoman_checks.erb | 45 ++++++++++++++++ web/views/repoman/repoman_history.erb | 20 +++++++ web/views/repoman/repoman_logs.erb | 16 ++++++ web/views/repoman_checks.erb | 50 ------------------ web/views/repoman_history.erb | 25 --------- web/views/repoman_logs.erb | 31 ----------- web/views/ruby_targets.erb | 49 ----------------- web/views/visualizations.erb | 57 -------------------- 33 files changed, 528 insertions(+), 592 deletions(-) create mode 100644 web/db/migrations/018_new_targets.rb delete mode 100644 web/repo-logs/.gitignore create mode 100644 web/views/build/build_history.erb create mode 100644 web/views/build/build_logs.erb create mode 100644 web/views/build/build_status.erb delete mode 100644 web/views/build_history.erb delete mode 100644 web/views/build_logs.erb delete mode 100644 web/views/build_status.erb delete mode 100644 web/views/new_keywords.erb delete mode 100644 web/views/new_targets.erb delete mode 100644 web/views/new_versions.erb delete mode 100644 web/views/outdated_gems.erb create mode 100644 web/views/overview/visualizations.erb create mode 100644 web/views/package/outdated_gems.erb create mode 100644 web/views/package/ruby_targets.erb create mode 100644 web/views/repoman/repoman_checks.erb create mode 100644 web/views/repoman/repoman_history.erb create mode 100644 web/views/repoman/repoman_logs.erb delete mode 100644 web/views/repoman_checks.erb delete mode 100644 web/views/repoman_history.erb delete mode 100644 web/views/repoman_logs.erb delete mode 100644 web/views/ruby_targets.erb delete mode 100644 web/views/visualizations.erb diff --git a/.gitignore b/.gitignore index 9d733d0..89378b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ gentoo-x86/ ruby-overlay/ web/.bundle/ +web/old-logs/ diff --git a/bin/repoman.sh b/bin/repoman.sh index 060d48e..25d36b1 100755 --- a/bin/repoman.sh +++ b/bin/repoman.sh @@ -21,12 +21,10 @@ function REPOMAN() { repoman scan || true repoman manifest repoman full > /tmp/repoman_log_current || true - echo $? > /tmp/repoman_result_current sed -i -e "/^USE_RUBY/s/$CURR_TARGET/$CURR_TARGET $NEXT_TARGET/" "$NAME-$VERSION.ebuild" repoman manifest repoman full > /tmp/repoman_log_next || true - echo $? > /tmp/repoman_result_next LOG } @@ -38,18 +36,14 @@ function LOG() { mkdir -p "$SCRIPT_DIR/ci-logs/$SHA1/next_target/repomans/$DATE" cp /tmp/repoman_log_current "$SCRIPT_DIR/ci-logs/$SHA1/current_target/repomans/$DATE/repoman_log" - cp /tmp/repoman_result_current "$SCRIPT_DIR/ci-logs/$SHA1/current_target/repomans/$DATE/repoman_result" cp /tmp/repoman_log_next "$SCRIPT_DIR/ci-logs/$SHA1/next_target/repomans/$DATE/repoman_log" - cp /tmp/repoman_result_next "$SCRIPT_DIR/ci-logs/$SHA1/next_target/repomans/$DATE/repoman_result" chmod 755 -R "$SCRIPT_DIR/ci-logs" } function CLEANUP() { rm /tmp/repoman_log_current - rm /tmp/repoman_result_current rm /tmp/repoman_log_next - rm /tmp/repoman_result_next rm -r "$SCRIPT_DIR/overlay" } diff --git a/bin/tinder.sh b/bin/tinder.sh index eb6d383..4116fa8 100755 --- a/bin/tinder.sh +++ b/bin/tinder.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -o errexit -o nounset -o pipefail -[[ $(whoami) == 'root' ]] || exit 1 +[[ $(whoami) == "root" ]] || exit 1 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" function ENV_SETUP() { @@ -55,16 +55,16 @@ function LOG() { if [[ $1 == 0 ]]; then RESULT="\e[0;32mBUILD SUCCEEDED\e[0m" - touch "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/succeeded" + echo "succeeded" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/result" elif [[ $1 == 1 ]]; then RESULT="\e[0;31mBUILD FAILED\e[0m" - touch "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/failed" + echo "failed" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/result" elif [[ $1 == 124 ]]; then RESULT="\e[0;31mBUILD TIMED OUT\e[0m" - touch "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/timedout" + echo "timed out" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/result" else RESULT="\e[0;31mBUILD UNKNOWN\e[0m" - touch "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/unknown" + echo "unknown" > "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE/result" fi chmod 755 -R "$SCRIPT_DIR/ci-logs/$SHA1/$TYPE/builds/$DATE" @@ -82,20 +82,20 @@ ENV_SETUP PKG_ARR=($(qatom $1)) CATEGORY="${PKG_ARR[0]}" NAME="${PKG_ARR[1]}" -if [[ ${PKG_ARR[3]:=foo} == 'foo' ]]; then +if [[ ${PKG_ARR[3]:=foo} == "foo" ]]; then VERSION="${PKG_ARR[2]}" else VERSION="${PKG_ARR[2]}-${PKG_ARR[3]}" fi if [[ $# -eq 1 ]]; then - TYPE='current_target' + TYPE="current_target" PACKAGE=$1 SETUP EMERGE CLEANUP elif [[ $# -eq 3 ]]; then - TYPE='next_target' + TYPE="next_target" PACKAGE=$1 CURR_TARGET=$2 NEXT_TARGET=$3 diff --git a/web/Rakefile b/web/Rakefile index 7f52636..27525e0 100644 --- a/web/Rakefile +++ b/web/Rakefile @@ -7,17 +7,6 @@ task :test do Dir.glob('./test/test_*.rb') { |f| require f } end -desc 'Run : update_packages => run_ci_untested => update_ci => run_repoman => update_repoman' -task :nightly do - Rake::Task['db:update_packages'].invoke - Rake::Task['docker:setup'].invoke - Rake::Task['docker:run_ci_untested'].invoke - Rake::Task['db:update_ci'].invoke - Rake::Task['docker:run_repoman_all'].invoke - Rake::Task['db:update_repoman'].invoke - Rake::Task['docker:teardown'].invoke -end - namespace :db do DB.loggers << Logger.new($stdout) @@ -53,8 +42,11 @@ namespace :db do end namespace :docker do - num_of_packages = ENV['NUM_OF_PACKAGES'].to_i - num_of_packages = 5 if num_of_packages == 0 + num_of_packages = ENV['NUM_OF_PACKAGES'] + begin + num_of_packages = Integer(num_of_packages) + rescue + end desc 'Build a docker image to use with subsequent tasks' task :setup do @@ -84,28 +76,13 @@ namespace :docker do @volume_image.delete end - desc 'Build and test all packages' - task :run_ci_all do - run_ci(@volume_container, @ci_image, :all) - end - - desc 'Build and test a fixed number of packages (NUM_OF_PACKAGES=5)' - task :run_ci_some do + desc 'Build test packages ( NUM_OF_PACKAGES={5,all,untested} )' + task :run_build do run_ci(@volume_container, @ci_image, num_of_packages) end - desc 'Build and test all untested packages and their reverse dependencies' - task :run_ci_untested do - run_ci(@volume_container, @ci_image, :untested) - end - - desc 'QA test all packages' - task :run_repoman_all do - run_repoman(@ci_image, :all) - end - - desc 'QA test a fixed number of packages (NUM_OF_PACKAGES=5)' - task :run_repoman_some do + desc 'QA test packages ( NUM_OF_PACKAGES={5,all} )' + task :run_repoman do run_repoman(@ci_image, num_of_packages) end end diff --git a/web/app.rb b/web/app.rb index 6e578e1..04512e5 100644 --- a/web/app.rb +++ b/web/app.rb @@ -22,61 +22,61 @@ class RubyTinderbox < Sinatra::Base get '/ruby_targets' do update_timestamp = Package.first[:update_timestamp] portage_timestamp = Package.first[:portage_timestamp] - packages = Package.order { [category, lower(name), version, revision] }.to_hash_groups(:identifier) - erb :ruby_targets, locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } + packages = Package.distinct(:sha1, :identifier).order(:identifier) + erb :'package/ruby_targets', locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } end get '/outdated_gems' do update_timestamp = Package.first[:update_timestamp] portage_timestamp = Package.first[:portage_timestamp] packages = Package.distinct(:category, :name).order(:category, :name, Sequel.desc(:version), Sequel.desc(:revision)).exclude(gem_version: 'nil') - erb :outdated_gems, locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } + erb :'package/outdated_gems', locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } end get '/build_status' do - update_timestamp = Build.order(:time).last[:time] + update_timestamp = Build.order(:timestamp).last[:timestamp] portage_timestamp = Package.first[:portage_timestamp] - builds = Build.distinct(:package_id).order(:package_id, Sequel.desc(:time)) - erb :build_status, locals: { builds: builds, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } + builds = [] + Package.each do |package| + builds << package.build_dataset.where(target: 'current').reverse_order(:timestamp).first + end + builds = builds.compact.sort_by { |build| build.package[:identifier] } + erb :'build/build_status', locals: { builds: builds, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } end - get '/build_history/:category/:package' do - builds = Build.where(package_id: params[:category] + '/' + params[:package]).reverse_order(:time) - erb :build_history, locals: { builds: builds } + get '/build_logs/:sha1/:timestamp' do + package = Package.where(sha1: params[:sha1]).first + build = package.build_dataset.where(timestamp: params[:timestamp]).first + erb :'build/build_logs', locals: { package: package, build: build } end - get '/build_logs/:category/:package/:time' do - build = Build.where(package_id: params[:category] + '/' + params[:package], time: params[:time]).first - erb :build_logs, locals: { build: build } + get '/build_history/:sha1' do + package = Package.where(sha1: params[:sha1]).first + builds = package.build_dataset.where(target: 'current').reverse_order(:timestamp) + erb :'build/build_history', locals: { builds: builds } end get '/repoman_checks' do - update_timestamp = Repoman.order(:time).last[:time] + update_timestamp = Build.order(:timestamp).last[:timestamp] portage_timestamp = Package.first[:portage_timestamp] - repomans = Repoman.distinct(:package_id).order(:package_id, Sequel.desc(:time)) - erb :repoman_checks, locals: { repomans: repomans, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } + repomans = [] + Package.each do |package| + repomans << package.repoman_dataset.where(target: 'current').reverse_order(:timestamp).first + end + repomans = repomans.compact.sort_by { |repoman| repoman.package[:identifier] } + erb :'repoman/repoman_checks', locals: { repomans: repomans, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } end - get '/repoman_logs/:category/:package/:time' do - repomans = Repoman.where(package_id: params[:category] + '/' + params[:package], time: params[:time]).first - erb :repoman_logs, locals: { repomans: repomans } + get '/repoman_logs/:sha1/:timestamp' do + package = Package.where(sha1: params[:sha1]).first + repoman = package.repoman_dataset.where(timestamp: params[:timestamp]).first + erb :'repoman/repoman_logs', locals: { package: package, repoman: repoman } end - get '/repoman_history/:category/:package' do - repomans = Repoman.where(package_id: params[:category] + '/' + params[:package]).reverse_order(:time) - erb :repoman_history, locals: { repomans: repomans } - end - - get '/new_targets' do - erb :new_targets - end - - get '/new_versions' do - erb :new_versions - end - - get '/new_keywords' do - erb :new_keywords + get '/repoman_history/:sha1' do + package = Package.where(sha1: params[:sha1]).first + repomans = package.repoman_dataset.where(target: 'current').reverse_order(:timestamp) + erb :'repoman/repoman_history', locals: { repomans: repomans } end get '/visualizations' do @@ -101,11 +101,11 @@ class RubyTinderbox < Sinatra::Base Package.distinct(:category, :name).reverse_order(:category, :name, :version).exclude(gem_version: 'nil').each { |p| outdated << p if p[:version] < p[:gem_version] } # Build Status - succeeded = Build.distinct(:package_id).order(:package_id, Sequel.desc(:time)).where(result: 'succeeded').count - failed = Build.distinct(:package_id).order(:package_id, Sequel.desc(:time)).where(result: 'failed').count - timed_out = Build.distinct(:package_id).order(:package_id, Sequel.desc(:time)).where(result: 'timed out').count + succeeded = Build.distinct(:package_id).order(:package_id, Sequel.desc(:timestamp)).where(result: "succeeded\n").count + failed = Build.distinct(:package_id).order(:package_id, Sequel.desc(:timestamp)).where(result: "failed\n").count + timed_out = Build.distinct(:package_id).order(:package_id, Sequel.desc(:timestamp)).where(result: "timed out\n").count - erb :visualizations, locals: { + erb :'overview/visualizations', locals: { portage_timestamp: portage_timestamp, update_timestamp: update_timestamp, ruby_1_9_amd64: ruby_1_9_amd64, diff --git a/web/db/migrations/018_new_targets.rb b/web/db/migrations/018_new_targets.rb new file mode 100644 index 0000000..b04ccac --- /dev/null +++ b/web/db/migrations/018_new_targets.rb @@ -0,0 +1,22 @@ +Sequel.migration do + change do + add_column :packages, :sha1, String + add_column :builds, :target, String + add_column :repomans, :target, String + rename_column :builds, :time, :timestamp + rename_column :repomans, :time, :timestamp + rename_column :repomans, :current_result, :result + rename_column :repomans, :current_log, :log + drop_column :repomans, :next_result + drop_column :repomans, :next_log + drop_column :builds, :package_id + drop_column :repomans, :package_id + alter_table(:builds) do + add_foreign_key :package_id, :packages + end + alter_table(:repomans) do + add_foreign_key :package_id, :packages + end + end + +end diff --git a/web/lib/ci.rb b/web/lib/ci.rb index 3805b90..13e7ac0 100644 --- a/web/lib/ci.rb +++ b/web/lib/ci.rb @@ -1,22 +1,22 @@ def run_ci(volume_container, ci_image, num_of_packages) packages = [] - Package.order { [category, lower(name), version] }.each do |package| + Package.each do |package| packages << package[:identifier] end - if num_of_packages == :all + if num_of_packages == 'all' packages = packages - elsif num_of_packages == :untested + elsif num_of_packages == 'untested' packages = [] - Package.exclude(tested: true).order { [category, lower(name), version] }.each do |package| + Package.each do |package| + next if package.build.count > 0 + next if "#{package[:category]}/#{package[:name]}" == 'virtual/rubygems' + next if "#{package[:category]}/#{package[:name]}" == 'dev-ruby/rake' + next if "#{package[:category]}/#{package[:name]}" == 'dev-ruby/rspec' + next if "#{package[:category]}/#{package[:name]}" == 'dev-ruby/rspec-core' + next if "#{package[:category]}/#{package[:name]}" == 'dev-ruby/rdoc' + packages << package[:identifier] - next if [ - 'virtual/rubygems', - 'dev-ruby/rake', - 'dev-ruby/rspec', - 'dev-ruby/rspec-core', - 'dev-ruby/rdoc' - ].include?("#{package[:category]}/#{package[:name]}") Package.where(Sequel.like( :dependencies, "#{package[:category]}/#{package[:name]} %", @@ -26,8 +26,11 @@ def run_ci(volume_container, ci_image, num_of_packages) packages << rdep[:identifier] end end - else + elsif num_of_packages.is_a?(Integer) packages = packages.sample(num_of_packages) + else + puts 'ERROR: Invalid value for NUM_OF_PACKAGES' + exit end packages = packages.uniq @@ -54,37 +57,37 @@ def run_ci(volume_container, ci_image, num_of_packages) end def update_ci - Dir.glob('ci-logs/*/*/*') do |build| - build_array = build.split('/') - package_id = "#{build_array[1]}/#{build_array[2]}" - time = build_array[3] - - if File.exist?("#{build}/succeeded") - result = 'succeeded' - elsif File.exist?("#{build}/failed") - result = 'failed' - elsif File.exist?("#{build}/timedout") - result = 'timed out' - end + Dir.glob('ci-logs/*/*/builds/*') do |build| + begin + build_array = build.split('/') + sha1 = build_array[1] + timestamp = build_array[4] + target = build_array[2].sub('_target', '') - emerge_info = File.read("#{build}/emerge-info") if File.exist?("#{build}/emerge-info") - emerge_pqv = File.read("#{build}/emerge-pqv") if File.exist?("#{build}/emerge-pqv") - build_log = File.read("#{build}/build.log") if File.exist?("#{build}/build.log") - gem_list = File.read("#{build}/gem-list") if File.exist?("#{build}/gem-list") + result = File.read("#{build}/result") + emerge_info = File.read("#{build}/emerge-info") if File.exist?("#{build}/emerge-info") + emerge_pqv = File.read("#{build}/emerge-pqv") if File.exist?("#{build}/emerge-pqv") + build_log = File.read("#{build}/build.log") if File.exist?("#{build}/build.log") + gem_list = File.read("#{build}/gem-list") if File.exist?("#{build}/gem-list") - Build.find_or_create( - package_id: package_id, - time: time, - result: result, - emerge_info: emerge_info, - emerge_pqv: emerge_pqv, - build_log: build_log, - gem_list: gem_list - ) - end - - Build.each do |build| - Package.where(identifier: build[:package_id]).update(tested: true) + package = Package.where(sha1: sha1).first + unless package.nil? + package.add_build( + Build.find_or_create( + timestamp: timestamp, + target: target, + result: result, + emerge_info: emerge_info, + emerge_pqv: emerge_pqv, + build_log: build_log, + gem_list: gem_list + ) + ) + end + rescue => e + puts "ERROR: #{e}" + next + end end end diff --git a/web/lib/models.rb b/web/lib/models.rb index 667e54f..68e0127 100644 --- a/web/lib/models.rb +++ b/web/lib/models.rb @@ -1,10 +1,14 @@ DB = Sequel.connect(ENV['DATABASE_URL'], max_connections: 12, pool_timeout: 60) class Package < Sequel::Model + one_to_many :build + one_to_many :repoman end class Build < Sequel::Model + many_to_one :package end class Repoman < Sequel::Model(:repomans) + many_to_one :package end diff --git a/web/lib/packages.rb b/web/lib/packages.rb index e703b26..eb62883 100644 --- a/web/lib/packages.rb +++ b/web/lib/packages.rb @@ -5,21 +5,22 @@ def update_packages identifier = category + '/' + name + '-' + version + (revision == 'r0' ? '' : "-#{revision}") gem_version = Gems.info(name)['version'] gem_version = 'nil' if gem_version.nil? - # ebuild = "/usr/portage/#{category}/#{name}/#{identifier.split('/')[1]}.ebuild" - # ebuild_hash = Digest::MD5.hexdigest(File.read(ebuild)) + ebuild = "/usr/portage/#{category}/#{name}/#{identifier.split('/')[1]}.ebuild" + sha1 = Digest::SHA1.hexdigest(File.read(ebuild)) Package.find_or_create( + sha1: sha1, category: category, name: name, version: version, revision: revision, slot: slot, - amd64_keyword: amd64_keyword, identifier: identifier, - gem_version: gem_version, + amd64_keyword: amd64_keyword, r19_target: r19_target, r20_target: r20_target, r21_target: r21_target, - r22_target: r22_target + r22_target: r22_target, + gem_version: gem_version ) end @@ -27,6 +28,8 @@ def update_packages if packages_txt.include?("#{package[:category]} #{package[:name]} #{package[:version]} #{package[:revision]} #{package[:slot]} #{package[:amd64_keyword]} #{package[:r19_target]} #{package[:r20_target]} #{package[:r21_target]} #{package[:r22_target]}") package.update(dependencies: `python3 lib/deps.py #{package[:identifier]}`) else + package.build.map(&:delete) + package.repoman.map(&:delete) package.delete end end diff --git a/web/lib/repoman.rb b/web/lib/repoman.rb index 1185d2a..1a44177 100644 --- a/web/lib/repoman.rb +++ b/web/lib/repoman.rb @@ -1,6 +1,6 @@ def run_repoman(ci_image, num_of_packages) packages = [] - Package.order { [category, lower(name), version] }.each do |package| + Package.each do |package| target = '' target = package[:r19_target] unless package[:r19_target] == 'nil' target = package[:r20_target] unless package[:r20_target] == 'nil' @@ -14,24 +14,26 @@ def run_repoman(ci_image, num_of_packages) next_target = 'ruby22' if target == 'ruby21' next if next_target.empty? - category = package[:category] - name = package[:name] - version = package[:version] - revision = package[:revision] == 'r0' ? '' : "-#{package[:revision]}" - - packages << "#{category} #{name} #{version}#{revision} #{target} #{next_target}" + packages << "#{package[:identifier]} #{target} #{next_target}" end - if num_of_packages == :all + if num_of_packages == 'all' packages = packages - else + elsif num_of_packages.is_a?(Integer) packages = packages.sample(num_of_packages) + else + puts 'ERROR: Invalid value for NUM_OF_PACKAGES' + exit end packages = packages.uniq packages.peach(8) do |package| + package = package.split(' ') + identifier = package[0] + current_target = package[1] + next_target = package[2] ci_container = Docker::Container.create( - Cmd: %W[/ruby-tinderbox/repoman.sh #{package}], + Cmd: %W[/ruby-tinderbox/repoman.sh #{identifier} #{current_target} #{next_target}], Image: ci_image.id ) ci_container.start @@ -39,7 +41,7 @@ def run_repoman(ci_image, num_of_packages) tar = Tempfile.new('tar') File.open(tar, 'w') do |file| - ci_container.copy('/ruby-tinderbox/repo-logs') do |chunk| + ci_container.copy('/ruby-tinderbox/ci-logs') do |chunk| file.write(chunk) end end @@ -52,59 +54,34 @@ def run_repoman(ci_image, num_of_packages) end def update_repoman - Dir.glob('repo-logs/*/*/*') do |repoman| - repoman_array = repoman.split('/') - package_id = "#{repoman_array[1]}/#{repoman_array[2]}" - time = repoman_array[3] + Dir.glob('ci-logs/*/*/repomans/*') do |repoman| + begin + repoman_array = repoman.split('/') + sha1 = repoman_array[1] + timestamp = repoman_array[4] + target = repoman_array[2].sub('_target', '') - current_log = File.read("#{repoman}/current.txt") if File.exist?("#{repoman}/current.txt") - next_log = File.read("#{repoman}/next.txt") if File.exist?("#{repoman}/next.txt") + log = File.read("#{repoman}/repoman_log") - current_result = 'unknown' - if current_log.include?('If everyone were like you, I\'d be out of business!') - current_result = 'passed' - elsif current_log.include?('You\'re only giving me a partial QA payment?') - current_result = 'partial' - elsif current_log.include?('Make your QA payment on time and you\'ll never see the likes of me.') - current_result = 'failed' - end - - next_result = 'unknown' - if next_log.include?('If everyone were like you, I\'d be out of business!') - next_result = 'passed' - elsif next_log.include?('You\'re only giving me a partial QA payment?') - next_result = 'partial' - elsif next_log.include?('Make your QA payment on time and you\'ll never see the likes of me.') - next_result = 'failed' - end - - Repoman.find_or_create( - package_id: package_id, - time: time, - current_result: current_result, - current_log: current_log, - next_result: next_result, - next_log: next_log - ) - end - - Package.order { [category, lower(name), version] }.each do |package| - target = '' - target = package[:r19_target] unless package[:r19_target] == 'nil' - target = package[:r20_target] unless package[:r20_target] == 'nil' - target = package[:r21_target] unless package[:r21_target] == 'nil' - target = package[:r22_target] unless package[:r22_target] == 'nil' - if target.empty? - Repoman.where(package_id: package[:identifier]).delete - next - end + result = 'unknown' + if log.include?('If everyone were like you, I\'d be out of business!') + result = 'passed' + elsif log.include?('You\'re only giving me a partial QA payment?') + result = 'partial' + elsif log.include?('Make your QA payment on time and you\'ll never see the likes of me.') + result = 'failed' + end - next_target = '' - next_target = 'ruby20' if target == 'ruby19' - next_target = 'ruby21' if target == 'ruby20' - next_target = 'ruby22' if target == 'ruby21' - if next_target.empty? - Repoman.where(package_id: package[:identifier]).delete + Package.where(sha1: sha1).first.add_repoman( + Repoman.find_or_create( + timestamp: timestamp, + target: target, + result: result, + log: log + ) + ) + rescue => e + puts "ERROR: #{e}" next end end diff --git a/web/repo-logs/.gitignore b/web/repo-logs/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/web/repo-logs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/web/views/build/build_history.erb b/web/views/build/build_history.erb new file mode 100644 index 0000000..f6af24a --- /dev/null +++ b/web/views/build/build_history.erb @@ -0,0 +1,20 @@ +

    <%=builds.first.package[:identifier]%>

    + + + + + + + + + <%builds.each do |build|%> + + + + + <%end%> +
    Build DateBuild Result
    + <%=Time.at(build[:timestamp].to_i).strftime('%Y-%m-%d')%> + + <%=build[:result].camelcase%> +
    diff --git a/web/views/build/build_logs.erb b/web/views/build/build_logs.erb new file mode 100644 index 0000000..fb5bf3d --- /dev/null +++ b/web/views/build/build_logs.erb @@ -0,0 +1,55 @@ +
    +

    <%=package[:identifier]%>

    +

    <%=Time.at(build[:timestamp].to_i).strftime('%Y-%m-%d')%>

    + +
    +
    + +<%unless build[:emerge_info].nil?%> +
    + +
    +
    <%=build[:emerge_info]%>
    +
    +
    +<%end%> + +<%unless build[:emerge_pqv].nil?%> +
    + +
    +
    <%=build[:emerge_pqv]%>
    +
    +
    +<%end%> + +<%unless build[:build_log].nil?%> +
    +
    +

    Build Log

    +
    +
    +
    <%=build[:build_log]%>
    +
    +
    +<%end%> + +<%unless build[:gem_list].nil?%> +
    +
    +

    Gem List

    +
    +
    +
    <%=build[:gem_list]%>
    +
    +
    +<%end%> diff --git a/web/views/build/build_status.erb b/web/views/build/build_status.erb new file mode 100644 index 0000000..04ab1d8 --- /dev/null +++ b/web/views/build/build_status.erb @@ -0,0 +1,45 @@ +
    +

    Build Status (CI)

    + + Last updated on + <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%> + using a portage snapshot dated + <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%> + +
    + +
    + amd64 + ~amd64 +
    + + + + + + + + + + + <%builds.each do |build|%> + <%next if build.nil?%> + + + + + + + + <%end%> +
    PackageDateResultHistory
    + <%=build.package[:identifier]%> + + <%=Time.at(build[:timestamp].to_i).strftime('%Y-%m-%d')%> + + <%=build[:result].camelcase%> + + <%=build.package.build_dataset.where(target: 'current').count%> Build(s) + + +<%=build.package[:amd64_keyword]%> +
    diff --git a/web/views/build_history.erb b/web/views/build_history.erb deleted file mode 100644 index fde2445..0000000 --- a/web/views/build_history.erb +++ /dev/null @@ -1,24 +0,0 @@ -

    <%=builds.first[:package_id]%>

    - - - - - - - - - <%builds.each do |build|%> - <%next if build.nil?%> - <%result = 'success' if build[:result] == 'succeeded'%> - <%result = 'info' if build[:result] == 'timed out'%> - <%result = 'danger' if build[:result] == 'failed'%> - - - - - <%end%> -
    Build DateBuild Result
    - <%=Time.at(build[:time].to_i).strftime('%Y-%m-%d')%> - - <%=build[:result].camelcase%> -
    diff --git a/web/views/build_logs.erb b/web/views/build_logs.erb deleted file mode 100644 index 547b205..0000000 --- a/web/views/build_logs.erb +++ /dev/null @@ -1,55 +0,0 @@ -
    -

    <%=build[:package_id]%>

    -

    <%=Time.at(build[:time].to_i).strftime('%Y-%m-%d')%>

    - -
    -
    - -<%unless build[:emerge_info].nil?%> -
    - -
    -
    <%=build[:emerge_info]%>
    -
    -
    -<%end%> - -<%unless build[:emerge_pqv].nil?%> -
    - -
    -
    <%=build[:emerge_pqv]%>
    -
    -
    -<%end%> - -<%unless build[:build_log].nil?%> -
    -
    -

    Build Log

    -
    -
    -
    <%=build[:build_log]%>
    -
    -
    -<%end%> - -<%unless build[:gem_list].nil?%> -
    -
    -

    Gem List

    -
    -
    -
    <%=build[:gem_list]%>
    -
    -
    -<%end%> diff --git a/web/views/build_status.erb b/web/views/build_status.erb deleted file mode 100644 index 13d7434..0000000 --- a/web/views/build_status.erb +++ /dev/null @@ -1,49 +0,0 @@ -
    -

    Build Status (CI)

    - - Last updated on - <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%> - using a portage snapshot dated - <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%> - -
    - -
    - amd64 - ~amd64 -
    - - - - - - - - - - - <%builds.each do |build|%> - <%package = Package.where(identifier: build[:package_id]).first%> - <%next if package.nil?%> - <%result = 'success' if build[:result] == 'succeeded'%> - <%result = 'info' if build[:result] == 'timed out'%> - <%result = 'danger' if build[:result] == 'failed'%> - - - - - - - - <%end%> -
    PackageDateResultHistory
    - <%=build[:package_id]%> - - <%=Time.at(build[:time].to_i).strftime('%Y-%m-%d')%> - - <%=build[:result].camelcase%> - - <%=Build.where(package_id: build[:package_id]).count%> Build(s) - - +<%=package[:amd64_keyword]%> -
    diff --git a/web/views/layout.erb b/web/views/layout.erb index bf747d6..98d60ec 100644 --- a/web/views/layout.erb +++ b/web/views/layout.erb @@ -11,7 +11,7 @@ - + @@ -34,7 +34,7 @@
  • Packages
  • Overlays
  • -
  • Planet
  • +
  • Planet
  • Archives
  • Sources
  • @@ -67,13 +67,6 @@
  • Outdated Gems
  • Build Status (CI)
  • Repoman Checks (QA)
  • -
  • Visualizations
  • @@ -108,7 +101,17 @@ diff --git a/web/views/new_keywords.erb b/web/views/new_keywords.erb deleted file mode 100644 index 9f96c63..0000000 --- a/web/views/new_keywords.erb +++ /dev/null @@ -1,4 +0,0 @@ -
    -

    New Keywords

    -
    -

    This page is a work in progress

    diff --git a/web/views/new_targets.erb b/web/views/new_targets.erb deleted file mode 100644 index 8ae1218..0000000 --- a/web/views/new_targets.erb +++ /dev/null @@ -1,4 +0,0 @@ -
    -

    New Targets

    -
    -

    This page is a work in progress

    diff --git a/web/views/new_versions.erb b/web/views/new_versions.erb deleted file mode 100644 index 0477f38..0000000 --- a/web/views/new_versions.erb +++ /dev/null @@ -1,4 +0,0 @@ -
    -

    New Versions

    -
    -

    This page is a work in progress

    diff --git a/web/views/outdated_gems.erb b/web/views/outdated_gems.erb deleted file mode 100644 index fc298a9..0000000 --- a/web/views/outdated_gems.erb +++ /dev/null @@ -1,38 +0,0 @@ -
    -

    Outdated Gems

    - - Last updated on - <%=Time.at(packages.first[:update_timestamp].to_i).strftime('%Y-%m-%d')%> - using a portage snapshot dated - <%=Time.at(packages.first[:portage_timestamp].to_i).strftime('%Y-%m-%d')%> - -
    - -
    - amd64 - ~amd64 -
    - - - - - - - - - - <%packages.each do |package|%> - <%if package[:gem_version] > package[:version]%> - - - - - - - <%end%> - <%end%> -
    PackageGentoo VersionRubyGem Version
    - <%=package[:identifier]%> - <%=package[:version]%><%=package[:gem_version]%> - +<%=package[:amd64_keyword]%> -
    diff --git a/web/views/overview/visualizations.erb b/web/views/overview/visualizations.erb new file mode 100644 index 0000000..9b22e6e --- /dev/null +++ b/web/views/overview/visualizations.erb @@ -0,0 +1,57 @@ + + + + + + + +

    Visualizations

    + + Last updated on + <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%> + using a portage snapshot dated + <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%> + + +

    Number of Packages per Ruby Target

    + + + + + + + + + + + + +
    +
    +

    +
    + +

    Number of Outdated Gems

    + + + + + + +
    +
    +

    +
    + +

    Number of Packages per Build Result

    + + + + + + + +
    +
    +

    +
    diff --git a/web/views/package/outdated_gems.erb b/web/views/package/outdated_gems.erb new file mode 100644 index 0000000..fc298a9 --- /dev/null +++ b/web/views/package/outdated_gems.erb @@ -0,0 +1,38 @@ +
    +

    Outdated Gems

    + + Last updated on + <%=Time.at(packages.first[:update_timestamp].to_i).strftime('%Y-%m-%d')%> + using a portage snapshot dated + <%=Time.at(packages.first[:portage_timestamp].to_i).strftime('%Y-%m-%d')%> + +
    + +
    + amd64 + ~amd64 +
    + + + + + + + + + + <%packages.each do |package|%> + <%if package[:gem_version] > package[:version]%> + + + + + + + <%end%> + <%end%> +
    PackageGentoo VersionRubyGem Version
    + <%=package[:identifier]%> + <%=package[:version]%><%=package[:gem_version]%> + +<%=package[:amd64_keyword]%> +
    diff --git a/web/views/package/ruby_targets.erb b/web/views/package/ruby_targets.erb new file mode 100644 index 0000000..fcd54fc --- /dev/null +++ b/web/views/package/ruby_targets.erb @@ -0,0 +1,48 @@ +
    +

    Ruby Targets

    + + Last updated on + <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%> + using a portage snapshot dated + <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%> + +
    + +
    + amd64 + ~amd64 +
    + + + + + + + + + + + + <%packages.each do |package|%> + + + + + + + + + <%end%> +
    PackageRuby 1.9Ruby 2.0Ruby 2.1Ruby 2.2
    + <%=package[:identifier]%> + "> + <%=package[:r19_target]%> + "> + <%=package[:r20_target]%> + "> + <%=package[:r21_target]%> + "> + <%=package[:r22_target]%> + + +<%=package[:amd64_keyword]%> +
    diff --git a/web/views/repoman/repoman_checks.erb b/web/views/repoman/repoman_checks.erb new file mode 100644 index 0000000..a8ffc34 --- /dev/null +++ b/web/views/repoman/repoman_checks.erb @@ -0,0 +1,45 @@ +
    +

    Repoman Checks

    + + Last updated on + <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%> + using a portage snapshot dated + <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%> + +
    + +
    + amd64 + ~amd64 +
    + + + + + + + + + + + <%repomans.each do |repoman|%> + <%next if repoman.nil?%> + + + + + + + + <%end%> +
    PackageDateResultHistory
    + <%=repoman.package[:identifier]%> + + <%=Time.at(repoman[:timestamp].to_i).strftime('%Y-%m-%d')%> + + <%=repoman[:result].camelcase%> + + <%=repoman.package.repoman_dataset.where(target: 'current').count%> Checks(s) + + +<%=repoman.package[:amd64_keyword]%> +
    diff --git a/web/views/repoman/repoman_history.erb b/web/views/repoman/repoman_history.erb new file mode 100644 index 0000000..bc26cd8 --- /dev/null +++ b/web/views/repoman/repoman_history.erb @@ -0,0 +1,20 @@ +

    <%=repomans.first.package[:identifier]%>

    + + + + + + + + + <%repomans.each do |repoman|%> + + + + + <%end%> +
    Check DateCheck Result
    + <%=Time.at(repoman[:timestamp].to_i).strftime('%Y-%m-%d')%> + + <%=repoman[:result].camelcase%> +
    diff --git a/web/views/repoman/repoman_logs.erb b/web/views/repoman/repoman_logs.erb new file mode 100644 index 0000000..52faecc --- /dev/null +++ b/web/views/repoman/repoman_logs.erb @@ -0,0 +1,16 @@ +
    +

    <%=package[:identifier]%>

    +

    <%=Time.at(repoman[:timestamp].to_i).strftime('%Y-%m-%d')%>

    +
    +
    + +<%unless repoman[:log].nil?%> +
    + +
    +
    <%=repoman[:log]%>
    +
    +
    +<%end%> diff --git a/web/views/repoman_checks.erb b/web/views/repoman_checks.erb deleted file mode 100644 index 01de59d..0000000 --- a/web/views/repoman_checks.erb +++ /dev/null @@ -1,50 +0,0 @@ -
    -

    Repoman Checks

    - - Last updated on - <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%> - using a portage snapshot dated - <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%> - -
    - -
    - amd64 - ~amd64 -
    - - - - - - - - - - - <%repomans.each do |repoman|%> - <%package = Package.where(identifier: repoman[:package_id]).first%> - <%next if package.nil?%> - <%result = 'info'%> - <%result = 'success' if repoman[:next_result] == 'passed'%> - <%result = 'danger' if repoman[:current_result] == 'failed'%> - <%result = 'danger' if repoman[:current_result] == 'partial'%> - - - - - - - - <%end%> -
    PackageDateResultHistory
    - <%=repoman[:package_id]%> - - <%=Time.at(repoman[:time].to_i).strftime('%Y-%m-%d')%> - - <%=repoman[:current_result].camelcase%> / <%=repoman[:next_result].camelcase%> - - <%=Repoman.where(package_id: repoman[:package_id]).count%> Check(s) - - +<%=package[:amd64_keyword]%> -
    diff --git a/web/views/repoman_history.erb b/web/views/repoman_history.erb deleted file mode 100644 index 50c8a65..0000000 --- a/web/views/repoman_history.erb +++ /dev/null @@ -1,25 +0,0 @@ -

    <%=repomans.first[:package_id]%>

    - - - - - - - - - <%repomans.each do |repoman|%> - <%next if repoman.nil?%> - <%result = 'info'%> - <%result = 'success' if repoman[:next_result] == 'passed'%> - <%result = 'danger' if repoman[:current_result] == 'failed'%> - <%result = 'danger' if repoman[:current_result] == 'partial'%> - - - - - <%end%> -
    Check DateCheck Result
    - <%=Time.at(repoman[:time].to_i).strftime('%Y-%m-%d')%> - - <%=repoman[:current_result].camelcase%> / <%=repoman[:next_result].camelcase%> -
    diff --git a/web/views/repoman_logs.erb b/web/views/repoman_logs.erb deleted file mode 100644 index 544db7a..0000000 --- a/web/views/repoman_logs.erb +++ /dev/null @@ -1,31 +0,0 @@ -
    -

    <%=repomans[:package_id]%>

    -

    <%=Time.at(repomans[:time].to_i).strftime('%Y-%m-%d')%>

    - -
    -
    - -<%unless repomans[:current_log].nil?%> -
    - -
    -
    <%=repomans[:current_log]%>
    -
    -
    -<%end%> - -<%unless repomans[:next_log].nil?%> -
    - -
    -
    <%=repomans[:next_log]%>
    -
    -
    -<%end%> diff --git a/web/views/ruby_targets.erb b/web/views/ruby_targets.erb deleted file mode 100644 index 5db7a13..0000000 --- a/web/views/ruby_targets.erb +++ /dev/null @@ -1,49 +0,0 @@ -
    -

    Ruby Targets

    - - Last updated on - <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%> - using a portage snapshot dated - <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%> - -
    - -
    - amd64 - ~amd64 -
    - - - - - - - - - - - - <%packages.each do |package|%> - <%package = package[1][0]%> - - - - - - - - - <%end%> -
    PackageRuby 1.9Ruby 2.0Ruby 2.1Ruby 2.2
    - <%=package[:identifier]%> - "> - <%=package[:r19_target]%> - "> - <%=package[:r20_target]%> - "> - <%=package[:r21_target]%> - "> - <%=package[:r22_target]%> - - +<%=package[:amd64_keyword]%> -
    diff --git a/web/views/visualizations.erb b/web/views/visualizations.erb deleted file mode 100644 index 9b22e6e..0000000 --- a/web/views/visualizations.erb +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - -

    Visualizations

    - - Last updated on - <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%> - using a portage snapshot dated - <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%> - - -

    Number of Packages per Ruby Target

    - - - - - - - - - - - - -
    -
    -

    -
    - -

    Number of Outdated Gems

    - - - - - - -
    -
    -

    -
    - -

    Number of Packages per Build Result

    - - - - - - - -
    -
    -

    -
    -- cgit v1.2.3-65-gdbad From 955a30eadc1ae4423fef439f0c4197855a013179 Mon Sep 17 00:00:00 2001 From: Peter Wilmott Date: Sun, 22 Mar 2015 21:44:06 +0000 Subject: Ensure package.* are files not directories; Sync portage after setting the correct mirrors --- bin/provision.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/provision.sh b/bin/provision.sh index 7cc5510..cc4f726 100755 --- a/bin/provision.sh +++ b/bin/provision.sh @@ -2,16 +2,23 @@ set -o errexit -o nounset -o pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cp "$SCRIPT_DIR/make.conf" /etc/portage/make.conf +if [[ -d /etc/portage/package.accept_keywords/ ]]; then + rm -r /etc/portage/package.accept_keywords/ +fi +if [[ -d /etc/portage/package.use/ ]]; then + rm -r /etc/portage/package.use/ +fi + emerge-webrsync emerge --metadata -cp "$SCRIPT_DIR/make.conf" /etc/portage/make.conf RUBIES="dev-lang/ruby:1.9 dev-lang/ruby:2.0 dev-lang/ruby:2.1 dev-lang/ruby:2.2" set +e emerge --pretend --quiet $RUBIES if [[ $? == 1 ]]; then - emerge --autounmask-write $RUBIES - etc-update --automode -5 + emerge --autounmask-write $RUBIES + etc-update --automode -5 fi set -e emerge --noreplace --quiet $RUBIES -- cgit v1.2.3-65-gdbad From 1a16003a9d6bd2656a53a226c817bf00d17a11e7 Mon Sep 17 00:00:00 2001 From: Peter Wilmott Date: Sun, 22 Mar 2015 21:44:24 +0000 Subject: Add new_targets page --- web/app.rb | 20 +++++++++++++++++ web/views/bumps/new_targets.erb | 48 +++++++++++++++++++++++++++++++++++++++++ web/views/layout.erb | 8 +++++-- 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 web/views/bumps/new_targets.erb diff --git a/web/app.rb b/web/app.rb index 04512e5..f6024ad 100644 --- a/web/app.rb +++ b/web/app.rb @@ -79,6 +79,26 @@ class RubyTinderbox < Sinatra::Base erb :'repoman/repoman_history', locals: { repomans: repomans } end + get '/new_targets' do + update_timestamp = Package.first[:update_timestamp] + portage_timestamp = Package.first[:portage_timestamp] + packages = [] + Package.each do |package| + build_current = package.build_dataset.where(target: 'current').reverse_order(:timestamp).first + repoman_current = package.repoman_dataset.where(target: 'current').reverse_order(:timestamp).first + repoman_next = package.repoman_dataset.where(target: 'next').reverse_order(:timestamp).first + + next if build_current.nil? + next if repoman_current.nil? + next if repoman_next.nil? + + if repoman_current[:result] == 'passed' and repoman_next[:result] == 'passed' + packages << [package, build_current, nil, repoman_current, repoman_next] + end + end + erb :'bumps/new_targets', locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } + end + get '/visualizations' do # Timestamps update_timestamp = Package.first[:update_timestamp] diff --git a/web/views/bumps/new_targets.erb b/web/views/bumps/new_targets.erb new file mode 100644 index 0000000..4ecc565 --- /dev/null +++ b/web/views/bumps/new_targets.erb @@ -0,0 +1,48 @@ +
    +

    New Targets

    + + Last updated on + <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%> + using a portage snapshot dated + <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%> + +
    + +
    + amd64 + ~amd64 +
    + + + + + + + + + + + + <%packages.each do |package|%> + + + + + + + + + <%end%> +
    PackageCI CurrentCI NextQA CurrentQA Next
    + <%=package[0][:identifier]%> + + <%=package[1][:result].camelcase%> + + ToDo + + <%=package[3][:result].camelcase%> + + <%=package[4][:result].camelcase%> + + +<%=package[0][:amd64_keyword]%> +
    diff --git a/web/views/layout.erb b/web/views/layout.erb index 98d60ec..9d564b3 100644 --- a/web/views/layout.erb +++ b/web/views/layout.erb @@ -67,9 +67,13 @@
  • Outdated Gems
  • Build Status (CI)
  • Repoman Checks (QA)
  • -
  • Visualizations
  • + - +
  • Visualizations
  • -- cgit v1.2.3-65-gdbad From a724ee5141bd161cd768dc2d5e8d8f11b29fd09d Mon Sep 17 00:00:00 2001 From: Peter Wilmott Date: Sun, 22 Mar 2015 21:48:43 +0000 Subject: Exit early if one factor is nil, force the ordering of packages --- web/app.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/app.rb b/web/app.rb index f6024ad..661d0dd 100644 --- a/web/app.rb +++ b/web/app.rb @@ -85,17 +85,19 @@ class RubyTinderbox < Sinatra::Base packages = [] Package.each do |package| build_current = package.build_dataset.where(target: 'current').reverse_order(:timestamp).first - repoman_current = package.repoman_dataset.where(target: 'current').reverse_order(:timestamp).first - repoman_next = package.repoman_dataset.where(target: 'next').reverse_order(:timestamp).first - next if build_current.nil? + + repoman_current = package.repoman_dataset.where(target: 'current').reverse_order(:timestamp).first next if repoman_current.nil? + + repoman_next = package.repoman_dataset.where(target: 'next').reverse_order(:timestamp).first next if repoman_next.nil? if repoman_current[:result] == 'passed' and repoman_next[:result] == 'passed' packages << [package, build_current, nil, repoman_current, repoman_next] end end + packages = packages.compact.sort_by { |package| package[0][:identifier] } erb :'bumps/new_targets', locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp } end -- cgit v1.2.3-65-gdbad