Martyn Inglis
b923392c49
Using UTC dates on API validation for scheduled jobs.
2016-08-30 12:47:33 +01:00
Martyn Inglis
8b9319ac7a
Merge branch 'master' into scheduled-delivery-of-jobs
...
Conflicts:
app/dao/jobs_dao.py
tests/app/dao/test_jobs_dao.py
tests/app/job/test_rest.py
2016-08-25 14:53:00 +01:00
Leo Hemsted
d89e9e9930
Merge pull request #628 from alphagov/notification-statistics
...
Platform admin notification query
2016-08-25 14:37:46 +01:00
minglis
2d2ceba2d1
Merge pull request #631 from alphagov/add-new-column-to-jobs-for-delayed-sending
...
Adds new job_status table and FK to jobs.
2016-08-25 12:59:16 +01:00
minglis
415f2416cf
Merge pull request #627 from alphagov/update-job-page-query-2
...
Returns the outcome statistics for the job on the API call.
2016-08-25 12:07:20 +01:00
Martyn Inglis
d848093fb0
Fixed formatting and typo on beat config.
2016-08-24 17:08:20 +01:00
Martyn Inglis
2cffed9cd4
Added new scheduled task
...
- runs 1 min past the hour, every hour
- looks up all scheduled jobs that have a scheduled date in the past and adds them to the normal process job queue
- these are then processed as normal
2016-08-24 17:03:56 +01:00
Martyn Inglis
9af85d9cb3
new jobs query to get all scheduled jobs
2016-08-24 16:24:30 +01:00
Martyn Inglis
10f499805c
Updates to create job to handle scheduling
...
- If the job JSON contains a scheduling date then the new 'job_status" column is set to "scheduled"
- the date is persisted on the JOB row in the database
- Also the job WILL NOT be placed onto the queue of jobs. This is deferred to a later celery beat task.
2016-08-24 16:00:21 +01:00
Leo Hemsted
556b69a487
still return service if they have never sent any notifications
2016-08-24 15:00:51 +01:00
Leo Hemsted
29df7edaf9
tests for detailed services
2016-08-24 15:00:51 +01:00
Leo Hemsted
2053ebd933
rename service to service_blueprint
...
it was causing a bug where a local variable service was not being
instantiated and we were trying to operate on the blueprint instead
it's being used in so few places it makes sense to rename it
2016-08-24 15:00:51 +01:00
Leo Hemsted
00d19f63f0
group results by service using itertools
...
allows us to nicely reuse the existing format_statistics function
2016-08-24 15:00:51 +01:00
Leo Hemsted
ebb13a1251
create initial stats query
...
get statistics for all services, for today only
2016-08-24 15:00:51 +01:00
Martyn Inglis
cf3c14dbbd
Added job_status to marshmallow
...
- ensured statues not deleted on test runs
- returns in API call
Merge branch 'add-new-column-to-jobs-for-delayed-sending' into scheduled-delivery-of-jobs
Conflicts:
app/models.py
2016-08-24 14:35:22 +01:00
Leo Hemsted
1e8ab35976
Merge branch 'master' into noti-stats-cleanup
2016-08-24 14:24:17 +01:00
Martyn Inglis
48089e21e5
Adding default values
2016-08-24 14:16:39 +01:00
Martyn Inglis
1e10c0485c
Removed some code
2016-08-24 14:05:54 +01:00
Martyn Inglis
805da23d6b
Starting to implement scheduling
2016-08-24 14:04:52 +01:00
Martyn Inglis
5adecda41e
Adds new job_status table and FK to jobs.
...
This will replace the job_status enum type.
2016-08-24 13:34:42 +01:00
Martyn Inglis
acf3c568db
Tidied up the query indentation
2016-08-24 10:50:29 +01:00
Martyn Inglis
09cb94081b
Returns the outcome statistics for the job on the API call.
2016-08-23 16:46:58 +01:00
Leo Hemsted
132addb181
Merge branch 'master' into noti-stats-cleanup
2016-08-23 09:49:12 +01:00
Martyn Inglis
fe22c876b6
Merge branch 'master' into template_useage_per_id
2016-08-23 09:32:01 +01:00
Andras Ferencz-Szabo
0b73da94e7
Merge pull request #605 from alphagov/jenkins_deploy
...
Create Docker build image, build project with Docker
2016-08-22 17:57:39 +01:00
bandesz
68c1135379
Create Docker build image, build project with Docker
2016-08-22 17:25:41 +01:00
Martyn Inglis
4e6da1ba55
Changed template stats for template id
...
- now returns the most recent notification history row for that template ID.
- contains all the required data for the use cases for that template
2016-08-22 14:35:04 +01:00
Martyn Inglis
fdd85b7dc0
Merge branch 'master' into template_queryies
2016-08-22 11:42:26 +01:00
Leo Hemsted
5418f65ae7
Merge pull request #599 from alphagov/version-500
...
fix GET /notifications 500 error
2016-08-22 10:59:46 +01:00
Martyn Inglis
b7476a1975
Removed the group by day aspects of template stats. Not needed. Grouped by template only.
2016-08-22 10:38:44 +01:00
Martyn Inglis
9eb559d4b2
Renamed the param to avoid shadowing
2016-08-18 15:29:56 +01:00
Martyn Inglis
ede7d0cbea
Removed old endpoint.
...
Going to handle the migration in the clients.
2016-08-18 14:06:12 +01:00
Martyn Inglis
7a5acea71b
New endpoint for template stats to use new query. Breaking change to the returned JSON, so adding on a different url.
2016-08-18 14:01:31 +01:00
Martyn Inglis
f74000f548
Add query to get template usage from the Notifications History table
...
- groups by template Id and Day.
Returns count per day, template name, template id, template type, and day.
Ordered by day (desc) and template name (acc)
2016-08-18 12:06:00 +01:00
minglis
7fab5ada38
Merge pull request #596 from alphagov/extend-timeout-on-db-retries
...
Improve logging and extend time periods associated with retrying
2016-08-17 09:24:49 +01:00
Leo Hemsted
721929ca75
Merge pull request #589 from alphagov/org-rendering
...
Render organisational branding in emails
2016-08-16 13:26:09 +01:00
Leo Hemsted
5491668579
let users set organisation on POST /service/{id}
2016-08-15 10:54:26 +01:00
Leo Hemsted
cc7ea8043c
add organisation and branding to GET /service response dict
2016-08-12 11:40:57 +01:00
Leo Hemsted
5b3a0f03d3
rename actual_template to template_history
...
it's slightly less emotionally charged
2016-08-12 10:29:23 +01:00
Leo Hemsted
8fb0ba56ed
unused schema
2016-08-11 17:30:50 +01:00
Leo Hemsted
b22e3845aa
kill unused schema
2016-08-11 16:34:36 +01:00
Leo Hemsted
f065b08db2
remove unused dao functions
2016-08-11 16:13:53 +01:00
Leo Hemsted
fff81b4910
remove unused notification-statistics endpoints
2016-08-11 11:55:28 +01:00
Chris Hill-Scott
ebfaa5dac2
Show separate error messages for team key
...
Although using a team key is functionally the same as your service being
restricted, conflating the two errors is not helpful. What we typically
saw in research was that someone was using a team key, got the error,
used a live key and got the _same_ error.
This commit adds a new error message that specifically mentions the type
of API key that you’re using.
2016-08-10 16:20:01 +01:00
Chris Hill-Scott
0a429e18b4
Give better error when sending to non-team member
...
Scenario we saw in research:
- trying to send a message to someone outside your team
- service is in trial mode
Result:
- error message was terrible, no-one understood it
Solution:
- better error message
2016-08-10 16:17:47 +01:00
Leo Hemsted
4dd924d438
Merge branch 'master' into version-500
2016-08-10 14:55:07 +01:00
Leo Hemsted
52b2f4f583
require fields in marshmallow schema to try and make it as hard
...
to break backwards compatability as possible
2016-08-10 11:27:28 +01:00
Martyn Inglis
67a4ee7d51
In event of a task retry ensure the log message is identifier as such
...
- "RETRY" prefixes the messages
In event of the retry attempts completing without successfully completing the task identify message as such
- "RETRY FAILED" prefixes the messages
Applies to the send_sms|send_email and send_sms_to_provider|send_email_to_provider tasks
These are there to try and ensure we can alert on these events so that we know if we have started retrying messages
Retry messages also contain notification ids to aid debugging.
2016-08-10 08:53:15 +01:00
Martyn Inglis
5b8fbada11
Extend the retry time on the create notification DB tasks
...
- Was previoulsy 5 attempts 5 seconds apart
- No 5 times 5 minutes apart.
- Gives 25 mins of retries before an error
2016-08-10 08:46:37 +01:00
Leo Hemsted
5b7af00295
re-add content_char_count to public GET /notification endpoints
...
we shouldn't remove stuff from endpoints or we'll break clients
2016-08-09 17:30:38 +01:00