Merge lp:~abentley/launchpad/person-assigned-specs-in-progress into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Aaron Bentley on 2012-10-26 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 16198 |
| Proposed branch: | lp:~abentley/launchpad/person-assigned-specs-in-progress |
| Merge into: | lp:launchpad |
| Diff against target: |
362 lines (+139/-52) 9 files modified
lib/lp/blueprints/enums.py (+4/-4) lib/lp/blueprints/model/specification.py (+22/-19) lib/lp/registry/browser/person.py (+2/-1) lib/lp/registry/browser/tests/test_person.py (+18/-1) lib/lp/registry/doc/person.txt (+1/-1) lib/lp/registry/interfaces/person.py (+11/-3) lib/lp/registry/model/person.py (+19/-18) lib/lp/registry/tests/test_person.py (+57/-0) lib/lp/testing/factory.py (+5/-5) |
| To merge this branch: | bzr merge lp:~abentley/launchpad/person-assigned-specs-in-progress |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Steve Kowalik (community) | code | 2012-10-22 | Approve on 2012-10-26 |
| Deryck Hodge (community) | Approve on 2012-10-26 | ||
|
Review via email:
|
|||
Commit Message
Fix +portlet-
Description of the Change
= Summary =
Fix bug #1068719: Person overview page breaks when assigned proprietary blueprints
== Proposed fix ==
Enhance Person.
== Pre-implementation notes ==
None
== LOC Rationale ==
Part of Private Projects.
== Implementation details ==
Since Person.
The results should be sorted according to Specification.
in_progress is implemented as a boolean rather than extending SpecificationFilter because this is more direct.
== Tests ==
bin/test -t in_progress -t test_assigned_
== Demo and Q/A ==
Create a proprietary specification with status STARTED, and assign it to a Person. You should see it listed on their overview page.
Log in as an unprivileged user and look at the same person's overview page. You should not see it listed.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
| Deryck Hodge (deryck) wrote : | # |
There is no observable difference in the two queries.
SELECT * from Specification WHERE
Specificati
OR Specification.
OR Specification.
OR Specification.
OR Specification.id IN
(
SELECT SpecificationSu
FROM SpecificationSu
WHERE SpecificationSu
)
AND (
NOT (Specification.
OR Specification.
AND Specification.
) AND (
OR NOT Specification.
SELECT Product.id FROM Product WHERE Product.active = true)
) AND (
NOT (Specification.
OR Specification.
OR Specification.
AND Specification.
);
Total runtime: 155.522 ms
SELECT * from Specification WHERE
Specificati
OR Specification.
OR Specification.
OR Specification.
OR Specification.id IN
(
SELECT SpecificationSu
FROM SpecificationSu
WHERE SpecificationSu
)
AND (
OR Specification.id IN (
SELECT Specification.id FROM Specification
)
AND Specification.
)
)
AND (
NOT (Specification.
OR Specification.
AND Specification.
) AND (
OR NOT Specification.
SELECT Product.id FROM Product WHERE Product.active = true)
) AND (
NOT (Specification.
OR Specification.
OR Specification.
AND Specification.
);
Total runtime: 155.263 ms
| Deryck Hodge (deryck) wrote : | # |
As for the larger question of denormalized tables, we looked at the work people did and see it's great work, and discussed specifically with lifeless that we might not need them in the case of blueprints because the data is so much smaller than everything else. Regardless of whether we need them or not, we'll keep a close eye on timeouts during beta and add any performance-related changes we need to stay in good shape, denormalized tables or otherwise.
| Deryck Hodge (deryck) wrote : | # |
I wrote "the work people did" above and meant "the work Purple did." Sorry. Was typing quickly during the sprint here.
| Steve Kowalik (stevenk) wrote : | # |
Firstly, the thing I'm arguing for is two denormalized *columns* on Specification which means you don't need to JOIN against APG and APGF. However, I'm not going to block this MP with this particular point.
AND (
This, however, I will block on. You can't use NULL inside an IN, it will compile as SQL, but you are likely getting results you don't expect.
| Aaron Bentley (abentley) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12-10-25 12:29 AM, Steve Kowalik wrote:
> AND ( Specification.
>
> This, however, I will block on. You can't use NULL inside an IN, it
> will compile as SQL, but youI are likely getting results you don't
> expect.
That SQL is not the actual SQL. We called storm.expr.compile to get
the expression, but this left us with a bunch of ? to fill in, and we
filled that part in incorrectly. The actual values that Launchpad
uses are: (1,2) i.e. PUBLIC and PUBLICSECURITY.
If there is a bug in get_specificati
bug in my code, so please do not block my branch on that basis.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAlC
xbsAniDAaA78ZYX
=fLt9
-----END PGP SIGNATURE-----
| Deryck Hodge (deryck) wrote : | # |
Steve, we really need to get this landed, so I'm going to mark this approved for Aaron, since I read your comments to say you don't have any other objections. I'm basing my reading of this on the fact that you wouldn't block on the queries, and the NULL thing was just our mistake in data substitution.
If there are other concerns, please reach out the either me or Aaron and we can sort them out in another branch.

The docstring for IPerson. findVisibleAssi gnedInProgressS pecs() makes no mention that it will only return five specs. I'd prefer the model function also includes the usual "See `Interface'." docstring.
This also means this code will now rely on get_specificati on_privacy_ filter rather than OOPSing. Due to the query that is run by that function, I suspect we are now trading OOPSes for timeouts. I'd *really* prefer the access mechanisms for Specifications are de-normalized like they are for bugs and branches. I'd like to see some investigation of the query that get_specificati on_privacy_ filter runs before I approve this branch.