Skip to content

Commit

Permalink
Merge pull request #1819 from 18F/dependabot/npm_and_yarn/puppeteer-2…
Browse files Browse the repository at this point in the history
…3.6.0

Bump puppeteer from 19.11.1 to 23.6.0
  • Loading branch information
cantsin authored Oct 25, 2024
2 parents 22c893e + b54480c commit 0fbcf66
Show file tree
Hide file tree
Showing 8 changed files with 1,154 additions and 608 deletions.
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "3.0"
services:
app:
application:
build: .
volumes:
- ./tock:/tock
Expand Down Expand Up @@ -28,7 +28,7 @@ services:
- POSTGRES_PASSWORD=tock_password

gulp:
image: node:16.15.0
image: node:23.0.0
volumes:
- .:/tock
- /tock/node_modules
Expand All @@ -40,11 +40,11 @@ services:
context: .
dockerfile: Dockerfile-tests
links:
- app
- application
volumes:
- .:/home/circleci/project
- /home/circleci/project/node_modules
environment:
IS_DOCKER: "true"
TOCK_URL: "http://app:8000"
TOCK_URL: "http://application:8000"
command: /bin/true
4 changes: 2 additions & 2 deletions docs/dependency-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ With pipenv installed locally, you can update development and production depende
pipenv update --dev
```

Within the `app` docker container, the approach is slightly different due to the volumes and working_dir set in `docker-compose.yml`.
Within the `application` docker container, the approach is slightly different due to the volumes and working_dir set in `docker-compose.yml`.

```sh
docker-compose run app bash
docker-compose run application bash
$ pipenv update --dev
$ cp ../Pipfile.lock ./Pipfile.lock
# Exit docker container
Expand Down
54 changes: 47 additions & 7 deletions docs/deployment-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ cloud.gov UAA application for its users.
Tock uses the cloud.gov service account service to provide deployer accounts for
staging and production environments.

### New Relic configuration

Basic New Relic configuration is done in [newrelic.ini](../newrelic.ini), with additional settings
specified via environment variables in each deployment environment's manifest file.

As described in [Environment variables](#cloud-foundry-environment-variables), you will need
to supply the `NEW_RELIC_LICENSE_KEY` as part of each deployment's
[user-provided service](#user-provided-service-ups).

### Code review

Submissions to the Tock codebase are made via GitHub, and are only accepted into the main
Expand All @@ -154,16 +163,47 @@ and checks on security flaws of Tock's dependencies.
Tock uses CircleCI to continuously integrate code, deliver the code to staging
servers, and deploy the latest release to production servers.

Occasionally CircleCI builds will fail with an error like: `FileNotFoundError: [Errno 2] No such file or directory: '/home/circleci/project/.venv/bin/python'.` In this case, it is necessary to modify the `CACHE_VERSION` in the Environment Variables section in the CircleCI Tock Project Settings. (The exact value does not matter, just that the value is changed: this will force new cache dependencies to be built.)
#### Job output

### New Relic environment variables
For each job in a CircleCI workflow, you can view the output of each step in the CircleCI:

Basic New Relic configuration is done in [newrelic.ini](../newrelic.ini), with
additional settings specified in each deployment environment's manifest file.
- Navigate to the CircleCI project dashboard for this organization.
- Click "Projects" in the left nav, then click "tock".
- On the project page, click the "Workflow" link for the workflow run you're interested in. For a PR build, the workflow is named "build_pull_requests".
- Click on the job (for example, "build") that you want to view.
- On the job page, expand the accordion for each step to view its output.

#### Enable verbose logging

To troubleshoot issues within a CircleCI workflow, it may be helpful to configure the project to log more verbose output.

##### Jest and Puppeteer test configuration

In the [jest-puppeteer.config.js](../jest-puppeteer.config.js) file's `module.exports` -> `launch` section:

- Add `'--enable-logging', '--v=1'` to the `args` array
- To log Chrome driver messages to console, add `dumpio: true`

Within `*.test.js` test files, use `console.log()` calls to output debugging information.

##### CircleCI jobs

In [`.circleci/config.yml`](../.circleci/config.yml), add additional steps to output information about the Docker container environment. For example:

```yml
# Add this to jobs -> <job name> -> steps
- run:
name: Report Python, Node, and Chrome versions
command: |
python --version
node --version
google-chrome --version
```
#### Update the CircleCI project cache
Occasionally CircleCI builds will fail with an error like: `FileNotFoundError: [Errno 2] No such file or directory: '/home/circleci/project/.venv/bin/python'.` In this case, it is necessary to modify the `CACHE_VERSION` in the Environment Variables section in the CircleCI Tock Project Settings. (The exact value does not matter, just that the value is changed: this will force new cache dependencies to be built.)

As described in [Environment variables](#cloud-foundry-environment-variables), you will need
to supply the `NEW_RELIC_LICENSE_KEY` as part of each deployment's
[user-provided service](#user-provided-service-ups).

### Staging server

Expand Down
18 changes: 9 additions & 9 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

```shell
docker-compose build
docker-compose run app python manage.py migrate
docker-compose run app python manage.py loaddata test_data/data-update-deduped.json
docker-compose run app \
docker-compose run application python manage.py migrate
docker-compose run application python manage.py loaddata test_data/data-update-deduped.json
docker-compose run application \
python manage.py \
createsuperuser \
--username admin.user \
Expand Down Expand Up @@ -48,20 +48,20 @@ security-focused linter.

To run these tools locally, run:
```sh
docker-compose run app bandit -r . -x manage.py,docker_entrypoint.py
docker-compose run app flake8
docker-compose run application bandit -r . -x manage.py,docker_entrypoint.py
docker-compose run application flake8
```

### Accessing the app container
### Accessing the application container

You'll likely want to run `manage.py` to do other things at some point.
To do this, it's probably easiest to run:

```
docker-compose run app bash
docker-compose run application bash
```

This will run an interactive bash session inside the main app container.
This will run an interactive bash session inside the main application container.
In this container, the `/tock` directory is mapped to the `tock`
directory of the repository on your host; you can run `manage.py` from there.

Expand Down Expand Up @@ -92,7 +92,7 @@ The easiest, most reliable way to test locally is from within the docker contain
which lets you access `manage.py`:

```
docker-compose run app bash
docker-compose run application bash
python manage.py test
```

Expand Down
4 changes: 2 additions & 2 deletions jest-puppeteer.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// These arguments are what jest-puppeteer specifies when running in CI
// (see https://github.com/smooth-code/jest-puppeteer/blob/master/packages/jest-environment-puppeteer/src/readConfig.js#L14-L24)
// (see https://github.com/argos-ci/jest-puppeteer/blob/main/packages/jest-environment-puppeteer/src/config.ts#L55-L63)
const DOCKER_LAUNCH_ARGS = [
"--no-sandbox",
"--disable-setuid-sandbox",
Expand All @@ -16,7 +16,7 @@ module.exports = {

// When running outside Docker, set `headless: false` to show the browser while tests run.
devtools: false,
headless: true,
headless: 'shell', // see: https://github.com/puppeteer/puppeteer/issues/10091#issuecomment-2273275094
},
browserContext: "incognito",
};
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ module.exports = {
notify: true,
preset: 'jest-puppeteer',
testMatch: ['**/*.test.js'],
testTimeout: 30000,
};
Loading

0 comments on commit 0fbcf66

Please sign in to comment.