← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/unify-pre-app-errors into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/unify-pre-app-errors into lp:launchpad.

Commit message:
Unify the styling of early fatal errors (haproxy and apache errors now match DB connection errors). OOPSes and app timeouts still use their own template, but they're a very different situation.

Requested reviews:
  William Grant (wgrant): code
Related bugs:
  Bug #1277075 in Launchpad itself: "Inconsistent "Oops!", "Uh oh!", and "Please try again" error pages"
  https://bugs.launchpad.net/launchpad/+bug/1277075

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/unify-pre-app-errors/+merge/241855

Unify the styling of early fatal errors (haproxy and apache errors now match DB connection errors). OOPSes and app timeouts still use their own template, but they're a very different situation.
-- 
https://code.launchpad.net/~wgrant/launchpad/unify-pre-app-errors/+merge/241855
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== added file 'lib/canonical/launchpad/icing/basic-error.css'
--- lib/canonical/launchpad/icing/basic-error.css	1970-01-01 00:00:00 +0000
+++ lib/canonical/launchpad/icing/basic-error.css	2014-11-15 01:56:13 +0000
@@ -0,0 +1,85 @@
+/* Basic styling for fatal error pages (not timeouts or OOPSes).
+ *
+ * Used by lib/canonical/launchpad/offline*.html and
+ * lib/lp/app/templates/launchpad-databaseunavailable.pt.
+ */
+html {
+    background: #fff;
+    margin: 0;
+    padding: 0;
+    }
+
+body {
+    font-family: Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
+    font-size: 0.75em;
+    line-height: 1.3em;
+    color: #000;
+    margin: 0 0 40px 0;
+    }
+
+a {
+    color: #03a;
+    text-decoration: none;
+    }
+
+h1 {
+    font-size: 3.7em;
+    }
+
+h2 {
+    font-size: 1.4em;
+    font-weight: normal;
+    margin: 0;
+    color: #333;
+    }
+
+p.sub {
+    color: #333;
+    }
+
+a img {
+    vertical-align: middle;
+    }
+
+.page-center-wrap {
+    text-align: left;
+    }
+
+.page-center {
+    text-align: center;
+    margin: 0px;
+    margin: auto;
+    width: 780px;
+    }
+
+.page-center-content {
+    text-align: left;
+    }
+
+#header,
+#footer {
+    padding-left: 50px;
+    padding-right: 50px;
+    }
+
+#header {
+    border: 1px solid #d7d3cf;
+    padding-top: 20px;
+    padding-bottom: 20px;
+    margin-top: 50px;
+    }
+
+#header .graphic {
+    font-size: 110px;
+    color: #646464;
+    float: right;
+    padding: 100px 80px 0 0;
+    }
+
+#header .content {
+    margin-right: 300px;
+    }
+
+#footer {
+    margin-top: 30px;
+    }

