Commit Graph

251 Commits

Author SHA1 Message Date
Dan McGee
e1f9a3c44a Drop old PackageDepend model
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18 21:36:11 -05:00
Dan McGee
72a92102df Switch to usage of new Depend object
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18 21:36:11 -05:00
Dan McGee
cc44fdbea5 Migrate package depends data into new model
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18 21:36:11 -05:00
Dan McGee
ef561bcd70 Add new depends model
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18 21:36:11 -05:00
Dan McGee
cf67e79523 Issue redirects from non-agnostic to agnostic URLs if unambiguous
For something like "/extra/i686/apache-ant/", we can redirect to
"/extra/any/apache-ant/" without ambiguity. Previously this redirected
to the split packages listing with a single package, which was neither
correct nor really expected.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18 21:36:05 -05:00
Dan McGee
158be107e4 Add a get_best_satisfier method to RelatedToBase
This is basically what we do in PackageDepend already.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18 19:58:27 -05:00
Dan McGee
17e33f9118 Refactor an abstract base class out of conflicts/provides/replaces
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18 19:58:27 -05:00
Dan McGee
a5f5557493 Use python json module directly in place of simplejson
As of Python 2.6, this is a builtin module that has all the same
functions and capabilities of the Django simplejson module. Additionally
simplejson is deprecated in the upcoming Django 1.5 release.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-12 09:32:30 -05:00
Dan McGee
d4c7a48623 Fix suggestion caching again for non-ASCII characters
This is why you should test this stuff with random input before rolling
it out. Whoops. URL that caught this problem:

    /opensearch/packages/suggest?q=%D7%A0%D7%9F%D7%92%D7%9F
aka
    /opensearch/packages/suggest?q=נןגן

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-05 10:19:49 -05:00
Dan McGee
86f8efaeb1 Fix search suggestions for invalid cache keys
Unfortunately, "invalid" in this case includes spaces, which is a bit
crazy. MD5 the provided search term before using it as a cache key to be
safe.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-04 10:59:04 -05:00
Dan McGee
768bc688aa Flagging related cleanups and improvements
Touch up the style slightly on the flag help popup to match the main
site style more closely.

When a logged-in user is flagging a package out of date, we have no need
for them to fill in the email field since we already have an email
address on file.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02 10:21:30 -05:00
Dan McGee
badc535aeb Ensure order_by default value is cleared when using distinct()
Otherwise the queryset returns nonsensical results. I find the design of
this less than obvious but so be it; we can ensure the results work
regardless of a default ordering on the model.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02 09:37:46 -05:00
Dan McGee
f3e0adcb2f Add some caching to the Opensearch-related views
Both some simple cache headers as well as low-level results caching on
search terms suggestions.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-01 18:12:50 -05:00
Dan McGee
b59e79f387 Opensearch enhancements
* Add a 64x64 icon as indicated in the Opensearch specification.
* Add suggestions capability and a new view providing suggestions based
  on package name starting with the typed value.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-01 17:13:33 -05:00
Dan McGee
4e1e28729f Use GenericIPAddressField in flag request ip_address
New (and slightly odd with regards to verbose_name) in Django 1.4. This
simply ensures a deployment in an IPv6 environment actually works as
expected. If you were using PostgreSQL as a database backend, you won't
be affected by this as the 'inet' type was already used, but at least
now you can edit the values in the admin without getting an error.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-27 09:12:26 -05:00
Dan McGee
5d9f87c02b Add JSON search view
This still might change and should not be viewed as a public API yet.
This has been a longstanding request in FS#13026.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 14:58:28 -05:00
Dan McGee
068bc8db6b Move PackageJSONEncoder into package.utils module
This will allow it to be used elsewhere, and doesn't really belong in
views anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 14:55:06 -05:00
Dan McGee
b5ab5b1e21 Choose an up-to-date mirror for download URLs
Given that we collect a lot of mirror status data, we can utilize it to
ensure the download link on the website actually works and newly-added
packages have actually been mirrored out. Add a method that attempts to
use the mirror status data to determine a mirror we should redirect our
download requests to. This can change on a regular basis, and falls back
to the old method if no mirror status data is available.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 14:54:52 -05:00
Dan McGee
ee2a587738 Use https:// links for all internal sites
We already use HTTPS exclusively for wiki, bugs, forums, etc. and we
have it available for our other sites, so link only to the https://
protocol locations when pointing users at other sites.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-03 14:55:27 -05:00
Dan McGee
b1a9818dde Include category when linking to bug reports
Also change the default category to something legit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-03 14:44:16 -05:00
Dan McGee
d9e5cbf546 Make hidden 'name' search field match exactly
This is much more useful than the old contains match if you are trying
to narrow down your search to a specific package.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-02 12:40:40 -05:00
Dan McGee
076f9c51d5 Return files in default order
When we read the repository databases, we get a filelist in sorted
order. Save time by returning the file list in that order rather than
resorting it based on filename and directory.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-29 10:00:11 -05:00
Dan McGee
611e30172a Rename 'packagedepend_set' attribute to 'depends'
We do this for every other related package attribute, so do it here too.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-26 12:33:28 -05:00
Dan McGee
493092f88f Add more info to package JSON dump
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-26 12:29:37 -05:00
Dan McGee
8edc3c4b9d Bump signoffs and mirror status JSON API versions
Due to datetime formatting changes in Django 1.4, we know follow the
ECMA specification more closely and use 'yyyy-mm-ddThh:mm_ssZ' format.
As this could break existing users of the JSON data, bump the version.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-26 10:27:01 -05:00
Dan McGee
48aec15343 Revert "Add some dev dashboard info regarding signed package count"
This reverts commit 797185faed. Now that
all packages in the Arch repos are signed, this column isn't very useful
as it just reflects the total package count.

