Skip to content

Commit

Permalink
Merge pull request #352 from ustaxcourt/staging
Browse files Browse the repository at this point in the history
Merge Sprint 45.5 into Migration
  • Loading branch information
mmarcotte authored Aug 14, 2020
2 parents 118cc1e + a40d775 commit 1141188
Show file tree
Hide file tree
Showing 848 changed files with 18,551 additions and 21,497 deletions.
204 changes: 168 additions & 36 deletions .circleci/config.yml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ RUN npm set progress=false && \

COPY . /home/app

COPY web-client/pa11y/package.json /home/app/web-client/pa11y/package.json
COPY web-client/pa11y/package-lock.json /home/app/web-client/pa11y/package-lock.json
RUN npm set progress=false && npm ci --prefix=web-client/pa11y/
COPY ./web-client/pa11y /home/app/web-client/pa11y

RUN mkdir -p /home/app/web-client/cypress/screenshots && \
mkdir -p /home/app/web-client/cypress/videos && \
mkdir -p /home/app/web-client/cypress-smoketests/videos
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile-local
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ RUN npm set progress=false && \

COPY . /home/app

COPY web-client/pa11y/package.json /home/app/web-client/pa11y/package.json
COPY web-client/pa11y/package-lock.json /home/app/web-client/pa11y/package-lock.json
RUN npm set progress=false && npm ci --prefix=web-client/pa11y/
COPY ./web-client/pa11y /home/app/web-client/pa11y

RUN mkdir -p /home/app/web-client/cypress/screenshots && \
mkdir -p /home/app/web-client/cypress/videos && \
mkdir -p /home/app/web-client/cypress-smoketests/videos
Expand Down
80 changes: 0 additions & 80 deletions cypress/integration/create-a-work-item.spec.js

This file was deleted.

