187 Commits

Author SHA1 Message Date
Ben Thorner
038d47e702 Minor tweaks in response to PR comments 2022-02-25 17:51:53 +00:00
Ben Thorner
c9a9640a4b Iterate local development with Docker
This makes a few changes to:

- Make local development consistent with our other apps. It's now
faster to start Celery locally since we don't try to build the
image each time - this is usually quick, but unnecessary.

- Add support for connecting to a local Redis instance. Note that
the previous suggestion of "REDIS = True" was incorrect as this
would be turned into the literal string "True".

I've also co-located and extended the recipes in the Makefile to
make them a bit more visible.
2022-02-24 17:15:41 +00:00
David McDonald
d82c84c358 Update where to get creds for sms providers
Due to change in https://github.com/alphagov/notifications-credentials/pull/261
2022-02-07 10:46:05 +00:00
Ben Thorner
c03647fb4b Centralise documentation for updating dependencies
This follows the convention established in [1].

[1]: https://github.com/alphagov/notifications-antivirus/pull/83
2021-12-29 14:59:38 +00:00
Ben Thorner
0fbca71545 Link to guidance about installing pycurl
This seems to be an issue for several people when we install new
versions of the package. Older versions of the package seem to
be equally affected, so the new need for this is likely related
to us using a newer OS / XCode version.
2021-11-15 15:21:09 +00:00
Leo Hemsted
036bc92245 switch from freeze reqs script to pip-tools
instead of alexey's home-grown script, pip-tools offers a quicker, more
efficient and better supported way to freeze requirements.

see prior art here:

https://github.com/alphagov/notifications-admin/pull/3753
https://github.com/alphagov/notifications-ftp/pull/333
2021-11-11 13:54:21 +00:00
Leo Hemsted
6b5d7ca639 switch to python 3.9 2021-11-11 13:54:14 +00:00
Ben Thorner
d1826af3c7 Remove out-of-date docs on new workers
In response to: https://github.com/alphagov/notifications-api/pull/3332#issuecomment-921897641

These were so out-of-date as to be misleading. We can always refer
back to them in the version history if needed.
2021-09-17 16:53:42 +01:00
Ben Thorner
f712bafc7f Add new guidance on writing public APIs
In response to: https://github.com/alphagov/notifications-api/pull/3305#issuecomment-896631475
2021-09-15 17:09:04 +01:00
Ben Thorner
14adddd566 Extract content about new workers into own doc
This is a bit too niche for the README, which should be focussed on
the bare minimum someone needs to know to get started with a repo.
Moving this content to its own doc is consistent with other apps [1]
and gives it more room to grow.

[1]: https://github.com/alphagov/notifications-admin/tree/master/docs
2021-09-15 16:11:54 +01:00
Ben Thorner
f2c6a49ab6 Update install instructions for Postgres
This apps works with v11, but not with v13. Adding '|| true' in the
Makefile means the 'bootstrap' rule can be run multiple times, even
if the DB already exists.
2021-02-22 12:41:35 +00:00
Ben Thorner
5ff7c2013e Swap FLASK_DEBUG for FLASK_ENV
This achieves the same thing and gets rid of the warning about being
in a production environment when the app starts up.
2021-02-18 09:11:16 +00:00
Ben Thorner
af95ad68ea Move bootstrap tasks into the Makefile
This is more consistent with how we run all other tasks. Note that
the virtual env setup is not generally applicable, and developers
of this repo should follow the guidance in the README.
2021-02-18 09:01:32 +00:00
Ben Thorner
5ad821428b Make instructions to run app/tests more concise 2021-02-18 09:01:30 +00:00
Ben Thorner
273fd339ac Clarify setup instructions for environment.sh 2021-02-18 09:01:29 +00:00
Ben Thorner
de6ed47239 Revise section about AWS setup
This is covered in Wiki in more detail.
2021-02-18 09:01:28 +00:00
Ben Thorner
89dc7218fe Remove section about virtualenv
This is covered generically in the Wiki [1].

