Commit Graph

1412 Commits

Author SHA1 Message Date
Chris Hill-Scott
2c17825c12 Don’t use magic string for job status 2016-09-02 23:22:14 +01:00
Chris Hill-Scott
5d4e942fa1 Use fixture for testing scheduled jobs 2016-09-02 12:27:23 +01:00
Chris Hill-Scott
11a4b18451 Combine query filters when getting scheduled job
> filter_by and filter are just aliases for each other so can be
> combined together - filter is probably the better one (and then use
> == instead of keyword args)
2016-09-02 12:27:23 +01:00
Chris Hill-Scott
4a7267be8b Add an endpoint to cancel a job
If you schedule a job you might change your mind or circumstances might
change. So you need to be able to cancel it. This commit adds a `POST`
endpoint for individual jobs which sets their status to `cancelled`.

This also means adding a new status of `cancelled`, so there’s a
migration…
2016-09-02 12:27:02 +01:00
Rebecca Law
aa8ee3a8da Merge pull request #655 from alphagov/mmg-update-status
Update MMG status code 2 to be a permanent failure.
2016-09-02 09:44:24 +01:00
Leo Hemsted
b294568a91 Merge pull request #653 from alphagov/junit-test-results
add junit xml reporting to pytest
2016-09-02 09:38:01 +01:00
Rebecca Law
3d41fa9634 Update mmg status code 2 to be a permanent failure. 2016-09-01 10:23:37 +01:00
Leo Hemsted
95e3f39c6f Merge pull request #632 from alphagov/readme-cleanup
cleaned up readme + environment file
2016-08-31 17:08:49 +01:00
minglis
f94e8d3cf0 Merge pull request #654 from alphagov/index-slow-queries
Indexes to improves stats for service query
2016-08-31 16:31:05 +01:00
minglis
c09fa34edf Merge pull request #650 from alphagov/add-statistics-to-job
Return empty stats list for job creation
2016-08-31 16:25:25 +01:00
minglis
6405cb74c7 Merge pull request #649 from alphagov/queues-for-production
Queues for production
2016-08-31 16:25:13 +01:00
Martyn Inglis
ab5ff64dd0 Indexes to improves stats for service query 2016-08-31 16:24:18 +01:00
Leo Hemsted
00cac0f88b add junit xml reporting to pytest
also add file location to gitignore preemptively
2016-08-31 15:03:28 +01:00
Leo Hemsted
5ac4e630d8 remove some legacy code/tests relating to old invite/verification code 2016-08-31 14:49:26 +01:00
Chris Hill-Scott
c0247d93c8 Merge pull request #652 from alphagov/db-queues-changed
Fix test to expect correct db queue
2016-08-31 13:56:16 +01:00
Chris Hill-Scott
e98a740dbf Fix test to expect correct db queue
Sending emails was moved to a different queue in:
https://github.com/alphagov/notifications-api/pull/647

At the time that
https://github.com/alphagov/notifications-api/pull/645
was written, the previous queues were still being used.

So when #645 got merged it was testing for the old queues, which broke
the tests.
2016-08-31 13:46:00 +01:00
Chris Hill-Scott
f2309e041b Merge pull request #648 from alphagov/quis-patch-1
Remove outdated comment
2016-08-31 13:25:18 +01:00
Chris Hill-Scott
f3495f9dae Merge pull request #645 from alphagov/no-restrictions-on-test-key
Remove restrictions when using simulate API key
2016-08-31 13:25:12 +01:00
Martyn Inglis
57267a36f2 Return empty stats list for job creation 2016-08-31 12:12:09 +01:00
Martyn Inglis
6858641a3c Debug mode on for tests. 2016-08-31 12:09:12 +01:00
Martyn Inglis
06cb440fd2 Not a function call. 2016-08-31 11:42:05 +01:00
Martyn Inglis
ce006bd92d Start/Stop the new worker scripts on the code deploy actions. 2016-08-31 11:40:47 +01:00
Martyn Inglis
c108c493e6 Rejigged the queue config.
- the two new queues that handle delivery of notifications (db-[type] / send-[type]) Now no longer are processed by the default workers
- These workers now to the admin type queues for notify (CSV/Validation codes) etc.
- Two new workers are deployed to the AWS environments, one focused on db- tasks and one for send tasks
- These will pick up those queues explicitly.
2016-08-31 11:40:31 +01:00
minglis
bcfa83de79 Merge pull request #647 from alphagov/move-csv-emails-into-same-queue-as-api
Pushed the notifications from the CSV in the DB queue
2016-08-31 10:41:27 +01:00
Chris Hill-Scott
316e4b9ea6 Remove outdated comment
Added in January[1] and (for better or worse) it got done.