=== modified file 'lib/canonical/launchpad/offline-maintenance-haproxy.html'
--- lib/canonical/launchpad/offline-maintenance-haproxy.html	2014-04-01 20:07:26 +0000
+++ lib/canonical/launchpad/offline-maintenance-haproxy.html	2014-11-15 01:56:13 +0000
@@ -2,39 +2,49 @@
 Content-Type: text/html
 
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-  <head>
-    <title>Launchpad is offline for maintenance</title>
-    <style type="text/css" media="screen, print">
-      html, body {
-        font-family: Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
-        }
-      .offline {
-        max-width: 60em;
-        text-align: center;
-        margin-left: auto;
-        margin-right: auto;
-        }
-    </style>
-  </head>
-  <body>
-    <div class="offline">
-        <!-- Before editing, please see
-             https://bugs.launchpad.net/bugs/475371, especially comment #2,
-             for details on this file. In particular, please maintain the
-             \r\n line endings, at least for the HTTP header lines. -->
-        <h1>Sorry</h1>
-        <p>
-          Launchpad is offline for scheduled maintenance.
-          We should be back soon.
-        </p>
-        <p>
-          You can find more information on the
-          <a href="http://identi.ca/launchpadstatus";>Launchpad system status
-          </a> page.
-        </p>
-        <p>Thanks for your patience.</p>
-
+<html
+  xmlns="http://www.w3.org/1999/xhtml";
+  xml:lang="en"
+  lang="en"
+>
+<head>
+  <title>Launchpad is offline for maintenance</title>
+  <link
+    type="text/css" rel="stylesheet" media="screen, print"
+    href="/+icing/basic-error.css" />
+</head>
+<body>
+  <div class="page-center-wrap">
+    <div class="page-center">
+      <div class="page-center-content">
+        <div id="header">
+          <div class="graphic">
+            :(
+          </div>
+          <div class="content">
+            <!-- Before editing, please see
+                https://bugs.launchpad.net/bugs/475371, especially comment #2,
+                for details on this file. In particular, please maintain the
+                \r\n line endings, at least for the HTTP header lines. -->
+            <h1>Uh oh!</h1>
+            <h2>Launchpad is offline for scheduled maintenance.</h2>
+            <p>
+              We'll be back soon. Check
+              <a href="https://twitter.com/launchpadstatus";>@launchpadstatus</a>
+              on Twitter for updates.
+            </p>
+            <p><a href="javascript:window.location.reload()">Reload</a>
+              this page or try again in a few minutes</p>
+          </div>
+        </div>
+        <div id="footer">
+          <a href="https://launchpad.net/";>
+            <img src="/@@/launchpad-logo-and-name-hierarchy.png"
+            alt="Launchpad" />
+          </a>
+        </div>
+      </div>
     </div>
-  </body>
+  </div>
+</body>
 </html>

=== modified file 'lib/canonical/launchpad/offline-maintenance.html'
--- lib/canonical/launchpad/offline-maintenance.html	2014-04-01 20:07:26 +0000
+++ lib/canonical/launchpad/offline-maintenance.html	2014-11-15 01:56:13 +0000
@@ -1,36 +1,43 @@
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-  <head>
-    <title>Launchpad is offline for maintenance</title>
-    <style type="text/css" media="screen, print">
-      html, body {
-        font-family: Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
-        }
-      .offline {
-        max-width: 60em;
-        text-align: center;
-        margin-left: auto;
-        margin-right: auto;
-        }
-    </style>
-  </head>
-  <body>
-    <div id="topline"></div>
-    <div id="locationbar"></div>
-    <div class="offline">
-
-        <h1>Sorry</h1>
-        <p>
-          Launchpad is offline for scheduled maintenance.
-          We should be back soon.
-        </p>
-        <p>
-          You can find more information on the
-          <a href="http://identi.ca/launchpadstatus";>Launchpad system status
-          </a> page.
-        </p>
-        <p>Thanks for your patience.</p>
-
+<html
+  xmlns="http://www.w3.org/1999/xhtml";
+  xml:lang="en"
+  lang="en"
+>
+<head>
+  <title>Launchpad is offline for maintenance</title>
+  <link
+    type="text/css" rel="stylesheet" media="screen, print"
+    href="/+icing/basic-error.css" />
+</head>
+<body>
+  <div class="page-center-wrap">
+    <div class="page-center">
+      <div class="page-center-content">
+        <div id="header">
+          <div class="graphic">
+            :(
+          </div>
+          <div class="content">
+            <h1>Uh oh!</h1>
+            <h2>Launchpad is offline for scheduled maintenance.</h2>
+            <p>
+              We'll be back soon. Check
+              <a href="https://twitter.com/launchpadstatus";>@launchpadstatus</a>
+              on Twitter for updates.
+            </p>
+            <p><a href="javascript:window.location.reload()">Reload</a>
+              this page or try again in a few minutes</p>
+          </div>
+        </div>
+        <div id="footer">
+          <a href="https://launchpad.net/";>
+            <img src="/@@/launchpad-logo-and-name-hierarchy.png"
+            alt="Launchpad" />
+          </a>
+        </div>
+      </div>
     </div>
-  </body>
+  </div>
+</body>
 </html>

=== modified file 'lib/canonical/launchpad/offline-staging-code-update.html'
--- lib/canonical/launchpad/offline-staging-code-update.html	2014-05-21 09:16:28 +0000
+++ lib/canonical/launchpad/offline-staging-code-update.html	2014-11-15 01:56:13 +0000
@@ -1,36 +1,46 @@
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-  <head>
-    <title>Please try again</title>
-    <style type="text/css" media="screen, print">
-      html, body {
-        font-family: Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
-        }
-      .offline {
-        max-width: 60em;
-        text-align: center;
-        margin-left: auto;
-        margin-right: auto;
-        }
-    </style>
-  </head>
-  <body>
-    <div id="topline"></div>
-    <div id="locationbar"></div>
-    <div class="offline">
-
-        <h1>Code Update In Progress</h1>
-        <p>
-          Sorry, there was a problem connecting to the Launchpad server.
-        </p>
-        <p>
-          The staging server is currently getting a code update.
-          If the situation persists, let us know in
-          <a href="irc://chat.freenode.net/#launchpad"
-          >the #launchpad IRC channel on freenode</a>.
-        </p>
-        <p>Thanks for your patience.</p>
-
+<html
+  xmlns="http://www.w3.org/1999/xhtml";
+  xml:lang="en"
+  lang="en"
+>
+<head>
+  <title>Launchpad staging is updating</title>
+  <link
+    type="text/css" rel="stylesheet" media="screen, print"
+    href="/+icing/basic-error.css" />
+</head>
+<body>
+  <div class="page-center-wrap">
+    <div class="page-center">
+      <div class="page-center-content">
+        <div id="header">
+          <div class="graphic">
+            :(
+          </div>
+          <div class="content">
+            <h1>Uh oh!</h1>
+            <h2>Staging is offline for a code update.</h2>
+            <p>
+              Launchpad staging will be back in a few minutes.
+            </p>
+            <p>
+              If the problem persists, let us know in
+              <a href="irc://chat.freenode.net/#launchpad"
+              >the #launchpad IRC channel on freenode</a>.
+            </p>
+            <p><a href="javascript:window.location.reload()">Reload</a>
+              this page or try again in a few minutes</p>
+          </div>
+        </div>
+        <div id="footer">
+          <a href="https://launchpad.net/";>
+            <img src="/@@/launchpad-logo-and-name-hierarchy.png"
+            alt="Launchpad" />
+          </a>
+        </div>
+      </div>
     </div>
-  </body>
+  </div>
+</body>
 </html>

=== modified file 'lib/canonical/launchpad/offline-staging-db-update.html'
--- lib/canonical/launchpad/offline-staging-db-update.html	2014-05-21 09:16:28 +0000
+++ lib/canonical/launchpad/offline-staging-db-update.html	2014-11-15 01:56:13 +0000
@@ -1,36 +1,46 @@
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-  <head>
-    <title>Please try again</title>
-    <style type="text/css" media="screen, print">
-      html, body {
-        font-family: Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
-        }
-      .offline {
-        max-width: 60em;
-        text-align: center;
-        margin-left: auto;
-        margin-right: auto;
-        }
-    </style>
-  </head>
-  <body>
-    <div id="topline"></div>
-    <div id="locationbar"></div>
-    <div class="offline">
-
-        <h1>Database and Code Update</h1>
-        <p>
-          Sorry, there was a problem connecting to the Launchpad server.
-        </p>
-        <p>
-          The staging server is currently getting a code and db update.
-          If the situation persists, let us know in
-          <a href="irc://chat.freenode.net/#launchpad"
-          >the #launchpad IRC channel on freenode</a>.
-        </p>
-        <p>Thanks for your patience.</p>
-
+<html
+  xmlns="http://www.w3.org/1999/xhtml";
+  xml:lang="en"
+  lang="en"
+>
+<head>
+  <title>Launchpad staging is updating</title>
+  <link
+    type="text/css" rel="stylesheet" media="screen, print"
+    href="/+icing/basic-error.css" />
+</head>
+<body>
+  <div class="page-center-wrap">
+    <div class="page-center">
+      <div class="page-center-content">
+        <div id="header">
+          <div class="graphic">
+            :(
+          </div>
+          <div class="content">
+            <h1>Uh oh!</h1>
+            <h2>Staging is offline for a database update.</h2>
+            <p>
+              Launchpad staging will be back in the next couple of days.
+            </p>
+            <p>
+              If the problem persists, let us know in
+              <a href="irc://chat.freenode.net/#launchpad"
+              >the #launchpad IRC channel on freenode</a>.
+            </p>
+            <p><a href="javascript:window.location.reload()">Reload</a>
+              this page or try again in a few minutes</p>
+          </div>
+        </div>
+        <div id="footer">
+          <a href="https://launchpad.net/";>
+            <img src="/@@/launchpad-logo-and-name-hierarchy.png"
+            alt="Launchpad" />
+          </a>
+        </div>
+      </div>
     </div>
-  </body>
+  </div>
+</body>
 </html>

=== modified file 'lib/canonical/launchpad/offline-unplanned-haproxy.html'
--- lib/canonical/launchpad/offline-unplanned-haproxy.html	2014-05-21 09:16:28 +0000
+++ lib/canonical/launchpad/offline-unplanned-haproxy.html	2014-11-15 01:56:13 +0000
@@ -2,39 +2,60 @@
 Content-Type: text/html
 
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-  <head>
-    <title>Please try again</title>
-    <style type="text/css" media="screen, print">
-      html, body {
-        font-family: Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
-        }
-      .offline {
-        max-width: 60em;
-        text-align: center;
-        margin-left: auto;
-        margin-right: auto;
-        }
-    </style>
-  </head>
-  <body>
-    <div class="offline">
-        <!-- Before editing, please see
-             https://bugs.launchpad.net/bugs/475371, especially comment #2,
-             for details on this file. In particular, please maintain the
-             \r\n line endings, at least for the HTTP header lines. -->
-        <h1>Please try again</h1>
-        <p>
-          Sorry, there was a problem connecting to the Launchpad server.
-        </p>
-        <p>
-          Try reloading this page in a minute or two.
-          If the problem persists, let us know in
-          <a href="irc://chat.freenode.net/#launchpad"
-          >the #launchpad IRC channel on freenode</a>.
-        </p>
-        <p>Thanks for your patience.</p>
-
+<html
+  xmlns="http://www.w3.org/1999/xhtml";
+  xml:lang="en"
+  lang="en"
+>
+<head>
+  <title>Launchpad is temporarily unavailable</title>
+  <link
+    type="text/css" rel="stylesheet" media="screen, print"
+    href="/+icing/basic-error.css" />
+</head>
+<body>
+  <div class="page-center-wrap">
+    <div class="page-center">
+      <div class="page-center-content">
+        <div id="header">
+          <div class="graphic">
+            :(
+          </div>
+          <div class="content">
+            <!-- Before editing, please see
+                https://bugs.launchpad.net/bugs/475371, especially comment #2,
+                for details on this file. In particular, please maintain the
+                \r\n line endings, at least for the HTTP header lines. -->
+            <h1>Uh oh!</h1>
+            <h2>Something has gone wrong. We're sorry!</h2>
+            <p>
+              If we are in the middle of an update, Launchpad will be
+              back in a couple of minutes.  Otherwise, we are working to
+              fix the unexpected problems. Check
+              <a href="https://twitter.com/launchpadstatus";>@launchpadstatus</a>
+              on Twitter for updates.
+            </p>
+            <p>
+              If the problem persists, let us know in
+              <a href="irc://chat.freenode.net/#launchpad"
+              >the #launchpad IRC channel on freenode</a>.
+            </p>
+            <p class="sub">
+              Technically, the load balancer took too long to connect to
+              an application server.
+            </p>
+            <p><a href="javascript:window.location.reload()">Reload</a>
+              this page or try again in a few minutes</p>
+          </div>
+        </div>
+        <div id="footer">
+          <a href="https://launchpad.net/";>
+            <img src="/@@/launchpad-logo-and-name-hierarchy.png"
+            alt="Launchpad" />
+          </a>
+        </div>
+      </div>
     </div>
-  </body>
+  </div>
+</body>
 </html>

=== modified file 'lib/canonical/launchpad/offline-unplanned.html'
--- lib/canonical/launchpad/offline-unplanned.html	2014-05-21 09:16:28 +0000
+++ lib/canonical/launchpad/offline-unplanned.html	2014-11-15 01:56:13 +0000
@@ -1,36 +1,54 @@
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-  <head>
-    <title>Please try again</title>
-    <style type="text/css" media="screen, print">
-      html, body {
-        font-family: Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
-        }
-      .offline {
-        max-width: 60em;
-        text-align: center;
-        margin-left: auto;
-        margin-right: auto;
-        }
-    </style>
-  </head>
-  <body>
-    <div id="topline"></div>
-    <div id="locationbar"></div>
-    <div class="offline">
-
-        <h1>Please try again</h1>
-        <p>
-          Sorry, there was a problem connecting to the Launchpad server.
-        </p>
-        <p>
-          Try reloading this page in a minute or two.
-          If the problem persists, let us know in
-          <a href="irc://chat.freenode.net/#launchpad"
-          >the #launchpad IRC channel on freenode</a>.
-        </p>
-        <p>Thanks for your patience.</p>
-
+<html
+  xmlns="http://www.w3.org/1999/xhtml";
+  xml:lang="en"
+  lang="en"
+>
+<head>
+  <title>Launchpad is temporarily unavailable</title>
+  <link
+    type="text/css" rel="stylesheet" media="screen, print"
+    href="/+icing/basic-error.css" />
+</head>
+<body>
+  <div class="page-center-wrap">
+    <div class="page-center">
+      <div class="page-center-content">
+        <div id="header">
+          <div class="graphic">
+            :(
+          </div>
+          <div class="content">
+            <h1>Uh oh!</h1>
+            <h2>Something has gone wrong. We're sorry!</h2>
+            <p>
+              If we are in the middle of an update, Launchpad will be
+              back in a couple of minutes.  Otherwise, we are working to
+              fix the unexpected problems. Check
+              <a href="https://twitter.com/launchpadstatus";>@launchpadstatus</a>
+              on Twitter for updates.
+            </p>
+            <p>
+              If the problem persists, let us know in
+              <a href="irc://chat.freenode.net/#launchpad"
+              >the #launchpad IRC channel on freenode</a>.
+            </p>
+            <p class="sub">
+              Technically, the load balancer took too long to connect to
+              an application server.
+            </p>
+            <p><a href="javascript:window.location.reload()">Reload</a>
+              this page or try again in a few minutes</p>
+          </div>
+        </div>
+        <div id="footer">
+          <a href="https://launchpad.net/";>
+            <img src="/@@/launchpad-logo-and-name-hierarchy.png"
+            alt="Launchpad" />
+          </a>
+        </div>
+      </div>
     </div>
-  </body>
+  </div>
+</body>
 </html>

=== modified file 'lib/lp/app/templates/launchpad-databaseunavailable.pt'
--- lib/lp/app/templates/launchpad-databaseunavailable.pt	2013-08-27 01:30:47 +0000
+++ lib/lp/app/templates/launchpad-databaseunavailable.pt	2014-11-15 01:56:13 +0000
@@ -1,94 +1,15 @@
+<!DOCTYPE html>
 <html
   xmlns="http://www.w3.org/1999/xhtml";
   xmlns:tal="http://xml.zope.org/namespaces/tal";
   xml:lang="en"
   lang="en"
 >
-  <head>
-    <title>Launchpad is temporarily unavailable</title>
-
-    <style type="text/css">
-
-html {
-  background: #fff;
-  margin: 0;
-  padding: 0;
-}
-
-body {
-  font-family: Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
-  font-size: 0.75em;
-  line-height: 1.3em;
-  color: #000;
-  margin: 0 0 40px 0;
-}
-
-a {
-  color: #03a;
-  text-decoration: none;
-}
-
-h1 {
-  font-size: 3.7em;
-}
-
-h2 {
-  font-size: 1.4em;
-  font-weight: normal;
-  margin: 0;
-  color: #333;
-}
-
-p.sub {
-  color: #333;
-}
-
-a img {
-  vertical-align: middle;
-}
-
-.page-center-wrap {
-  text-align: left;
-}
-.page-center {
-  text-align: center;
-  margin: 0px;
-  margin: auto;
-  width: 780px;
-}
-.page-center-content {
-  text-align: left;
-}
-
-#header,
-#footer {
-  padding-left: 50px;
-  padding-right: 50px;
-}
-
-#header {
-  border: 1px solid #d7d3cf;
-  padding-top: 20px;
-  padding-bottom: 20px;
-  margin-top: 50px;
-}
-
-#header .graphic {
-  font-size: 110px;
-  color: #646464;
-  float: right;
-  padding: 100px 80px 0 0;
-}
-
-#header .content {
-  margin-right: 300px;
-}
-
-#footer {
-  margin-top: 30px;
-}
-
-</style>
+<head>
+  <title>Launchpad is temporarily unavailable</title>
+  <link
+    type="text/css" rel="stylesheet" media="screen, print"
+    href="/+icing/basic-error.css" />
 </head>
 <body>
   <div class="page-center-wrap">
@@ -101,11 +22,17 @@
           <div class="content">
             <h1>Uh oh!</h1>
             <h2>Something has gone wrong. We're sorry!</h2>
-            <p>If we are in the middle of an update, Launchpad will be
-            back in a couple of minutes.  Otherwise, we are working to
-            fix the unexpected problems. Check
-            <a href="https://twitter.com/launchpadstatus";>@launchpadstatus</a>
-            on Twitter for updates.
+            <p>
+              If we are in the middle of an update, Launchpad will be
+              back in a couple of minutes.  Otherwise, we are working to
+              fix the unexpected problems. Check
+              <a href="https://twitter.com/launchpadstatus";>@launchpadstatus</a>
+              on Twitter for updates.
+            </p>
+            <p>
+              If the problem persists, let us know in
+              <a href="irc://chat.freenode.net/#launchpad"
+              >the #launchpad IRC channel on freenode</a>.
             </p>
             <p class="sub">Technically, this is a 503 error and has
               been caused by
@@ -118,7 +45,7 @@
         </div>
         <div id="footer">
           <a href="https://launchpad.net/";>
-            <img src="https://launchpad.net/@@/launchpad-logo-and-name-hierarchy.png";
+            <img src="/@@/launchpad-logo-and-name-hierarchy.png"
             alt="Launchpad" />
           </a>
         </div>


References