Merge lp:~wallyworld/launchpad/vouchers-timeout2-1014641 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Curtis Hovey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 16181 | ||||
Proposed branch: | lp:~wallyworld/launchpad/vouchers-timeout2-1014641 | ||||
Merge into: | lp:launchpad | ||||
To merge this branch: | bzr merge lp:~wallyworld/launchpad/vouchers-timeout2-1014641 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email: mp+130719@code.launchpad.net |
This proposal supersedes a proposal from 2012-10-16.
Commit message
Move the voucher redemption code to a garbo job, making the process to redeem vouchers more robust to salesforce issues.
Description of the change
== Implementation ==
This is a resubmission since the first attempt failed QA.
This branch changes the workflow of how vouchers are redeemed. The redemption via Salesforce has been moved from in-line to a garbo job. Viewing highlights:
- redeeming a voucher updates/creates the commercial subscription record and sets the sales_force_id to 'pending-xxxxx' where xxxx is the voucher id.
- the voucher is not redeemed immediately in salesforce
- the +vouchers view has been changed to remove from the salesforce unredeemed vouchers list any pending vouchers so that someone can not accidentally try and re-redeem a pending voucher
- any attempt to redeem a voucher which has already been submitted (because someone else got in first) results in an field error being displayed on the form
- a garbo job runs frequently to redeem pending vouchers in salesforce and update the commercial subscription record in Launchpad
This version of the branch adds extra functionality to allow the salesforce proxy to specify a timeout when making its RPCs. Previously, the salesforce proxy was only used within Launchpad, and so the lp default request timeout was used. Now, the proxy can be used within a garbo job, where no default timeout is set. I've introduced a new [commercial] configuration setting: voucher_
So now the salesforce proxy initialises it's transport with the configured timeout. A little extra infrastructure was required to allow the @with_timeout decorator to get the timeout value from an instance variable on the calling class rather than a hard coded value.
== Tests ==
Add test for new garbo job.
Add tests for new view behaviour regarding not showing pending vouchers and handling submission of vouchers which have been already processed
Update some doctests which repeatedly submit the same voucher id for different projects because this is no longer allowed.
Update timeout.txt to test the new timeout functionality.
== Lint ==
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
configs/
database/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
Remove the submit-twice-error you added to lib/lp/ registry/ doc/commercials ubscription. txt because you wrote a unit test for it.
I see the template is doing python evaluation twice to chose true ans false outcomes "python: vouchers or view_errors"
condition=
This check (or both) can be moved into the view so that python: is not used in TAL where is it doing late compilation.