[1]: https://github.com/alphagov/notifications-manuals/wiki/Getting-Started#development-environment
2021-02-18 09:01:27 +00:00
Ben Thorner
ba4d399982 Switch to 'make' for running app processes
These are simple enough that they don't need their own scripts.
2021-02-18 09:01:26 +00:00
David McDonald
ade08e23da Tidy up Readme 2020-01-07 10:26:07 +00:00
David McDonald
542f3b23aa Remove coveralls
We don't use it anymore
2019-12-24 08:37:19 +00:00
Tom Byers
62b606af17 Update README about python to use
We now run python 3.6 in production and there are issues with marshmallow-sqlalchemy using 3.5.
2019-11-22 14:15:34 +00:00
Leo Hemsted
e094dd4bfd remove loadtesting from providers
we don't use it since we wrote our own provider stubs for performance
tests.

this removes it from the api - it's still in the DB and will be
retrieved by queries, but is set to disabled on prod
2019-10-23 11:45:07 +01:00
Leo Hemsted
7a711cf314 Revert "Zero downtime deploy" 2019-05-15 13:48:40 +01:00
Leo Hemsted
39c8e1ede4 update readme 2019-05-09 14:50:38 +01:00
Pea Tyczynska
39d521cfc0 Update instructions about creating a new worker app in the README 2019-04-30 12:07:42 +01:00
Chris Heathcote
12cbdc550d Update README.md to reflect Postgres version needed
Added note about installing Postgres 9.6
2018-11-07 16:33:22 +00:00
Chris Hill-Scott
87017fc3d1 Merge pull request #2197 from alphagov/quis-patch-1
Update description of what the API repo is for
2018-10-31 11:12:55 +00:00
Chris Hill-Scott
69838919f2 Document Python version 2018-10-30 13:33:56 +00:00
Chris Hill-Scott
f23bd76255 Update description of what the API repo is for 2018-10-30 13:30:46 +00:00
Chris Hill-Scott
b8913b62ec Fix broken Markdown headings in README 2018-07-30 15:25:48 +01:00
Alexey Bezhan
75940c9566 Pin all application requirements in requirements.txt
The list of top-level dependencies is moved to requirements-app.txt,
which is used by `make freeze-requirements` to generate the full
list of requirements in requirements.txt.

This is based on alphagov/digitalmarketplace-api#615, so rationale
from that PR applies here.

