Merge lp:~michael.nelson/ubuntu-webcatalog/1015515-dont-create-new-app into lp:ubuntu-webcatalog
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Anthony Lenton | ||||
Approved revision: | 168 | ||||
Merged at revision: | 152 | ||||
Proposed branch: | lp:~michael.nelson/ubuntu-webcatalog/1015515-dont-create-new-app | ||||
Merge into: | lp:ubuntu-webcatalog | ||||
Prerequisite: | lp:~michael.nelson/ubuntu-webcatalog/1015505-extras-not-propietary | ||||
Diff against target: |
443 lines (+204/-70) 9 files modified
src/webcatalog/admin.py (+2/-2) src/webcatalog/forms.py (+5/-15) src/webcatalog/migrations/0024_remove_application_id_and_rename_for_purchase.py (+169/-0) src/webcatalog/models/applications.py (+1/-2) src/webcatalog/tests/factory.py (+3/-3) src/webcatalog/tests/test_commands.py (+15/-17) src/webcatalog/tests/test_forms.py (+1/-23) src/webcatalog/tests/test_managers.py (+3/-3) src/webcatalog/tests/test_views.py (+5/-5) |
||||
To merge this branch: | bzr merge lp:~michael.nelson/ubuntu-webcatalog/1015515-dont-create-new-app | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Anthony Lenton (community) | Approve | ||
Review via email: mp+112131@code.launchpad.net |
Commit message
Don't create new apps for the same distroseries and package_name.
Description of the change
Overview
========
Updates the form used to process sca app data so that we don't create new applications for the same distroseries just because they have different archive_ids.
Instead, if there's already an app in the same distroseries with the same package name, we update it.
I also fixed test_check_latest which was a false positive (it was passing if you ran all tests, but failing if I just ran the test case, because it was dependent on the alpha-ordering of the implicit versions being created by the test).
`fab test`
Notes: I'm currently left a little confused as to why we added application_id. We (I) added it with r116 as a way for us to distinguish apps imported from sca, given that we now had sca apps with archive_id=None. But this doesn't help distinguishing existing apps in the archive.
I don't know why we didn't go with package_name, or is package_name an issue because we may well *want* to have different versions of an app available in myapps. In which case, application_id still doesn't help, but checking for package_
Should we add some unique constraints for this? (unique_
RESOLVED after chatting with achuni:
* Both application_id and for_purchase allow us to distinguish between sca_imported apps and archive imported (so we can remove one of them - I've deleted application_id and renamed for_purchase-
* We only ever want one package_name per distroseries, always preferring the sca imported data. Therefore we should add a unique_together on distroseries/
Looks good! :)
+1 to remove application_id, and rename for_purchase -> imported_from_sca too.