1. 49e98c21e7)
2016-08-31 10:39:25 +01:00
Martyn Inglis
e640e048e5 Pushed the notifications from the CSV in the DB queue 2016-08-30 17:27:01 +01:00
Andras Ferencz-Szabo
668e6c9716 Merge pull request #646 from alphagov/jenkins_coveralls
Finish coveralls task
2016-08-30 14:44:01 +01:00
minglis
63facd530c Merge pull request #644 from alphagov/seperate-queues-for-sending-and-for-db
Seperate queues for sending and for db
2016-08-30 14:43:45 +01:00
Martyn Inglis
eff7c044a2 Scheduled jobs every minute 2016-08-30 14:35:18 +01:00
Martyn Inglis
f3c614634f Merge branch 'master' into seperate-queues-for-sending-and-for-db 2016-08-30 14:25:14 +01:00
Martyn Inglis
354efbdd2c Ensure routing keys correct 2016-08-30 14:25:09 +01:00
minglis
4a078e3c61 Merge pull request #635 from alphagov/scheduled-delivery-of-jobs
Scheduled delivery of jobs
2016-08-30 12:48:48 +01:00
Martyn Inglis
b923392c49 Using UTC dates on API validation for scheduled jobs. 2016-08-30 12:47:33 +01:00
bandesz
df388ec33d Finish coveralls task 2016-08-30 12:06:05 +01:00
Chris Hill-Scott
7769923dda Allow test key to send irrespective of daily limit
When you use a simulate API key it should behave like a live service,
except for actually sending the messages. There should be no limits even
if the service is in trial mode.

This commit removes the restriction on sending messages when you’ve sent
up to your daily limit.
2016-08-30 11:06:38 +01:00
Chris Hill-Scott
5eaec8c235 Allow test key to send irrespective of trial mode
When you use a simulate API key it should behave like a live service,
except for actually sending the messages. There should be no limits even
if the service is in trial mode.

This commit removes the restriction on sending messages to peole outside
your team when you’re in trial mode.
2016-08-30 11:06:15 +01:00
minglis
5c8c2eb039 Merge pull request #641 from alphagov/add-job-stats-to-get-all-jobs-query
Bug fix:
2016-08-30 11:00:16 +01:00
Martyn Inglis
486697d07c New queues for the sms/email tasks
Previously there were 4 queues for sending messages

The was based on the fact that each notification has 2 actions - persist in the database and send to provider.

Two queues supported the CSV upload - for the first of these tasks
- bulk-email
- build-sms

And there were two more queues for the tasks that make the 3rd party client calls.
- sms
- email

API Calls just used the latter two queues for both tasks

Added four new queues
- db-email
- db-sms
- send-sms
- send-email

So an API call puts a notification into the db-[type] queue first, which then puts the notification into the send-[type] queue

Build queues stay as before.

This will allow us to target processing of these tasks with separate workers to manage these differently.
2016-08-30 10:42:24 +01:00
Leo Hemsted
4f0c5fdd9e Merge pull request #623 from alphagov/test-fixes
Test fixes
2016-08-30 10:38:53 +01:00
Martyn Inglis
58a89a3a80 Only init the statsd client if enabled - allows us to switch it off if not internet access 2016-08-30 10:37:06 +01:00
minglis
287d32c037 Merge pull request #638 from alphagov/remove-contested-writes
Remove contested writes
2016-08-30 08:56:45 +01:00
minglis
1834522824 Merge pull request #642 from alphagov/remove-travis
Remove travis builds
2016-08-26 15:58:14 +01:00
Martyn Inglis
929486ae46 Remove travis builds 2016-08-26 15:33:49 +01:00
Martyn Inglis
e1543e9a5c More definite create times on job - some intermittent test fails where ordering ambiguous. 2016-08-26 15:32:46 +01:00
Martyn Inglis
dd7850b235 Bug fix:
- Get all jobs for service doesn't return the statistics.
- Dashboard therefore is incorrect

This is the API fix for this, returns the data.
2016-08-26 15:07:59 +01:00
Chris Hill-Scott
f09704e5f4 Merge pull request #624 from alphagov/sms-sender-no-prefix
Don’t prefix text messages if sender name is set
2016-08-26 14:57:12 +01:00
Chris Hill-Scott
f7391da350 Don’t prefix text messages is sender name is set
Implements:
- [x] https://github.com/alphagov/notifications-utils/pull/66
2016-08-26 14:45:01 +01:00
Leo Hemsted
7835339165 Merge branch 'master' into test-fixes 2016-08-26 10:57:41 +01:00
Andras Ferencz-Szabo
5c0185704e Merge pull request #639 from alphagov/travis_cleanup
Travis cleanup: remove deploy + functest trigger
2016-08-25 16:26:35 +01:00
bandesz
9b4188f05a Travis cleanup: remove deploy + functest trigger 2016-08-25 16:19:52 +01:00