2 changes: 2 additions & 0 deletions cypress/integration/public/advanced-search.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const {
enterDocumentDocketNumber,
enterDocumentKeywordForOpinionSearch,
enterPetitionerName,
enterStartDateForOpinionSearch,
navigateTo: navigateToDashboard,
noSearchResultsContainer,
searchForCaseByDocketNumber,
Expand Down Expand Up @@ -41,6 +42,7 @@ describe('Advanced search', () => {
navigateToDashboard();
clickOnSearchTab('opinion');
enterDocumentKeywordForOpinionSearch('opinion');
enterStartDateForOpinionSearch('08/03/1995');
enterDocumentDocketNumber('105-20L');
searchForDocuments();
expect(searchResultsTable()).to.exist;
Expand Down
8 changes: 0 additions & 8 deletions cypress/support/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ exports.viewMyOutbox = () => {
cy.get('button#individual-sent-tab').click();
};

exports.viewMyInbox = () => {
cy.visit('/messages/my/inbox');
};

exports.viewSectionInbox = () => {
cy.visit('/messages/section/inbox');
};

exports.viewSectionOutbox = () => {
cy.get('button.button-switch-box').click();
cy.get('button#section-sent-tab').click();
Expand Down
4 changes: 4 additions & 0 deletions cypress/support/pages/public/advanced-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ exports.enterDocumentKeywordForOpinionSearch = keyword => {
cy.get('input#opinion-search').type(keyword);
};

exports.enterStartDateForOpinionSearch = date => {
cy.get('input#startDate-date').type(date);
};

exports.enterDocumentDocketNumber = docketNumber => {
cy.get('input#docket-number').type(docketNumber);
};
Expand Down
2 changes: 1 addition & 1 deletion docker-smoketests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ docker run -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e EFCMS_DOMAIN=$EFCMS_DOMAIN \
-e ENV=$ENV \
--rm efcms /bin/sh \
-c 'npm run cypress:smoketests && npm run test:pa11y:smoketests'
-c 'npm run cypress:smoketests && npm run test:pa11y:smoketests --prefix=web-client/pa11y/'
14 changes: 8 additions & 6 deletions docker-test-all.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
#!/bin/bash -e

# This runs the same build steps that run in Circle, except sonar
rm -rf node_modules dist .elasticsearch .dynamodb
npm ci
npm i
npm i --prefix=web-client/pa11y/

docker build -t efcms -f Dockerfile-local .

docker run --rm efcms /bin/sh -c 'npm run lint'

docker run --rm efcms /bin/sh -c './run-shellcheck.sh'

docker run -v "$(pwd)/shared/coverage:/home/app/shared/coverage" --rm efcms /bin/sh -c 'npm run test:shared'
docker run -v "$(pwd)/shared/coverage:/home/app/shared/coverage" --rm efcms /bin/sh -c 'npm run test:shared:ci'

docker run -v "$(pwd)/web-api/coverage:/home/app/web-api/coverage" --rm efcms /bin/sh -c 'npm run test:api'
docker run -v "$(pwd)/shared/coverage:/home/app/shared/coverage" --rm efcms /bin/sh -c 'npm run test:client:unit:ci'

docker run -v "$(pwd)/web-api/coverage:/home/app/web-api/coverage" --rm efcms /bin/sh -c 'npm run test:api:ci'

docker run -v "$(pwd)/web-client/coverage:/home/app/web-client/coverage" --rm efcms /bin/sh -c \
'(npm run start:api &) && ./wait-until.sh http://localhost:4000/api/swagger && npm run test:client'
'(npm run start:api &) && ./wait-until.sh http://localhost:4000/api/swagger && npm run test:client:integration'

docker run --rm -e AWS_ACCESS_KEY_ID=noop -e AWS_SECRET_ACCESS_KEY=noop efcms /bin/sh -c \
'(npx run-p start:api start:client:ci &) && ./wait-until.sh http://localhost:4000/api/swagger && ./wait-until.sh http://localhost:1234 && npm run test:pa11y'
'(npx run-p start:api start:client:ci &) && ./wait-until.sh http://localhost:4000/api/swagger && ./wait-until.sh http://localhost:1234 && npm run test:pa11y --prefix=web-client/pa11y/'

docker run --rm -e AWS_ACCESS_KEY_ID=noop -e AWS_SECRET_ACCESS_KEY=noop efcms /bin/sh -c \
'(npx run-p start:api start:client:ci &) && ./wait-until.sh http://localhost:4000/api/swagger && ./wait-until.sh http://localhost:1234 && npm run cypress'
6 changes: 6 additions & 0 deletions docker-test-pa11y.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -e

docker build -t efcms -f Dockerfile-local .

docker run -m 4g --cpus=2 -v "$(pwd)/web-client/coverage:/home/app/web-client/coverage" --rm efcms /bin/sh -c \
'(npm run start:api:ci &) && ./wait-until.sh http://localhost:4000/api/swagger && ./wait-until.sh http://localhost:5000/ 404 && (npx run-p start:client:ci start:public:ci &) && ./wait-until.sh http://localhost:1234/ && ./wait-until.sh http://localhost:5678 && npm run test:pa11y --prefix=web-client/pa11y/'
2 changes: 1 addition & 1 deletion docs/BLUE_GREEN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ We do this by creating two separate stacks for each of our API services, one blu

* Note that the Custom Domain Name under API Gateway will need to be deleted before deploying this to each environment that was previously deployed without blue-green. This is because of what is noted above: Serverless will not overwrite the base path mapping if the current one has a different name.

We attempted to use API Gateway aliases/stages as a simpler solution, but occasionally there is an error in a deploy that requires us to delete a stack. When you delete a stack, the API Gateway record for that stack is also deleted. Because of that, we have to create two separate stacks to allow for deletion of a stack.
We attempted to use API Gateway aliases/stages as a simpler solution, but occasionally there is an error in a deploy that requires us to delete a stack. When you delete a stack, the API Gateway record for that stack is also deleted. Because of that, we have to create two separate stacks to allow for deletion of a stack.
4 changes: 2 additions & 2 deletions docs/CASE_NAMES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

There are several values used throughout the system to identify cases by name.

`caseCaptionWithPostfix`:
`caseCaptionWithPostfix`:
* Not stored directly on the case but can be computed when needed by appending the `CASE_CAPTION_POSTFIX` constant to the `caseCaption`
* Example: `Selma Horn & Cairo Harris, Petitioners v. Commissioner of Internal Revenue, Respondent`

Expand All @@ -19,4 +19,4 @@ There are several values used throughout the system to identify cases by name.
`caseCaptionExtension`:
* Not stored on the case, but can be computed by getting the `caseTitle` and replacing it with '' in the `caseCaption`
* Typically used in PDFs for proper case caption placement
* Example: `Petitioner(s)`
* Example: `Petitioner(s)`
2 changes: 1 addition & 1 deletion docs/CHECKLISTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Due to our code architecture, adding a new endpoint is an involved process. The
- [ ] add the endpoint to `app.js` or `app-public.js` in `./web-api/src`
- [ ] create a `*Proxy.js` file for this new endpoint inside `./shared/src/proxies`
- [ ] update the `./web-client/src/applicationContext.js` file and import the new proxy interactor
- [ ] update the `./web-api/src/applicationContext.js` file and import the new interactor
- [ ] update the `./web-api/src/applicationContext.js` file and import the new interactor
2 changes: 1 addition & 1 deletion docs/IMPORTING_PRACTITIONER_USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ cd web-api

A sample CSV file is included in the repo: [practitioner_users.csv](../web-api/practitioner_users.csv). The data fields should be in the same order as the provided CSV file.

Running the script will generate a log file, `bulk-import-log.txt`. Users that were successfully created will receive an email with login instructions. Any errors will be printed to the log file for further evaluation.
Running the script will generate a log file, `bulk-import-log.txt`. Users that were successfully created will receive an email with login instructions. Any errors will be printed to the log file for further evaluation.
1 change: 1 addition & 0 deletions docs/MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# EF-CMS Migration Documentation

* Cases can be added by POSTing JSON to `/migrate/case`
* Cases Deadlines can be added by POSTing JSON to `/migrate/case-deadline`
* PDF files can be added directly to the PDF S3 bucket, with UUIDV4s referenced as `documentId` in the Case objects.
* Authentication is handled by AWS Cognito. An account with the admin role is required.
* Values are validated using Hapi Joi schema definitions in the [Case](entities/Case.md), [Document](entities/Document.md) and [DocketRecord](entities/DocketRecord.md) entities.
Expand Down
1 change: 1 addition & 0 deletions docs/SCRIPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ The following scripts are used for local development and managing deployments to
|`npm run deploy:api -- ENV`|Deploys the API code in your workspace to AWS.|
|`npm run deploy:ui -- ENV`|Deploys the UI code in your workspace to AWS.|
|`npm run reset-cases ENV`|Removes all cases from DynamoDB and ElasticSearch for an environment in AWS.|
|`npm run reindex:elasticsearch -- ENV`|Deletes and recreates ElasticSearch indices and reindexes all DynamoDB records for an environment in AWS.|
|`npm run destroy:ENV`|Removes all infrastructure resources and data for an environment in AWS.|
4 changes: 2 additions & 2 deletions docs/SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Security

We use a strict Content Security Policy to protect the site against attacks. Parts of the CSP are not as strict as we would like and can possibly be improved on later with dependency upgrades.
We use a strict Content Security Policy to protect the site against attacks. Parts of the CSP are not as strict as we would like and can possibly be improved on later with dependency upgrades.

`script-src` and `style-src` both allow `unsafe-inline` due to the Dynamsoft library used by internal users for scanning paper documents.

Expand All @@ -10,4 +10,4 @@ https://developer.dynamsoft.com/dwt/kb/distribution-deployment/dynamic-web-twain

https://developer.dynamsoft.com/dwt/kb/distribution-deployment/dynamic-web-twain-content-security-policy-violated

If Dynamsoft provides developers with an option to disable inline scripts and styles, `unsafe-inline` can be removed from our CSP.
If Dynamsoft provides developers with an option to disable inline scripts and styles, `unsafe-inline` can be removed from our CSP.
11 changes: 7 additions & 4 deletions docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Web API Terraform stderr: * aws_cognito_user_pool_domain.main: InvalidParamete
Web API Terraform stderr: - minimum field size of 1, DeleteUserPoolDomainInput.UserPoolId.
```

If this error is seen during environment destruction, run `terraform state rm aws_cognito_user_pool_domain.main` to delete the terraform state associated with that resource.
If this error is seen during environment destruction, run `terraform state rm module.ef-cms_apis.aws_cognito_user_pool_domain.main` to delete the terraform state associated with that resource.


### Terraform Deploy: Provided certificate does not exist
Expand All @@ -93,9 +93,12 @@ Error: Error applying plan:

When this happens, re-run the deploy.

### Create Cognito Users (CI deploy)

### aws-xray-sdk version 3.1.0
When updating the environment variables, `ZONE_NAME` and `EFCMS_DOMAIN`, we ran into this error:

We have locked aws-xray-sdk to version 2.5.0 because when upgrading to 3.1.0, an error is thrown during the web-api terraform deploy:
```An error occurred (UsernameExistsException) when calling the SignUp operation: An account with the given email already exists.
An error occurred (NotAuthorizedException) when calling the AdminConfirmSignUp operation: User cannot be confirmed. Current status is CONFIRMED
curl: (3) URL using bad/illegal format or missing URL```
`Error: error archiving file: could not archive missing file`
This happened when duplicate API gateways (i.e., `gateway_api_$ENV`) were created due to a Terraform state sync problem.
4 changes: 2 additions & 2 deletions docs/development-team-process.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Development Team Process

* Typically engineering makes code changes for one story at a time.
* Before starting a story, we’ll review the design with the team and create an initial task list. The views and task list may change as we learn more.
* Typically engineering makes code changes for one story at a time.
* Before starting a story, we’ll review the design with the team and create an initial task list. The views and task list may change as we learn more.
* Check Style guide for common components. If something isn't there, create it.
* All tasks will be listed in story description, including bugs.
* Split tasks into view, presenter, use cases, entities, lambdas, integration, etc. so that we can work on the same story without creating merge conflicts.
Expand Down
Loading

0 comments on commit 1141188

Please sign in to comment.