Commit Graph

117 Commits

Author SHA1 Message Date
Carlo Costino
40de352f9e Update README with new instructions and improve setup
This changeset updates the README.md file with a set of entirely new instructions. These updates are intended to improve clarity, simplify steps, and reduce confusion and environment-setup gotchas that folks have run into previously and we have learned from. A couple of other changes are also included:

- Minor adjustments to the Makefile to improve make bootstrap
- Updates to the sample.env file to include previously missing required environment variables and/or information
- Additional support for Python virtual environments
- Removes tracking of the .python-version file used by pyenv

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-11-22 14:05:20 -05:00
Carlo Costino
09c4dd2e1d Update more dependencies and fix notifications-utils
This changeset updates a few more dependencies and addresses the challenges we have had in keeping the notifications-utils dependency up-to-date.  The changes include instructions on what to do going forward for future notifications-utils updates.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-11-01 12:16:35 -04:00
Carlo Costino
88f0715b2c Updated dependencies and add make command
This changeset updates several dependencies to address security audit findings and also adds a py-lock make command to make managing our Python dependencies more manageable.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-10-30 16:01:21 -04:00
Kenneth Kehl
e8d7d91402 switch from pipenv to poetry 2023-09-01 07:56:02 -07:00
Kenneth Kehl
51b6c38e2f refresh PR? 2023-08-25 12:58:53 -07:00
Carlo Costino
d79e15c2a1 Clean up state of E2E tests
This changeset takes care of leaving E2E tests in a clean state so that
we can revisit the work later.  The efforts to add authentication
support did not pan out, so we will go a different route in the near
future.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-08-24 15:31:21 -04:00
Steven Reilly
9fc44a352b Merge branch 'main' into notify-api-387 2023-08-22 17:45:04 -04:00
Kenneth Kehl
621c381de8 add dead code command to Makefile 2023-08-08 13:16:20 -07:00
Kenneth Kehl
d36c70ed16 notify-api-387 scan projects for unused code 2023-08-08 12:12:15 -07:00
Kenneth Kehl
b92f386290 notify-api-387 scan projects for unused code 2023-08-08 11:00:09 -07:00
Kenneth Kehl
4dd3679c4f change failure to be C, D, or F 2023-08-07 10:58:32 -07:00
Kenneth Kehl
1ddc821dd1 notify-api-386 scan projects for code complexity 2023-08-07 10:41:07 -07:00
Steven Reilly
eec2caa6e4 Merge branch 'main' into notify-admin-638 2023-07-28 11:04:45 -04:00
Carlo Costino
b5664c3d20 Add support for E2E (end-to-end) tests (#625)
This changeset lays the foundation for supporting E2E (end-to-end) integration tests for US Notify.  It brings in the Playwright testing framework along with the Playwright pytest plugin to make this possible, and includes the following adjustments:

- A new test session fixture for ensuring that Playwright authenticates with the sites that are currently behind HTTP Auth (requies env-var config)
- A new end_to_end test directory specifically for E2E tests
- Updates to the Makefile that make sure E2E tests are not run as a part of the normal test routine but can be run separately
- A new command in the Makefile to run E2E tests that will run in Chromium, Firefox, and Webkit headless browsers

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-07-28 09:31:45 -04:00
Kenneth Kehl
6188f7bc74 notify-admin-638 adjust coverage report to fail under 96% 2023-07-20 13:20:22 -07:00
Andrew Shumway
948ee68193 Added code coverage test to pipfile/makefile/workflow (#472)
Co-authored-by: stvnrlly <steven.reilly@gsa.gov>
2023-04-28 11:17:02 -04:00
Ryan Ahearn
80184a98fd Remove ignore-vulnerability line for remediated redis vuln 2023-03-29 16:55:42 -04:00
Ryan Ahearn
1fe0ad0d83 Ignore known issue with redis 4.5.3 2023-03-28 09:16:09 -04:00
Ryan Ahearn
703847e184 Respect HTTP_PROTOCOL config when forcing https 2023-03-08 10:48:22 -05:00
Ryan Ahearn
73a3511ef2 Remove uses of inline-styles 2023-03-08 09:08:07 -05:00
Ryan Ahearn
23f6f3c726 Report data to newrelic 2023-01-23 10:00:03 -05:00
Ryan Ahearn
197c17c1a9 Update pip-audit gh action 2023-01-03 09:59:27 -05:00
stvnrlly
e44fe2eb11 switch to pipenv 2022-11-08 09:44:09 -05:00
Ryan Ahearn
c045771b76 Run js-lint as part of the full test target 2022-10-27 16:01:54 +00:00
Ryan Ahearn
98b772f959 Separate test and lint steps 2022-10-27 11:10:13 -04:00
Ryan Ahearn
773cd99790 Only run pip-audit on runtime dependencies in CI 2022-10-19 10:39:46 -04:00
jimmoffet
3121e7bc47 update reqs to use GSA/notifications-utils 2022-09-06 18:34:30 -07:00
Ryan Ahearn
251ac133b5 Source nvmsh as part of a11y-scan 2022-09-02 13:29:56 -04:00
Ryan Ahearn
dfea3ac848 Install pa11y-ci 2022-08-30 10:37:33 -04:00
Ryan Ahearn
8b6210eedb Add python static scan task 2022-08-26 14:12:26 +00:00
Ryan Ahearn
fa7b1a41b8 Add python and npm audits to checks.yml 2022-08-25 16:55:33 -04:00
Ryan Ahearn
bdee795f56 Switch first nvm source to --no-use instead of --install 2022-08-09 09:23:47 -04:00
Ryan Ahearn
3ff922bb07 Source nvm from either $HOME or /usr/local/share 2022-08-08 14:43:13 -04:00
jimmoffet
dad051a662 2767 passing 2022-08-05 00:25:03 -07:00
Jim Moffet
e17c26d1f6 config buckets 2022-06-23 14:08:29 -07:00
Jim Moffet
18eefc87c0 clean makefile 2022-06-13 14:31:51 -07:00
Jim Moffet
2b727e13b4 local dev upgrades 2022-06-13 14:26:46 -07:00
Ben Thorner
b348e8ed03 Add better-npm-audit to check production packages
This is the same as [^1].

[^1]: https://github.com/alphagov/document-download-frontend/pull/120
2022-05-09 12:05:42 +01:00
Ben Thorner
d97ed69f0b Turn off NPM auditing on installation
This isn't useful as it mostly pertains to dev dependencies, where
we're not concerned about vulnerabilities as they run in isolation.
2022-05-06 12:31:52 +01:00
Richard Baker
799949a3f4 Add .nvmrc & use NVM to manage installed Node version
We have decided to use NVM to manage installed Node versions locally
and in CI to ensure they match and produce consistent builds.

Running `nvm install` will install the Node version specified in the
`.nvmrc` file.

This is now consistent with Document Download Frontend.
See: alphagov/document-download-frontend#114

Signed-off-by: Richard Baker <richard.baker@digital.cabinet-office.gov.uk>
2022-04-05 12:09:53 +01:00
Chris Hill-Scott
795fd8f91d Add Makefile command to watch for frontend changes
When editing CSS, Javascript or other assets it’s useful to not have to
run `gulp` manually to rebuild things after making changes.

This is why we have the `npm watch` script.

However for the paths to fonts to resolve properly when running locally
it needs the `NOTIFY_ENVIRONMENT` variable set to `development`. Having
to remember to do both of these steps every time is awkward.

For a one-off build of the frontend we added a command to set
`NOTIFY_ENVIRONMENT` to the appropriate value in https://github.com/alphagov/notifications-admin/pull/4049

This commit does the same thing for the watch task, by encapsulating
both steps in one `make` command.

Happy to take alternative suggestions on command naming.
2021-11-02 15:22:57 +00:00
Ben Thorner
1869f9a53a Fix static assets in development (again)
Previous attempt: https://github.com/alphagov/notifications-admin/pull/4048

The problem with the previous attempt is that the assets built on
CI become part of the build artefact used for production [1]. This
switches back to my original approach of using environment.sh, but
with a technique to cope with it being absent on CI. I've tested it
works with and without an environment.sh file.

Note that "npm install" is fine to be on a separate line, since a
non-zero exit code will always cause "make" to stop.

[1]: https://github.com/alphagov/notifications-aws/blob/master/concourse/templates/admin.yml.j2#L47
2021-10-19 11:08:17 +01:00
Ben Thorner
f8d97821a2 Fix broken CSS links to assets in development
This depends on an environment variable being set when the assets
are built in a development context [1]. Otherwise, the assets get
their '/static' prefix stripped like they do for production, which
isn't compatible with serving them under '/static' in development.

[1]: 66e5022198/gulpfile.js (L37-L41)
2021-10-18 17:32:28 +01:00
Chris Hill-Scott
5c94aa004e Remove deprecated command line flag to isort
> Prior to version 5.0.0, isort wouldn't automatically traverse directories. The --recursive option was necessary to tell it to do so. In 5.0.0 directories are automatically traversed for all Python files, and as such this option is no longer necessary and should simply be removed.

— https://github.com/PyCQA/isort/blob/main/docs/upgrade_guides/5.0.0.md#--recursive-or--rc

***

We moved to version `> 5.0.0` of isort in March 2021: https://github.com/alphagov/notifications-admin/pull/3828/files
2021-10-04 14:58:29 +01:00
Tom Byers
5115344927 Remove rebuild of node-sass from bootstrap
We now use `sass`, a JavaScript version of Sass,
compiled from dart-sass*, so shouldn't need to
rebuild it to solve issues with C libraries.

*https://github.com/sass/dart-sass
2021-09-22 12:05:48 +01:00
Ben Thorner
ca9c28d08f Merge pull request #3897 from alphagov/remove-run-tests
Run tests directly from the Makefile
2021-06-16 14:02:44 +01:00
David McDonald
f4dc9e15e1 Add help text for new make steps
Helpful for when you run `make` as you've forgotten what the command is
and you don't want to go find the readme
2021-05-25 11:21:39 +01:00
Ben Thorner
66ffc0e29b Run tests directly from the Makefile
Depends on: https://github.com/alphagov/notifications-aws/pull/905

Previously this would print some custom text with each step, and
as optionally loading a virtual environment. This moves the actual
test commands to the Makefile. While this no longer prints custom
text, it does print the command that was run:

Before (skipping other output):

  ./scripts/run_tests.sh
  Code style check passed
  Import order check passed
  ...
  JavaScript tests have passed
  ...
  Unit tests have passed

After (skipping other output):

  flake8 .
  isort --check-only ./app ./tests
  npm test
  ...
  py.test -n auto --maxfail=10 tests/
  ...

I think it's more useful to see the command being run, rather than
having to wait until it succeeds to know what was happening. Having
the command also makes it easier to run it again if it fails, rather
than having to go and find it in a script.
2021-05-24 15:39:36 +01:00
Leo Hemsted
5d2b18e501 bump pip-tools when freezing dependencies
to stop big diffs from change in formatting of reqs.txt
2021-04-08 11:09:39 +01:00
Ben Thorner
c5e528efa2 Fix typo in Makefile (not running 'npm install') 2021-02-26 17:54:43 +00:00