Commit Graph

137 Commits

Author SHA1 Message Date
Ken Tsang
0daf88aff7 Refactored code 2017-07-26 11:05:31 +01:00
Ken Tsang
3e6e75998b Update config to use logo cdn 2017-07-26 11:05:31 +01:00
Rebecca Law
91f29517eb Merge branch 'master' into month-billing-table 2017-07-24 15:17:36 +01:00
Leo Hemsted
614880f6d9 send to send-sms-tasks and send-email-tasks instead of send-tasks 2017-07-21 13:49:37 +01:00
Leo Hemsted
4d33040653 add separate send-sms and send-email queues
we're reading from those two queues as well as teh existing send queue,
however for now we don't send anything to them
2017-07-20 16:19:38 +01:00
Leo Hemsted
6c61a3fc2a Revert celery4
Revert the following three pull requests:
https://github.com/alphagov/notifications-api/pull/1085
https://github.com/alphagov/notifications-api/pull/1086
https://github.com/alphagov/notifications-api/pull/1088

celery 4.0.2 looked promising, however, on staging under mild load
(5/sec api calls) the performance was actually worse than 3.1.25
2017-07-19 15:17:19 +01:00
Rebecca Law
9400988d72 Monthly billing - part 1
This is still a work in progress but it would be good to get some eyes on it.
This commit includes creating and updating a row in the monthly billing table and a method to fetch the results.
There is a command to populate the monthly billing for a service and month so we can try it out.
The total cost at the moment are wrong, they do not take into account the free allowance - see notes below about adding that to the table.
Left to do:
create a nightly task to run to update the monthly totals.
create an endpoint to return the yearly billing, the current day will need to be calculated on the fly and added to the totals.
Add the free allowance into the total costs.
2017-07-18 18:21:35 +01:00
Martyn Inglis
786adb5d71 Move Queuenames in with the celery code, revamp config to allow move to celery 4.x 2017-07-12 12:01:52 +01:00
Ken Tsang
46a55c1cdb Refactor code 2017-07-06 12:27:57 +01:00
Ken Tsang
815f4d0a81 Removed prints 2017-07-06 12:27:56 +01:00
Ken Tsang
b04d01ba27 Refactored code to use new service permissions only 2017-07-06 12:27:55 +01:00
Martyn Inglis
2591d3a1df This massive set of changes uses the new queue names object throughout the app and tests.
Lots of changes, all changing the line of code that puts things into queues, and the code that tests that.
2017-05-25 10:51:49 +01:00
Leo Hemsted
3744463296 treat 40604 and GOVUK as not having a sender ID
in prep for removing the 40604-as-default, first we need to make sure
that if you either have GOVUK or None as your sms sender, then we send
GOVUK through to the provider
2017-05-22 17:10:07 +01:00
Martyn Inglis
caed193647 Use the new task wrapper methods rather than creating a task directly 2017-05-09 18:17:55 +01:00
Imdad Ahad
e450f15b2b Fix typo and update test now that we expect sent for international 2017-04-27 16:57:04 +01:00
Martyn Inglis
349fb3529e Handle case for international SMS - use correct phone validator, and also set status correctly.
This relies on some other code so this commit has placeholder failing tests to be populated when other PRs are merged.
2017-04-27 16:27:14 +01:00
Martyn Inglis
109b1727f2 Fish out the international provider if needed. 2017-04-27 12:14:22 +01:00
Imdad Ahad
d0978e52fb Use intl provider for int sms notifications (needs tests) 2017-04-27 10:18:28 +01:00
Rebecca Law
c36d61c071 Update as per comments on review 2017-02-06 16:20:44 +00:00
Rebecca Law
4085594a53 Small refactor to reuse code. 2017-02-03 14:27:04 +00:00
Rebecca Law
dab89969cc If the service is inactive at the time of sending the notification to the provider, the notification is marked as technical-failure.
Removed the /service/<id>/deactivate endpoint, now using /service/<id>/archive
2017-01-31 14:28:25 +00:00
Rebecca Law
fde3216f9e Check the service is active before sending the notification to the provider. 2017-01-31 13:53:13 +00:00
Martyn Inglis
71289d36db Change to research mode.
Previously research mode created a task to fake the callback from the providers. This meant there is an extra task for each notification than would be generated in a live situation.

