summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-01-23Slight optimization when searching for removed packageDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-23Spice up the release listing page a bitDan McGee2-4/+23
Add JS tablesorter code and add some style to the yesno column. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-23Override the default admin queryset for some modelsDan McGee1-0/+10
Because some attributes are optional or otherwise not auto-magically picked up by Django, we can help the performance of loading these pages a lot by forcing a select_related() on the queryset used by the admin. For something like signoff_specifications, this drops the query count from ~107 to 9 queries. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-22Use a subquery rather than two queries in attach_maintainersDan McGee1-2/+6
Now that we are using a database that doesn't stink, it makes more sense to do all of the stuff we need to do down at the database level. This helps a lot when 500+ packages are in play at a given time, such as some of our larger rebuild todo lists. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-22Show staging version on todolist view pageDan McGee3-1/+26
If one exists, it is easy enough to show it here so in-progress todolists can easily be cross-checked with the current state of the repository. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20Fix error in get_requiredby() when checking providesDan McGee1-0/+1
The query refactor in commit 1b1b516bd removed a queryset I didn't realize was getting used elsewhere in the function. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20Remove AlwaysCommitMiddlewareDan McGee2-41/+0
Let's just go with the Django database option for PostreSQL autocommit mode instead. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20Query performance enhancements in get_requiredby()Dan McGee1-5/+6
For packages with particularly long lists of provides (e.g. perl), the query was getting a bit out of control with the list of names passed in. However, changing it to simply do a subquery resulted in some really poor planning by PostgreSQL. Doing this as a custom 'WHERE' clause utilizing the 'UNION ALL' SQL operator works very well. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20Lengthen the mirror rsync IP address fieldDan McGee2-2/+69
Make it long enough to support a full-form IPv6 address with a subnet. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20Add a view to download the torrent available for a given releaseDan McGee2-5/+26
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20Mark release version string as uniqueDan McGee2-1/+118
It should be unique anyway, but it is especially important now that we are using it in URL patterns for lookup. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Implement torrent data parsing and extraction via bencodeDan McGee4-5/+58
This allows uploading of the actual torrent file itself into the webapp and then pulling the relevant pieces of information out of it. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Add basic release list and details viewsDan McGee6-5/+90
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Add more metadata to releng Release modelDan McGee4-2/+136
Add a file_size field which we will use in the RSS feed, and also add a field for future storage of the torrent data itself. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Don't redefine mirror_url function every callDan McGee1-10/+11
If we pull this out and define it at the top level once, we save the interpreter a fair amount of work. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Publicize the releases feedDan McGee2-2/+10
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Initial cut of a Releases RSS feedDan McGee2-1/+45
This is our first use of enclosures on the site as well. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Add double click event handler to hide imageDan McGee1-0/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Use a set instead of list when gathering package differencesDan McGee1-10/+15
If we implement the __eq__ and __hash__ methods, we can use a set to gather package difference objects and make deduplication of objects a lot more efficient. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Include 'files_last_update' in package sitemap queryDan McGee1-1/+2
We need this for the package files sitemap; else we are doing one query per package to retrieve this field. Whoops. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Don't pull and sort mirror URLs unless we have toDan McGee1-5/+10
On the download page, the explicit sorted() call was forcing evaluation of the Django queryset, even if we never actually needed the results because the template fragment was cached. Wrap it all in a callable function which looks the same to the template, but saves us the cost of evaluation every single page view. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Convert all usages of flag icons to new spriteDan McGee8-6/+37
This uses a new template tag to avoid repeating construction of the necessary HTML element all over the place. The site should look exactly as it did before, except now you don't have to download 20+ images to see some pages. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Remove debugging print statementDan McGee1-1/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Rename famfamfam flags sprite PNG and CSSDan McGee2-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16More famfamfam flags style tweakingDan McGee1-3/+2
* Point default image at a blank spot in the PNG. * Remove dead style. * Don't use any crazy prefix matching stuff; just have separate class for default view. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Simplify famfamfam flags CSSDan McGee1-262/+258
Remove any redundant width and height declarations from individual countries and shorten the CSS class names. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Add famfamfam flags sprite image and CSSDan McGee2-0/+275
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Add a little easter egg for people to findDan McGee5-0/+29
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Tabs -> spaces in archweb.cssDan McGee1-3/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Clean up and make several migrations modernDan McGee6-32/+26
This moves most migrations to the v2 format that have been presenting some issues. One missing depends_on relationship has been added, and we allow an index to not be dropped if it does not exist due to the shittyness in sqlite3 actually keeping indexes across DDL on that table. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Add new AlwaysCommitMiddleware to the stackDan McGee2-0/+41
The reason for this is documented in the middleware itself. Without this, pgbouncer is of little use to us since it has to throw away every connection we try to route through it because of unclean disconnects. In theory, with the switch to using pgbouncer for all WSGI originating connections and adding this middleware, we should see a notable decrease in connection time to the database. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16Handle connection and transaction more properly in reporeadDan McGee2-6/+10
A few minor things are fixed here. One is PostgreSQL, and more specifically pgbouncer, don't like it when the connection is closed after psycopg2 has started an implicit transaction even for read-only queries. Ensure we call commit as our last database action in all cases. The other is related- Django in management commands doesn't ever call close on any database connection you may have been using, so PostgreSQL gets mad about this fact and logs a message saying such. Close the connection explicitly when we are done with it to play nice. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Support mirror status JSON by tierDan McGee2-1/+8
Just as we do for the normal status HTML view. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Ensure URLs without check data work on mirror details pageDan McGee1-7/+11
Less noticeable in production as the templates don't show '@@@INVALID@@@' there, but we were trying to access attributes that don't actually exist on certain mirror objects. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Drop country column from mirror tableDan McGee12-36/+93
We now always look for this information at the URL level, not the mirror level. This simplifies quite a bit of code in and around the mirror views. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Add migration to move country data down to the URL levelDan McGee1-0/+74
Rather than have the weird indirection we need now to find the right country for URLs, just always store it on the URL. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Use content_type and not mimetype on HttpResponse()Dan McGee8-15/+14
Bug #16519 in Django deprecates mimetype, so update our code accordingly. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Add __name__ attribute to class-based Feeds viewsDan McGee1-0/+4
This should hopefully allow these views to not be labeled as '_wrapped_view' in performance monitoring output. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Disable XView MiddlewareDan McGee1-1/+0
This is the default now in Django anyway: https://code.djangoproject.com/ticket/7317 Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Load key before importing newrelicDan McGee2-5/+7
Their code stupidly grabs the environment variable during import, not during the initialize call. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Try 3 at getting the New Relic license key inDan McGee1-5/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14More tweaks for New Relic in WSGI scriptDan McGee1-1/+6
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Add newrelic.ini fileDan McGee1-0/+194
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Enable newrelic in WSGI if availableDan McGee1-2/+19
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Simplify the WSGI scriptDan McGee1-2/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Add current production archweb.wsgi scriptDan McGee1-0/+15
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-12Make packages JSON search more performantDan McGee1-2/+6
We were peppering the database with a bunch of queries here; using prefetch_related and attach_maintainers can cut down the count significantly. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-12Add last_modified field to todolist packagesDan McGee3-1/+253
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-12Round two of mirror status query improvementsDan McGee1-9/+10
This seems to generate much more performant queries at the database level than what we were previously doing, and also doesn't show duplicate rows. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-12Add get_associated_packages method to FlagRequestDan McGee1-0/+7
Signed-off-by: Dan McGee <dan@archlinux.org>