Skip to content

Commit

Permalink
Merge pull request #266 from flexion/Sprint42
Browse files Browse the repository at this point in the history
Sprint 42
  • Loading branch information
kfoley-18F authored Jun 24, 2020
2 parents 58fcc6d + e09e0ef commit 2880b0f
Show file tree
Hide file tree
Showing 753 changed files with 14,453 additions and 5,821 deletions.
18 changes: 12 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ jobs:
- run:
name: 'Deploy - Web API - Serverless - Practitioners - us-east-1'
command: docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "CIRCLE_HONEYBADGER_API_KEY=${CIRCLE_HONEYBADGER_API_KEY}" -e "IRS_SUPERUSER_EMAIL=${IRS_SUPERUSER_EMAIL}" -v $(pwd)/.cache:/home/app/.cache --rm efcms /bin/sh -c "./web-api/run-serverless-practitioners.sh ${ENV} us-east-1"
- run:
name: 'Deploy - Web API - Serverless - Messages - us-east-1'
command: docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "CIRCLE_HONEYBADGER_API_KEY=${CIRCLE_HONEYBADGER_API_KEY}" -e "IRS_SUPERUSER_EMAIL=${IRS_SUPERUSER_EMAIL}" -v $(pwd)/.cache:/home/app/.cache --rm efcms /bin/sh -c "./web-api/run-serverless-messages.sh ${ENV} us-east-1"
- run:
name: 'Deploy - Web API - Serverless - Notifications - us-east-1'
command: docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "CIRCLE_HONEYBADGER_API_KEY=${CIRCLE_HONEYBADGER_API_KEY}" -e "IRS_SUPERUSER_EMAIL=${IRS_SUPERUSER_EMAIL}" -v $(pwd)/.cache:/home/app/.cache --rm efcms /bin/sh -c "./web-api/run-serverless-notifications.sh ${ENV} us-east-1"
Expand Down Expand Up @@ -476,6 +479,9 @@ jobs:
- run:
name: 'Deploy - Web API - Serverless - Practitioners - us-west-1'
command: docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "CIRCLE_HONEYBADGER_API_KEY=${CIRCLE_HONEYBADGER_API_KEY}" -e "IRS_SUPERUSER_EMAIL=${IRS_SUPERUSER_EMAIL}" -v $(pwd)/.cache:/home/app/.cache --rm efcms /bin/sh -c "./web-api/run-serverless-practitioners.sh ${ENV} us-west-1"
- run:
name: 'Deploy - Web API - Serverless - Messages - us-west-1'
command: docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "CIRCLE_HONEYBADGER_API_KEY=${CIRCLE_HONEYBADGER_API_KEY}" -e "IRS_SUPERUSER_EMAIL=${IRS_SUPERUSER_EMAIL}" -v $(pwd)/.cache:/home/app/.cache --rm efcms /bin/sh -c "./web-api/run-serverless-messages.sh ${ENV} us-west-1"
- run:
name: 'Deploy - Web API - Serverless - Notifications - us-west-1'
command: docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "CIRCLE_HONEYBADGER_API_KEY=${CIRCLE_HONEYBADGER_API_KEY}" -e "IRS_SUPERUSER_EMAIL=${IRS_SUPERUSER_EMAIL}" -v $(pwd)/.cache:/home/app/.cache --rm efcms /bin/sh -c "./web-api/run-serverless-notifications.sh ${ENV} us-west-1"
Expand All @@ -502,10 +508,10 @@ jobs:
# command: docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" --rm efcms /bin/sh -c "cd web-api && ./switch-environment-color.sh ${ENV}"
- run:
name: 'Deploy - Web Client - S3'
command: docker run -e "DYNAMSOFT_URL_OVERRIDE=${DYNAMSOFT_URL_OVERRIDE}" -e "ENV=${ENV}" -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "COGNITO_SUFFIX=${COGNITO_SUFFIX}" -e "CIRCLE_SHA1=${CIRCLE_SHA1}" -e "CIRCLE_HONEYBADGER_API_KEY=${CIRCLE_HONEYBADGER_API_KEY}" --rm efcms /bin/sh -c "./web-client/build-dist.sh $ENV && aws s3 sync dist s3://ui-${ENV}.${EFCMS_DOMAIN} --delete && aws s3 sync dist s3://failover-ui-${ENV}.${EFCMS_DOMAIN} --delete"
command: docker run -e "DYNAMSOFT_URL_OVERRIDE=${DYNAMSOFT_URL_OVERRIDE}" -e "ENV=${ENV}" -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "COGNITO_SUFFIX=${COGNITO_SUFFIX}" -e "CIRCLE_SHA1=${CIRCLE_SHA1}" -e "CIRCLE_HONEYBADGER_API_KEY=${CIRCLE_HONEYBADGER_API_KEY}" --rm efcms /bin/sh -c "./web-client/build-dist.sh $ENV && aws s3 sync dist s3://ui-${ENV}.${EFCMS_DOMAIN} --delete && aws s3 cp s3://ui-${ENV}.${EFCMS_DOMAIN}/index.html s3://ui-${ENV}.${EFCMS_DOMAIN}/index.html --metadata-directive REPLACE --cache-control max-age=0 && aws s3 sync dist s3://failover-ui-${ENV}.${EFCMS_DOMAIN} --delete --cache-control no-cache && aws s3 cp s3://failover-ui-${ENV}.${EFCMS_DOMAIN}/index.html s3://failover-ui-${ENV}.${EFCMS_DOMAIN}/index.html --metadata-directive REPLACE --cache-control max-age=0"
- run:
name: 'Deploy - Public Web Client - S3'
command: docker run -e "ENV=${ENV}" -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "COGNITO_SUFFIX=${COGNITO_SUFFIX}" -e "CIRCLE_SHA1=${CIRCLE_SHA1}" --rm efcms /bin/sh -c "./web-client/build-dist-public.sh $ENV && aws s3 sync dist-public s3://ui-public-${ENV}.${EFCMS_DOMAIN} --delete && aws s3 sync dist-public s3://failover-ui-public-${ENV}.${EFCMS_DOMAIN} --delete"
command: docker run -e "ENV=${ENV}" -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "EFCMS_DOMAIN=${EFCMS_DOMAIN}" -e "COGNITO_SUFFIX=${COGNITO_SUFFIX}" -e "CIRCLE_SHA1=${CIRCLE_SHA1}" --rm efcms /bin/sh -c "./web-client/build-dist-public.sh $ENV && aws s3 sync dist-public s3://ui-public-${ENV}.${EFCMS_DOMAIN} --delete && aws s3 cp s3://ui-public-${ENV}.${EFCMS_DOMAIN}/index.html s3://ui-public-${ENV}.${EFCMS_DOMAIN}/index.html --metadata-directive REPLACE --cache-control max-age=0 && aws s3 sync dist-public s3://failover-ui-public-${ENV}.${EFCMS_DOMAIN} --delete --cache-control no-cache && aws s3 cp s3://failover-ui-public-${ENV}.${EFCMS_DOMAIN}/index.html s3://failover-ui-public-${ENV}.${EFCMS_DOMAIN}/index.html --metadata-directive REPLACE --cache-control max-age=0"

