Merge ~pappacena/launchpad:git-repo-async-privacy into launchpad:master

Proposed by Thiago F. Pappacena
Status: Needs review
Proposed branch: ~pappacena/launchpad:git-repo-async-privacy
Merge into: launchpad:master
Diff against target: 734 lines (+312/-31)
17 files modified
database/schema/security.cfg (+18/-0)
lib/lp/app/widgets/itemswidgets.py (+6/-2)
lib/lp/code/browser/gitrepository.py (+9/-1)
lib/lp/code/browser/tests/test_branchmergeproposal.py (+1/-1)
lib/lp/code/browser/tests/test_gitrepository.py (+69/-3)
lib/lp/code/configure.zcml (+9/-0)
lib/lp/code/interfaces/gitjob.py (+20/-1)
lib/lp/code/interfaces/gitrepository.py (+4/-0)
lib/lp/code/model/gitjob.py (+57/-0)
lib/lp/code/model/gitref.py (+1/-1)
lib/lp/code/model/gitrepository.py (+42/-9)
lib/lp/code/model/tests/test_gitcollection.py (+1/-1)
lib/lp/code/model/tests/test_gitjob.py (+59/-0)
lib/lp/code/model/tests/test_gitrepository.py (+4/-6)
lib/lp/code/xmlrpc/tests/test_git.py (+5/-5)
lib/lp/services/config/schema-lazr.conf (+6/-0)
lib/lp/testing/factory.py (+1/-1)
Reviewer Review Type Date Requested Status
Colin Watson (community) Needs Information
Ioana Lasc (community) Approve
Review via email: mp+392776@code.qastaging.launchpad.net

Commit message

Doing repository privacy change in background, and blocking user from changing it while another change is in progress.

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

This MP is already quite big, so I'll create in another MP the garbo job that will deal with GitRepositories that are PENDING_INFORMATION_TYPE_TRANSITION for too long (to avoid blocking them forever).

Revision history for this message
Ioana Lasc (ilasc) wrote :

LGTM

review: Approve
Revision history for this message
Colin Watson (cjwatson) wrote :

I think this is mostly OK, but I wonder if it could be even better. Instead of adding a new item to GitRepositoryStatus, have you considered just checking whether there's a pending job of the appropriate type, a bit like GitRepository.pending_updates? That would have the advantage that there'd be no need for a garbo job (https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/392809) to clean things up if the information-type-changing job fails: it would just automatically become available again, which feels like a cleaner design.

review: Needs Information
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

Pushed the requested changes.

I thought about just checking on-the-fly for unfinished jobs, but didn't go that way because it could be slightly expensive to run such query. But we do that in so few places that I agree it doesn't worth to concentrate that check in a garbo job. I have changed it too.

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.