We had a problem with unpinned packages on new deployments leading
to failed tests (e.g. alphagov/notifications-admin#2144) which is
why we're implementing this now.

After re-evaluating pipenv again, this still seems like the least
disruptive approach:

* pyup.io has experimental support for Pipfile, but doesn't respect
  version ranges or updating hashes in the lock file
* CloudFoundry buildpack recognizes and supports Pipfiles out of the
  box, but the support is relatively new. For example until recently
  CF would install dev packages during deployment. It's also based on
  generating a requirements file from the Pipfile, which doesn't
  properly support pinning VCS dependencies (eg it doesn't set the
  #egg= version, meaning pip will not upgrade the package if it's
  already installed).
* pipenv has a strict dependency resolution algorithm, which doesn't
  appear to be well documented and can cause some unexpected failures.
  For example, pipenv doesn't seem to be able to install `awscli-cwlogs`
  package at all, believing it to have a version conflict for `botocore`
  (which it doesn't list as a direct dependency) while neither `pip` nor
  `pip-tools` highlight any issues with it.
* While trying out `pipenv install` on our list of dependencies it would
  regularly fail to install utils with a "Will try again." message.
  While the installation succeeds after a retry, this doesn't inspire
  confidence.
* The switch to Pipfile and pipenv-managed virtualenvs requires a series
  of changes to `make` targets and scripts - replacing `pip install` with
  `pipenv`, removing references to requirements files and prefixing
  commands with `pipenv run`. While it's likely to simplify the overall
  process of managing dependencies, it would require time to properly
  implement across our applications and environments (Jenkins, PaaS,
  docker containers, and dev machines).
2018-07-10 14:59:04 +01:00
Athanasios Voutsadakis
19129a1313 Describe process for creating a new worker app 2018-03-08 14:02:08 +00:00
Leo Hemsted
073c48a0a7 move all static env vars from env.sh to config file in dev
There's no reason to have things that never change in environment.sh.
you'll want to update your environment.sh, then restart your shells
(`exec bash` or `exec zsh` etc)

This also changes the database to be set statically in the config, but
overridable from the command line if you need to - for example, jenkins
will override it with the dockerised postgres uri.
2018-02-21 18:12:03 +00:00
Leo Hemsted
90e9a2f1b3 use flake8 instead of pycodestyle
since there are thousands and thousands of errors in the tests files
at the moment, i propose fixing those errors in separate PR for now.
2017-11-28 14:28:01 +00:00
Leo Hemsted
d30a8b83c1 update readme and ensure makefile up to date 2017-11-23 17:04:58 +00:00
Leo Hemsted
9f56dccdee Remove flask-script, move commands to click
click (http://click.pocoo.org/) is used by flask to run its cli args.
In removing flask_script (it's unmaintained), we had to migrate all our
commands to use click. This is a change for the better in my eyes - you
don't need to define the command in several places, and it makes
managing options a bit easier.

View diff with whitespace turned off unless you're a masochist.
2017-11-23 17:04:58 +00:00
Chris Hill-Scott
0791c87b1e Add Coveralls badge
We should be proud 😎

[![Coverage Status](https://coveralls.io/repos/alphagov/notifications-api/badge.svg?branch=master&service=github)](https://coveralls.io/github/alphagov/notifications-api?branch=master)
2017-02-24 16:56:01 +00:00
Chris Hill-Scott
c2999ed5ad Use pycodestyle instead of PEP8
PEP8 was renamed to pycodestyle; this issue explains why:
https://github.com/PyCQA/pycodestyle/issues/466

This commit changes our tests to use pycodestyle instead of pep8.

It also means:
- making a couple of whitespace changes to appease the linter
- disabling warnings for bare `Except`s (ie `Except` instead of `Except
  ValueError`) – this seems like a sensible thing to catch but I’m not
  going to make meaningful code changes in this commit
2017-02-01 09:19:32 +00:00
minglis
22f6161440 Merge pull request #752 from alphagov/update-readme
Update README
2016-12-02 10:14:00 +00:00
Martyn Inglis
cea48140f8 Added README to tell users how tp switch REDIS on 2016-12-02 10:11:31 +00:00
Martyn Inglis
687f217d7b Updated readme 2016-12-02 10:09:36 +00:00
Jenny Duckett
84f89fb768 Update README
- the bootstrap script needs to be run before the app will run, so mention
  that first
- explain what run_celery_beat.sh is for and that it isn't required to run the
  app
2016-11-30 17:49:47 +00:00
Martyn Inglis
7b859fcca1 Set up REDIS config.
Switched OFF on DEV and by DEFAULT
Switched ON for TESTS
Switched ON on PREVIEW - STAGING - PRODUCTION

URL set via ENV file - set in environment_test.sh. DEVS will need to update environment.sh. README updated.
2016-11-28 09:39:56 +00:00
Leo Hemsted
a51dfb41d0 typo
paul tried to copy + paste command
2016-11-16 16:11:23 +00:00
Peter Chamberlin
b3c213406d Changes after review, and further thinking... 2016-10-04 15:12:04 +01:00
Pete
f8db1a9731 Spelling 2016-10-04 12:30:55 +01:00
Pete
555163aa48 AWS region should probably be user-defined too 2016-10-04 12:30:37 +01:00
Peter Chamberlin
df2d081c14 Removed extraneous back ticks 2016-10-04 12:05:46 +01:00
Peter Chamberlin
26325ff5e7 Corrected repo name/link for func tests 2016-10-04 11:18:43 +01:00
Peter Chamberlin
214071707b Updated README based on my experience getting things running 2016-10-04 11:12:55 +01:00