Commit Graph

118 Commits

Author SHA1 Message Date
Ryan Ahearn
970a777876 Fix makefile typo 2023-05-09 21:54:22 -04:00
Ryan Ahearn
e66301a170 Add cloud.gov user audit script 2023-05-09 21:47:14 -04:00
Kenneth Kehl
001954538e notify-243 remove statsd 2023-04-25 07:50:56 -07:00
Andrew Shumway
1047b70792 Added fail coverage threshold under 50% 2023-04-18 13:51:48 -06:00
Andrew Shumway
d8c5c29d2d Added coverage commands to make test and dir to gitignore 2023-04-17 15:56:08 -06:00
Ryan Ahearn
6118394f02 Remove ignore-vulnerability for remediated redis vuln 2023-03-29 17:04:43 -04:00
Ryan Ahearn
8e64fb12ba Ignore known issue with redis 4.5.3 2023-03-28 09:06:21 -04:00
Ryan Ahearn
50bc1532a3 Turn off newrelic for celery-beat 2023-01-18 10:03:45 -05:00
Ryan Ahearn
bfeb65c914 Install newrelic and enable in development 2023-01-18 09:06:09 -05:00
Ryan Ahearn
7e02e6b33d Update to most recent pip-audit action 2023-01-03 09:44:53 -05:00
Ryan Ahearn
db96c4d82f Replace foreman with honcho 2022-11-01 09:54:31 -04:00
stvnrlly
493e7e015a pipenv in devcontainers, probably 2022-10-28 12:58:07 +00:00
stvnrlly
d87c224473 remove broadcast-related code, except migrations 2022-10-26 16:41:35 -04:00
stvnrlly
9b9465c74a remove extra hyphen 2022-10-26 15:34:12 -04:00
stvnrlly
82c5608e0a github setup change for pipenv 2022-10-26 15:26:53 -04:00
stvnrlly
d27401c7a0 more pipenv transition 2022-10-26 14:05:37 +00:00
stvnrlly
8ad130893d trim rollback from makefile 2022-10-25 19:57:31 +00:00
stvnrlly
cb9e098c65 streamline makefile 2022-10-20 14:04:10 -04:00
stvnrlly
65f15b21b0 uncomment flake8 2022-10-19 16:16:23 +00:00
Ryan Ahearn
cd7da37fa9 Only run pip-audit on runtime dependencies in CI 2022-10-19 10:09:09 -04:00
Ryan Ahearn
56d9ac8e62 Remove obsolete manifest.yml.j2 file 2022-09-02 10:53:00 -04:00
Ryan Ahearn
fb1e6b3e9d Implement bandit static security scan 2022-08-12 17:19:28 -04:00
Ryan Ahearn
51a9207069 Ignore vuln on mistune included via notifications-utils 2022-08-12 15:22:01 -04:00
Ryan Ahearn
2597011cee make audit for python dependency audits 2022-08-12 15:36:48 +00:00
Jim Moffet
b860f9e55a Merge branch 'main' into ch/run-tests-on-ci 2022-08-02 15:29:21 -07:00
James Moffet
18a04fd719 configs 2022-07-25 15:19:05 -07:00
Christa Hartsock
0a0efb1503 Deploy from CI when tests pass 2022-07-07 15:41:16 -07:00
Christa Hartsock
041a892e86 Pull admin base url from test config in tests 2022-07-07 15:41:16 -07:00
Christa Hartsock
af6495cd4c Get tests passing locally
When we cloned the repository and started making modifications, we
didn't initially keep tests in step. This commit tries to get us to a
clean test run by skipping tests that are failing and removing some
that we no longer expect to use (MMG, Firetext), with the intention that
we will come back in future and update or remove them as appropriate.