This PR changes that, so that a research mode/test key notification calls the callback API rather than make a task to do that .

This ensures that the flow for research mode more closely mimics that of live, and removes a task from the process so we can more accurately test throughput,
2017-01-24 14:24:58 +00:00
Imdad Ahad
e1d1769345 Refactor to switch properly when providers have equal priority with test 2017-01-23 13:36:04 +00:00
Imdad Ahad
0a277b26b6 Switch providers ONLY on provider exception 2017-01-20 16:14:29 +00:00
Leo Hemsted
d4f23f1e44 don't use cloudfront on preview or staging
cloudfront caching isn't set up on those environments yet, so continue
to use flask for now - in the future we'll want to revert this once
those environments are up and running properly
2016-12-29 12:15:47 +00:00
Leo Hemsted
9e27574298 Merge pull request #779 from alphagov/switch-to-cloudfront
use cloudfront instead of flask to serve static images
2016-12-29 11:35:05 +00:00
Leo Hemsted
5cbe4eb5b2 use cloudfront instead of flask to serve static images
branding in emails was previously hosted from admin app - this changes
the url to be static.{domain}/images instead of {domain}/static/images,
which redirects to cloudfront.

some manipulation of the URL was required to make sure it still serves
locally rather than returning "static.localhost:6012" for example.

(if ADMIN_BASE_URL is localhost it just returns the old /static/
path)

also was able to remove DB interaction from a test. woo!
2016-12-21 16:35:16 +00:00
Martyn Inglis
2d946736e0 Log notification ID on deliver tasks and in clients.
- help tie things together  in Kibana.
2016-12-20 13:24:08 +00:00
Chris Hill-Scott
59af44d7ab Update utils to 12.0.0
Includes:

- [x] https://github.com/alphagov/notifications-utils/pull/94 (breaking
      changes which are responsible for all the changes to the API in
      this PR)

The test for `get_sms_fragment_count` has been removed because this
method is already tested in utils here:

ac20f7e99e/tests/test_base_template.py (L140-L159)
2016-12-13 10:57:01 +00:00
Chris Hill-Scott
d449475dd5 Incorporate breaking utils changes
The `.replaced…` methods on instances of `Template` were removed in
https://github.com/alphagov/notifications-utils/pull/84
2016-12-02 10:42:11 +00:00
Martyn Inglis
6f7dd149e2 Tidied up pull request comments 2016-09-23 15:59:23 +01:00
Martyn Inglis
137aa1e2d2 Merge branch 'master' into refactor-send-tasks-into-shared-code
Conflicts:
	app/celery/provider_tasks.py
	tests/app/celery/test_provider_tasks.py
2016-09-23 09:54:53 +01:00
Martyn Inglis
37a2dc7925 Implemented the REST endpoint to communicate with the new send-to-provider code
- this allows us to send a notification to a provider by means of an API call
- This is in addition to the celery code.
- idea is that we can use this method to help speed up throughput by generating API traffic by node/lambda etc to supplement the celery code in times of high load.
2016-09-22 14:01:25 +01:00
Martyn Inglis
2f36e0dbcf Refactor to make the new send_to_provider methods take a notification not a notification ID.
- Driven by the fact we won't know the type in the API call
- hence we need to load notification earlier , so pass it not the id through to the send task to avoid loading it twice.
2016-09-22 09:16:58 +01:00
Martyn Inglis
991cc884b4 Refactoring the send to provider code out of the tasks folder
- building a rest endpoint to call that code to compliment the existing task based approach.
2016-09-21 13:27:32 +01:00
Martyn Inglis
bd06b18684 Refactor of celery tasks.
- Aim to move the code that contacts providers into it's own module.
- Celery tasks now call this module to send to provider
- No exceptions caught in the new module. Celery tasks now use any exception to trigger a retry.
- tests moved about - new test directory for the new class, all tests from celery test module moved, excepting the retry logic.
2016-09-20 17:24:28 +01:00