Commit Graph

8700 Commits

Author SHA1 Message Date
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
1bddf66ed5 Setup code for tests for scheduled jobs. 2016-08-24 16:24:55 +01:00
Martyn Inglis
9af85d9cb3 new jobs query to get all scheduled jobs 2016-08-24 16:24:30 +01:00
Leo Hemsted
62e5361b0c cleaned up environment file
* sorted list in README and environment_test.sh
* removed some unused vars
* cleaned up some names to be more accurate in the readme
* removed twilio as a dependency
2016-08-24 16:23:11 +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
Andras Ferencz-Szabo
020d998baa Merge pull request #634 from alphagov/env_rename
Rename development env to preview
2016-08-24 15:59:51 +01:00
bandesz
135ac6f23e Rename development env to preview 2016-08-24 15:55:29 +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
Leo Hemsted
a9f51f5b48 Merge pull request #603 from alphagov/noti-stats-cleanup
Remove some unused code
2016-08-24 14:40:47 +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
a3fe1dff1f include section on testing in readme.md 2016-08-24 14:30:46 +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
minglis
cf14c97ebb Merge pull request #618 from alphagov/template_useage_per_id
Template useage per
2016-08-24 11:01:17 +01:00
Martyn Inglis
3006c7af54 Removed print 2016-08-24 10:59:33 +01:00
Martyn Inglis
acf3c568db Tidied up the query indentation 2016-08-24 10:50:29 +01:00
Andras Ferencz-Szabo
9926df7c08 Merge pull request #626 from alphagov/jenkins_deploy_stage
Disable Travis deploys for staging
2016-08-23 16:56:48 +01:00
Martyn Inglis
09cb94081b Returns the outcome statistics for the job on the API call. 2016-08-23 16:46:58 +01:00
bandesz
e6177a2163 Disable Travis deploys for staging 2016-08-23 16:45:21 +01:00
Andras Ferencz-Szabo
e2c028c752 Merge pull request #625 from alphagov/jenkins_deploy_dev
Fix version file generation, remove master deploys from travis
2016-08-23 14:07:28 +01:00
Leo Hemsted
9d624ef280 prevent errors if user has no venv setup at all 2016-08-23 13:56:10 +01:00
bandesz
f113309713 Fix version file generation, remove master deploys from travis 2016-08-23 13:44:34 +01:00
Leo Hemsted
a3843053cd improved local test-running ability
call generate-version-file before tests, since they'll fall over if the version file isn't present
use /Users/leohemsted/.virtualenvs/api rather than looking for ./venv/ - if there's some other venv already active, then don't try and look for a current venv to activate
2016-08-23 12:17:56 +01:00
Leo Hemsted
26d7675baa pep8 fixes
no idea why the build/local pep8s weren't picking them up before.

also excluded import order pep8
2016-08-23 12:05:47 +01:00
Leo Hemsted
270451e7ba Merge pull request #617 from alphagov/update-branding
update ukvi org branding spelling
2016-08-23 10:25:34 +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
minglis
cbdabb14fe Merge pull request #610 from alphagov/template_queryies
Template queryies
2016-08-22 16:39:30 +01:00
Leo Hemsted
d7945d85dc update ukvi org branding spelling
was previously UK Visas and Immigration
now UK Visas & Immigration
2016-08-22 16:12:09 +01:00
Leo Hemsted
31f260d793 Merge pull request #614 from alphagov/utils-vers
actually bump version
2016-08-22 14:51:18 +01:00
Leo Hemsted
0a052d45a8 actually bump version
missed a number last time 😧
2016-08-22 14:40:02 +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
Leo Hemsted
997dd47911 Merge pull request #612 from alphagov/utils-vers
update utils version
2016-08-22 13:44:40 +01:00
Leo Hemsted
d5ec73bc8a update utils version 2016-08-22 13:38:45 +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