post-deploy:
machine:
Expand Down Expand Up @@ -533,22 +539,22 @@ jobs:
- run:
name: 'Deploy - Web API - Cognito Create Users'
command: |
if [ "${CIRCLE_BRANCH}" == "staging" ] || [ "${CIRCLE_BRANCH}" == "irs" ]; then
if [ "${CIRCLE_BRANCH}" == "develop" ] || [ "${CIRCLE_BRANCH}" == "staging" ] || [ "${CIRCLE_BRANCH}" == "irs" ] || [ "${CIRCLE_BRANCH}" == "experimental1" ] || [ "${CIRCLE_BRANCH}" == "experimental2" ] ; then
docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "USTC_ADMIN_PASS=${USTC_ADMIN_PASS}" --rm efcms /bin/sh -c "cd web-api && ./setup-cognito-users.sh ${ENV}"
else
echo "skipping…"
fi
- run:
name: 'Deploy - Web API - Cognito Create Court Users'
command: |
if [ "${CIRCLE_BRANCH}" == "staging" ] || [ "${CIRCLE_BRANCH}" == "test" ]; then
command: |
if [ "${CIRCLE_BRANCH}" == "develop" ] || [ "${CIRCLE_BRANCH}" == "staging" ] || [ "${CIRCLE_BRANCH}" == "test" ] || [ "${CIRCLE_BRANCH}" == "experimental1" ] || [ "${CIRCLE_BRANCH}" == "experimental2" ]; then
docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "USTC_ADMIN_PASS=${USTC_ADMIN_PASS}" --rm efcms /bin/sh -c "cd web-api && ./setup-court-users.sh ${ENV}"
else
echo "skipping…"
fi
- run:
name: 'Deploy - Web API - Cognito Create IRS User'
command: |
command: |
if [ "${CIRCLE_BRANCH}" == "irs" ]; then
docker run -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "USTC_ADMIN_PASS=${USTC_ADMIN_PASS}" --rm efcms /bin/sh -c "cd web-api && ./setup-irs-user.sh ${ENV}"
else
Expand Down
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ module.exports = {
'promise/catch-or-return': 'off',
},
},
{
files: [
'web-client/integration-tests/**/*.js',
'web-client/integration-tests-public/**/*.js',
],
rules: {
'jest/expect-expect': 'off',
},
},
],
parser: 'babel-eslint',
parserOptions: {
Expand Down Expand Up @@ -218,6 +227,7 @@ module.exports = {
'dynamsoft',
'efcms',
'elasticsearch',
'enum',
'eslint',
'falsy',
'fieldset',
Expand Down Expand Up @@ -324,6 +334,7 @@ module.exports = {
'textarea',
'thorton',
'thortons',
'todays',
'touchmove',
'transferee',
'truthy',
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM cypress/base:12.16.0

RUN echo "recache again"
FROM cypress/base:12.16.2

WORKDIR /home/app

Expand Down Expand Up @@ -46,6 +44,7 @@ ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
COPY package.json /home/app/package.json
COPY package-lock.json /home/app/package-lock.json
RUN npm set progress=false && \
npm config set puppeteer_skip_chromium_download true && \
npm i

COPY . /home/app
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ For documentation about the CI/CD setup, API, style guide, UX, code review, etc.

<a href="docs/images/aws-diagram.png"><img src="docs/images/aws-diagram.png" style="border: 2px solid #000;" /></a>

## Dependency diagrams

- <a href="docs/images/client-dependencies.jpg">Client</a>
- <a href="docs/images/server-dependencies.jpg">Server</a>

## Backlog

The backlog is stored [in GitHub Issues in Flexion’s repository](https://github.com/flexion/ef-cms/issues), _not_ on this repository. Although they can be viewed like any other GitHub issues, they are managed on a scrum board that requires the [ZenHub browser plugin](https://www.zenhub.com/) to see.
Expand Down
4 changes: 0 additions & 4 deletions cypress/integration/assign-a-work-item-to-self.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ const {
} = require('../support/pages/dashboard');

describe('Assign a work item ', () => {
before(() => {
cy.task('seed');
});

it('views the section inbox', () => {
navigateToDashboard('petitionsclerk');
viewDocumentQCSectionInbox();
Expand Down
1 change: 0 additions & 1 deletion cypress/integration/create-a-work-item.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const {

describe('Create a work item ', () => {
before(() => {
cy.task('seed');
navigateToDocumentDetail(
'petitionsclerk',
'104-19',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const {

describe('Edit a case caption from case detail header', function () {
before(() => {
cy.task('seed');
navigateToCaseDetail('docketclerk', '101-19');
getActionMenuButton().click();
getEditCaseCaptionButton().click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const {

describe('change the case caption via the petition qc page', () => {
before(() => {
cy.task('seed');
navigateToPetitionQc(
'petitionsclerk',
'101-19',
Expand Down
8 changes: 6 additions & 2 deletions cypress/integration/file-a-petition.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ let createdDocketNumber;

describe('File a petition', function () {
before(() => {
cy.task('seed');
cy.login('petitioner');
});

Expand Down Expand Up @@ -189,15 +188,20 @@ describe('creation form', () => {
});

it('submits forms and redirects to the file petition success page', () => {
cy.get('button#submit-case').scrollIntoView().click();

cy.server();
cy.route('POST', '**/cases').as('postCase');
cy.get('button#submit-case').scrollIntoView().click();
cy.wait('@postCase');
cy.get('@postCase').should(xhr => {
// eslint-disable-next-line jest/valid-expect
expect(xhr.responseBody).to.have.property('docketNumber');
createdDocketNumber = xhr.responseBody.docketNumber;
});

// wait for elasticsearch to refresh
cy.wait(1000);

cy.url().should('include', 'file-a-petition/success');
cy.get('a#button-back-to-dashboard').click();
});
Expand Down
4 changes: 3 additions & 1 deletion cypress/integration/file-an-answer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const {

describe('Filing an Answer', function () {
before(() => {
cy.task('seed');
cy.login('irsPractitioner', '/case-detail/102-19');
});

Expand Down Expand Up @@ -43,6 +42,9 @@ describe('Filing an Answer', function () {
});

it('reflects changes to 102-19 by showing it in irsPractitioner case list', () => {
// wait for elasticsearch to refresh
cy.wait(1000);

navigateToDashboard('irsPractitioner');
cy.get('table#case-list').find('a').should('contain', '102-19');
});
Expand Down
7 changes: 5 additions & 2 deletions cypress/integration/petitions-clerk-creates-a-case.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const {

describe('Create case and submit to IRS', function () {
before(() => {
cy.task('seed');

navigateToDocumentQC('petitionsclerk');

getCreateACaseButton().click();
Expand All @@ -29,4 +27,9 @@ describe('Create case and submit to IRS', function () {
expect(xhr.responseBody).to.have.property('docketNumber');
});
});

it('should display a confirmation modal when the user clicks cancel on the review page', () => {
cy.get('button#cancel-create-case').scrollIntoView().click();
cy.get('div.modal-header').should('exist');
});
});
4 changes: 0 additions & 4 deletions cypress/integration/public/advanced-search.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const {
} = require('../../support/pages/public/advanced-search');

describe('Advanced search', () => {
before(() => {
cy.task('seed');
});

describe('case - by name', () => {
it('should route to case detail when a match is found and the user clicks on the docket record link in the table', () => {
navigateToDashboard();
Expand Down
4 changes: 0 additions & 4 deletions cypress/integration/start-a-case-practitioner.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ const {
const { fillInAndSubmitForm } = require('../support/pages/start-a-case');

describe('Start a case as a practitioner ', () => {
before(() => {
cy.task('seed');
});

it('go to the practitioner dashboard and expect that a case list table is displayed with 3 cases', () => {
navigateToDashboard('privatePractitioner');
getCaseList().should('have.length', 3);
Expand Down
3 changes: 3 additions & 0 deletions cypress/support/pages/start-a-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ exports.fillInAndSubmitForm = () => {
// step 5
cy.get('button#submit-case').scrollIntoView().click();

// wait for elasticsearch to refresh
cy.wait(3000);

// success page
cy.url().should('include', 'file-a-petition/success');
cy.get('a#button-back-to-dashboard').click();
Expand Down
9 changes: 9 additions & 0 deletions docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,12 @@ To revert your `serverless-prune-plugin`, just change `before` back to `after` o
This error often occurs when we are indexing too many dynamic keys or nested objects with Elasticsearch and reach our total field limit.

The script will output data related to the mapping for the environment and can help pinpoint areas to look into further. To filter data from indexing, add fields or keys to the filtering functions in `processStreamRecordsInteractor.js`.


### NotFoundException when calling the GetDomainName

This error occurs when code changes do not cause the checksums of the files to change. In order to redeploy, the file must have a different checksum than what is recorded in the database.

#### Solution

Delete checksums from the environment dynamo table that is failing. For example, if the dev deploy is failing, navigate to the efcms-deploy-dev table in AWS and delete all the check-sum-** items.
2 changes: 1 addition & 1 deletion docs/entities/Case.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
-
name: "pattern"
args:
regex: "/^(\\d{3,5}-\\d{2})$/"
regex: "/^([1-9]\\d{2,4}-\\d{2})$/"
docketNumberSuffix:
type: "string"
flags:
Expand Down
Loading

0 comments on commit 2880b0f

Please sign in to comment.