Conflicts:

	packages/views.py -> packages/views/search.py

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-24 17:10:22 -05:00
Dan McGee
90e08b4863 Make all datetime objects fully timezone aware
This is most of the transition to Django 1.4 `USE_TZ = True`. We need to
ensure we don't mix aware and non-aware datetime objects when dealing
with datetimes in the code. Add a utc_now() helper method that we can
use most places, and ensure there is always a timezone attached when
necessary.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-23 19:54:40 -05:00
Dan McGee
b8c20439c0 Change Django urls.py import
Until Django 1.3, the functions include(), patterns() and url() plus
handler404, handler500 were located in a django.conf.urls.defaults
module.

In Django 1.4, they live in django.conf.urls.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-23 19:54:40 -05:00
Dan McGee
ef9d1c1ea2 Require message when flagging package out of date
This is not a very high bar to meet, and should cut down on at least a
few bogus or spam requests.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-14 10:32:01 -06:00
Dan McGee
30acd5c816 Protect urlencode calls against Unicode data
These would cause page errors if passed anything not in the ASCII
character set. This change allows for packages to have names composed of
any Unicode characters, not just those in the ASCII set.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-12 21:54:05 -06:00
Dan McGee
087aca5cce FlagRequest model behavior tweaks
* Add a default field to be used for latest() calls.
* Remove signal-based set of created date; instead, set it explicitly so
  all of our packages and flag request have the exact same date and time
  attached.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-07 00:47:14 -06:00
Dan McGee
33fe337d08 Encourage bug reports to have a summary
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-06 23:18:29 -06:00
Dan McGee
1f18484cae Extract split_package_details() method
This is never currently called directly as a view method, but is used by
the normal package details view as a fallback if a package cannot be
located.

This also fixes an issue where looking up a package in a repo it is not
in returns the split details page for one package, which is incorrect
behavior.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-02 09:36:29 -06:00
Dan McGee
d4ebdc5b97 Support more characters in package names
Fixes FS#28106, where we couldn't view packages with names containing
the '@' symbol. Rather than whitelist things, switch to a blacklist of
only a space and slash character.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-28 17:48:34 -06:00
Dan McGee
bb570809f1 Add repo to flag request admin columns
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-26 14:40:04 -06:00
Dan McGee
b2b5c1a064 Add old version string to saved flag requests
This makes it easier to match up a flag request with the package state
at the time of flagging, and might also help to determine if flagging
actions were legit. We only store it if it is the same across all
packages to be marked.

Also, move the various database write activities when flagging packages
into a single transaction.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-10 23:31:11 -06:00
Dan McGee
6b16b9487a Adjust page and content caching lengths and decorators
Remove never_cache from many places now that we don't actually need it
since we aren't caching by default. Adjust our cache_function decorator
times be shorter values, and also randomize them a bit to make cache
invalidations not all line up.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-05 13:03:00 -06:00
Dan McGee
64da32a3f3 Add maintainer and packager data to package JSON view
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-03 14:17:59 -06:00
Dan McGee
99eada1722 Use full version in signoff admin list view
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12 09:58:46 -06:00
Dan McGee
78f23956e0 Add signoff model admin interface
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12 07:03:36 -06:00
Dan McGee
a60801bb7d PyLint suggested cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-11 19:52:27 -06:00
Dan McGee
4fa709ea86 populate_signoffs: add an SVN log cache for duplicate lookups
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-09 09:28:49 -06:00
Dan McGee
5006da5647 Store flag requests in the database
This makes them persistent rather than the transient beings they
currently are. We attempt to capture all the metadata we need to be able
to do things with this later- aka IP address (for spam checking later),
fields that allow us to mark the request as spam or not an actual
out-of-date report, etc.

As a bonus, logged-in developers now get the email address field filled
in for free. Yay.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-08 15:02:28 -06:00
Dan McGee
3e094a548f Add a new FlagRequest model
This will be used to store all of the submitted data we get via flag out
of date forms on the website.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-08 15:02:11 -06:00
Dan McGee
a2317295bb Remove auto-deletion of package relations on inactive users
We have a page where these can all be managed now, so best leave it
alone in case someone accidentally marks a user inactive and all the
data is lost.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-08 13:52:53 -06:00
Dan McGee
96fecb1079 Multilib differences report
This new tables shows multilib packages paired with their regular
counterparts in the normal repos if the pkgver differs. A few name hacks
are needed to trim lib32-, -multilib, etc. from the name to find the
matching package.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-08 10:51:52 -06:00
Dan McGee
ae00d10ff4 Rename files list template for consistency
We use underscores in all other templates.

Also remove some of the generated whitespace in the template which is
noticeable in very large package lists.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-03 13:29:06 -06:00
Dan McGee
546012c8e0 Show files and directory count in standalone package files view
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-03 13:27:12 -06:00
Dan McGee
ff371bd376 Convert packager link to search by packager
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-03 12:50:55 -06:00
Dan McGee
85657db05d Better support for non-latin full names
Add a 'latin_name' field to the user profile so we can better support
those developers with names in non-Latin scripts, and yet still show a
Latin name as necessary on the developer profile page. This field only
shows up if populated.

Also, use consistent sorting everywhere- rather than using username,
always use first_name and last_name fields.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-21 10:08:23 -06:00