Commit Graph

129 Commits

Author SHA1 Message Date
Kenneth Kehl
026dc14021 notify-api-412 use black to enforce python style standards 2023-08-23 10:35:43 -07:00
Carlo Costino
574e0b92fc Merge pull request #404 from GSA/notify-api-391
notify-api-391 increase code coverage to 95%
2023-08-16 16:40:33 -04:00
Kenneth Kehl
fbf2f99d7b more 2023-08-15 10:35:34 -07:00
Steven Reilly
b731dd5abe Merge pull request #402 from GSA/notify-api-387
notify-api-387 Scan projects for unused code
2023-08-14 13:52:38 -04:00
Kenneth Kehl
b4a2f37ca9 get coverage up to 94% 2023-08-14 09:04:06 -07:00
Kenneth Kehl
318bb01392 more 2023-08-10 12:58:52 -07:00
Kenneth Kehl
afcc324049 notify-api-391 increase code coverage to 95% 2023-08-09 08:33:20 -07:00
Kenneth Kehl
320798e417 notify-api-387 Scan projects for unused code 2023-08-08 11:03:50 -07:00
Kenneth Kehl
8fe5ca202a change failure to be C, D or F 2023-08-07 10:59:51 -07:00
Kenneth Kehl
aef5317af8 notify-api-386 scan projects for code complexity 2023-08-07 10:11:24 -07:00
Kenneth Kehl
831af284a5 notify-admin-638 fail if code coverage below current level of 88% 2023-07-20 13:32:19 -07:00
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