To find all tests skipped, search for `@pytest.mark.skip(reason="Needs
updating for TTS:`. There will be a brief description of the work that
needs to be done to get them passing, if known. Delete that line to make
them run in a standard test run (`make test`).
2022-07-07 15:41:15 -07:00
Jim Moffet
60262d6031 config formatting 2022-06-13 13:45:07 -07: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
Leo Hemsted
1f3785a7a3 add script to run celery from within docker
as a team we primarily develop locally. However, we've been experiencing
issues with pycurl, a subdependency of celery, that is notoriously
difficult to install on mac. On top of the existing issues, we're also
seeing it conflict with pyproj in bizarre ways (where the order of
imports between pyproj and pycurl result in different configurations of
dynamically linked C libraries being loaded.

You are encouraged to attempt to install pycurl locally, following these
instructions: https://github.com/alphagov/notifications-manuals/wiki/Getting-Started#pycurl

However, if you aren't having any luck, you can instead now run celery
in a docker container.

`make run-celery-with-docker`

This will build a container, install the dependencies, and run celery
(with the default of four concurrent workers).

It will pull aws variables from your aws configuration as boto would
normally, and it will attempt to connect to your local database with the
user `postgres`. If your local database is configured differently (for
example, with a different user, or on a different port), then you can
set the SQLALCHEMY_DATABASE_URI locally to override that.
2022-02-01 16:29:08 +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
Ben Thorner
149976bfab Run tests directly from the Makefile
Contributes to: https://github.com/alphagov/notifications-manuals/issues/9

Precedent: https://github.com/alphagov/notifications-admin/pull/3897
2021-06-16 13:05:55 +01:00
Ben Thorner
d98ea6a8bc Don't try to upgrade DB on CI
This was added by mistake - the Concourse pipeline never did this
previously, and errors if we try (the necessary environment vars
aren't present, even if we wanted to).
2021-06-15 17:33:19 +01:00
Ben Thorner
c89200a833 Fix 'flask db upgrade' not working on CI
Related to: https://github.com/alphagov/notifications-aws/pull/905

Previously this would fail because the Docker image we use for CI
builds doesn't have an 'environment.sh' file; it uses preset env
vars instead. This makes the command to upgrade the DB optional -
if the env file is missing, the error should be self evident.
2021-06-15 09:58:19 +01:00
David McDonald
70c573ae08 Add make help commands for commonly used tasks
if you run `make help` or just `make` then you get a nice list of the
tasks that you can run (or at least, the ones with help text added to
them.

We were missing these for some of the key commands that a developer
would want to know about.

By adding help text to them, they will now show up in `make` or `make
help` and saves a developer needing to go either look in the README or
go look in the Makefile to figure out what commands are available.

Note, there is no particular convention around which commands have help
comments. I don't think we need to figure out this but at the least, the
ones which developers may want to run locally I think should show up.
2021-04-27 12:00:53 +01:00
Ben Thorner
296f8ab376 Run 'test-requirements' as part of 'make test'
This is consistent with our other apps [1]. Although it won't get
picked up by CI just yet [2], we can still benefit from it locally.

[1]: https://github.com/alphagov/document-download-api/blob/master/Makefile#L25
[2]: https://github.com/alphagov/notifications-manuals/issues/9
2021-03-17 09:48:09 +00: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
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
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
Ben Thorner
4c0aea50ae Remove redundant Docker tasks
Nothing and no one uses these.
2021-02-18 09:01:25 +00:00
Leo Hemsted
9e5920472f put manifest in tmp folder
for reasons unknown, using a file descriptor no longer works on
concourse (or in that docker container generally). It might be a change
within cf-cli v7 vs v6.

Either way, it does't work, so use a temporary file. Clean up the
temporary file afterwards.

If the command fails, the temporary file will still stick around, so
I've added the file to the /tmp/ folder instead. it's full of secret
keys and things so if you do have a deployment error while running
locally, you should make sure you clean up the file (make cf-rollback
and make clean will both do this for you).
2020-12-07 18:27:22 +00:00
Leo Hemsted
b019419a5d use cf-cli@v7 in makefile
a bug in cf-cli v6 caused us to get rate limited, one solution to this
is to bump the version of cf-cli we're using to version 7. This has a
few syntax changes as the old v3 commands become mainline.

To upgrade locally, grab the latest version from brew.

```sh
brew install cloudfoundry/tap/cf-cli@7
```
2020-12-07 11:54:12 +00:00
Leo Hemsted
51511450a2 add api-paas-failwhale
for use when we don't want API to serve any traffic, but paas is still
running. It's a simple nginx_buildpack app that is pushed separately,
and then two makefile commands that toggle the routes (and also
stop/start the nginx app).

For all endpoints/methods it returns a 503, with the response body.

```
{
    "status_code": 503,
    "errors": [
        {
            "error": "PlannedMaintenanceError",
            "message": "We’re performing some essential updates. Notify will be back shortly. Please check https://status.notifications.service.gov.uk/ for more details"
        }
    ]
}
```

NB: If you hit `/` it'll still return 404 - as this is defined in the
paas-proxy instance on aws.
2020-05-12 16:04:18 +01:00
Pea Tyczynska
260fd7940d Update healthcheck page - remove travis references
Also remove travis references from the repository
2020-04-24 13:43:00 +01:00
Pea Tyczynska
8a1a59a920 Increase startup timeout to 15 minutes - as it takes longer with 35 minimum instances 2020-04-01 15:11:06 +01:00
David McDonald
5a3110c5ee Reorganise makefile
Also remove `check-env-vars` which is not being used anywhere
2020-03-03 11:51:50 +00:00
David McDonald
07c7e1d91d Remove make commands we don't use
These are either just generally not being used or they've been
superseeded by commands manually written in concourse
2020-03-03 11:51:05 +00:00
David McDonald
218ef97e14 Remove jenkins related code 2020-03-03 11:49:28 +00:00