Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Commit

Permalink
Revert "Provides the same json files as product details from our data…
Browse files Browse the repository at this point in the history
…base"
  • Loading branch information
Rail Aliiev committed Jun 23, 2015
1 parent e37965c commit be4b705
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 1,412 deletions.
602 changes: 0 additions & 602 deletions json/languages.json

This file was deleted.

6 changes: 0 additions & 6 deletions kickoff-web.py
Expand Up @@ -51,11 +51,5 @@ def auth(environ, username, password):
'/cron/': path.join(path.dirname(__file__), 'cron/')
})

# We serve (at least) a stastic json file
from werkzeug import SharedDataMiddleware
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
'/json/': path.join(path.dirname(__file__), 'json/')
})

app.wsgi_app = AuthBasicHandler(app.wsgi_app, "Release kick-off", auth)
app.run(port=options.port, host=options.host)
2 changes: 0 additions & 2 deletions kickoff/__init__.py
Expand Up @@ -6,8 +6,6 @@
app = Flask(__name__)
db = SQLAlchemy()

# We do need this import to make sure json endpoints are available
import kickoff.jsonexport # NOQA
from kickoff.log import cef_event, CEF_WARN
from kickoff.views.csrf import CSRFView
from kickoff.views.releases import ReleasesAPI, Releases, ReleaseAPI, ReleaseL10nAPI, Release, ReleaseCommentAPI
Expand Down
7 changes: 0 additions & 7 deletions kickoff/config.py

This file was deleted.

247 changes: 0 additions & 247 deletions kickoff/jsonexport.py

This file was deleted.

37 changes: 4 additions & 33 deletions kickoff/model.py
Expand Up @@ -2,7 +2,6 @@

import pytz
import json
import re

from sqlalchemy import func
from sqlalchemy.ext.hybrid import hybrid_property
Expand All @@ -19,7 +18,6 @@ class Release(object):
submitter = db.Column(db.String(250), nullable=False)
_submittedAt = db.Column('submittedAt', db.DateTime(pytz.utc),
nullable=False, default=datetime.utcnow)
_shippedAt = db.Column('shippedAt', db.DateTime(pytz.utc))
version = db.Column(db.String(10), nullable=False)
buildNumber = db.Column(db.Integer(), nullable=False)
branch = db.Column(db.String(50), nullable=False)
Expand All @@ -44,20 +42,10 @@ def submittedAt(self):
def submittedAt(self, submittedAt):
self._submittedAt = submittedAt

# Dates are always returned in UTC time and ISO8601 format to make them
# as transportable as possible.
@hybrid_property
def shippedAt(self):
return pytz.utc.localize(self._shippedAt).isoformat()

@shippedAt.setter
def shippedAt(self, shippedAt):
self._shippedAt = shippedAt

def __init__(self, submitter, version, buildNumber, branch,
mozillaRevision, l10nChangesets, dashboardCheck,
mozillaRelbranch, enUSPlatforms=None, submittedAt=None,
shippedAt=None, comment=None):
comment=None):
self.name = getReleaseName(self.product, version, buildNumber)
self.submitter = submitter
self.version = version.strip()
Expand All @@ -70,8 +58,6 @@ def __init__(self, submitter, version, buildNumber, branch,
self.enUSPlatforms = enUSPlatforms
if submittedAt:
self.submittedAt = submittedAt
if shippedAt:
self.shippedAt = shippedAt
if comment:
self.comment = comment

Expand All @@ -80,7 +66,6 @@ def toDict(self):
for c in self.__table__.columns:
me[c.name] = getattr(self, c.name)
me['submittedAt'] = me['submittedAt']
me['shippedAt'] = me['shippedAt']
return me

@classmethod
Expand Down Expand Up @@ -209,7 +194,7 @@ def getReleaseTable(release):
raise ValueError("Can't find release table for release %s" % release)


def getReleases(ready=None, complete=None, status=None, productFilter=None, versionFilter=None, versionFilterCategory=None, searchOtherShipped=False, lastRelease=None):
def getReleases(ready=None, complete=None, status=None, productFilter=None, versionFilter=None, searchOtherShipped=False):
filters = {}
if ready is not None:
filters['ready'] = ready
Expand All @@ -226,22 +211,8 @@ def getReleases(ready=None, complete=None, status=None, productFilter=None, vers
releases = []
for table in tables:
if filters:
if lastRelease:
# Retrieve the last X version
results = table.query.filter_by(**filters).order_by(table._submittedAt.desc()).limit(40)
else:
results = table.query.filter_by(**filters)
for r in results:
if not versionFilterCategory:
releases.append(r)
else:
# We are using a manual filter here.
# we are not doing it through SQL because:
# * regexp queries are not really standard in SQL
# * sqlalchemy does not provide a wrapper for this
for versionFilter in versionFilterCategory:
if re.match(versionFilter, r.version):
releases.append(r)
for r in table.query.filter_by(**filters):
releases.append(r)
else:
for r in table.query.all():
releases.append(r)
Expand Down
2 changes: 1 addition & 1 deletion kickoff/templates/base.html
Expand Up @@ -30,7 +30,7 @@ <h1>Ship it</h1>
</div><!-- topbar -->
{% block content %}{% endblock %}
<div id="footer">
<a href="https://github.com/mozilla/ship-it/">Source code</a> / <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Release%20Engineering&component=Ship%20It">Report bug</a> / <a href="{{ url_for('json_exports') }}">JSON exports</a>
<a href="https://github.com/mozilla/ship-it/">Source code</a> / <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Release%20Engineering&component=Ship%20It">Report bug</a>
</div>
</body>
</html>
9 changes: 0 additions & 9 deletions kickoff/templates/firefox_versions.json

This file was deleted.

0 comments on commit be4b705

Please sign in to comment.