Skip to content

Commit

Permalink
Merge pull request #5385 from ustaxcourt/staging
Browse files Browse the repository at this point in the history
merge staging into prod 09-20-2024
  • Loading branch information
jtdevos authored Sep 22, 2024
2 parents e01e6a1 + e43eacc commit f068e7d
Show file tree
Hide file tree
Showing 74 changed files with 7,315 additions and 4,360 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
orbs:
git-shallow-clone: guitarrapc/[email protected]

efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.9
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.10

parameters:
run_build_and_deploy:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN apt-get install -y build-essential
RUN apt-get install -y libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.17.46.zip" -o "awscliv2.zip" && \
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.17.49.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { petitionsClerkCreatesTrialSession } from '../../../../helpers/trialSess
faker.seed(faker.number.int());

describe('trial sessions', () => {
it('verify the auto fill functionality for chambers phone number works when selectin a judge', () => {
it('verify the auto fill functionality for chambers phone number works when selecting a judge', () => {
loginAsPetitionsClerk1();
petitionsClerkCreatesTrialSession().then(trialSessionId => {
cy.get('[data-testid=new-trial-sessions-tab]').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ describe('Trial Session Paper Pdf', { scrollBehavior: 'center' }, () => {
);
cy.visit(`/edit-trial-session/${createdTrialSessionId}`);
cy.get('[data-testid="trial-session-judge"]').select('Colvin');
cy.get('[data-testid="trial-session-judge"] option:selected').should(
'have.text',
'Colvin',
);
cy.get('[data-testid="submit-edit-trial-session"]').click();
cy.url().should('include', 'print-paper-trial-notices');
cy.get('[data-testid="printing-complete"]').click();
Expand Down
27 changes: 27 additions & 0 deletions docs/operations/runbooks/add-or-update-judge-user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Adding or Updating a Judge User

## Description
This runbook describes the process of onboarding or updating a Judge user. DO NOT use this runbook to offboard a judge. Instead, see `offboard-judge-user.md`.

## Preqrequisites
- `add-judge.ts`, `update-judge.ts` (see these scripts for usage details)
- Environment switcher config, `set-env.sh`
- AWS access (DynamoDB and Cognito)
- Standard development setup described in `running-locally.md`

## Steps for Adding or Updating a Judge User
1. If you want the new judge (or updated judge information) to be available in deployed environments other than test/prod, you will need to add or update the judge information in `judge_users.csv`. (There are plenty of examples in the CSV to guide you.) Once deployed in the given environment, these changes will take effect.
2. If you want the new judge (or updated judge information) to be available locally and in CI, you will need to add or update the judge information in `efcms-local.json`. Look at the other judge users (you can search the file for `judgeFullName`) for guidance.
3. To update the test environment: Use the environment switcher and run `add-judge.ts` or `update-judge.ts` according to your needs, e.g.:
```
source ./scripts/env/set-env.zsh ustc-test
npx ts-node --transpile-only ./scripts/user/add-judge.ts ...
```
These scripts will add/update the appropriate user records in Cognito and Dynamo.
4. To update the production environment: If you have access to the production environment, run either `add-judge.ts` or `update-judge.ts` as above. If you do not have access, hand off to a USTC engineer, linking to this documentation.

## Caveat
If you update the name of a judge, their chambers section will be updated as well. However, as of 4 September 2024, we do not have anything that prevents a stale edit from overwriting an update. In other words, the following is possible:
- An admin begins to update a chambers user
- The script to update the judge's name is run
- The admin finishes the updates to the chambers user (in principle up to 24 hours later), overwriting that user's newly updated chambers section
31 changes: 16 additions & 15 deletions docs/operations/runbooks/offboard-judge-user.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
# Offboarding a Judge user

## Description
This runbook describes the process of offboarding a Judge user if they no longer work with the US Tax Court, for whatever reason. This will mark the Judge as a "legacy" Judge, meaning they won't be an available choice for assigment on any active work in DAWSON, but will still be available in places where legacy Judges should be, e.g. Order & Opinion searches.
This runbook describes the process of offboarding a Judge user if they no longer work with the US Tax Court, for whatever reason. This will mark the Judge as a "legacy" Judge, meaning they won't be an available choice for assignment on any active work in DAWSON, but will still be available in places where legacy Judges should be, e.g. Order & Opinion searches.

Since completing this runbook in its entirety requires access to USTC environments, this runbook includes a handoff to a USTC Engineer with the necessary priveleges to adminster USTC environments.
Since completing this runbook in its entirety requires access to USTC environments, this runbook includes a handoff to a USTC Engineer with the necessary privileges to administer USTC environments.

## Preqrequisites
## Prerequisites
- `offboard-judge-user.sh`
- Environment switcher config, `set-env.sh`
- AWS access (DynamoDB and Cognito)
- Standard development setup described in `running-locally.md`
- The Judge being offboarded should not have any active cases / trials / etc. assigned to them. (Check with the PO for whether or not this has happened)

## Steps
1. In `judge_users.csv`, find the Judge to be offboared. Change their role from `judge` to `legacyJudge` and their section from `{judgeName}Chambers` to `legacyJudgeChambers`. For example:
### To Update the Judge User in Deployed Environments Other Than Test/Prod
1. In `judge_users.csv`, find the Judge to be offboarded. Change their role from `judge` to `legacyJudge` and their section from `{judgeName}Chambers` to `legacyJudgeChambers`. For example:
```
Colvin,Judge,John O. Colvin,[email protected],judge,colvinsChambers,true
Colvin,Judge,John O. Colvin,[email protected],judge,colvinsChambers,true,(123) 123-1234
```
becomes
```
Colvin,Judge,John O. Colvin,[email protected],legacyJudge,legacyJudgesChambers,true
Colvin,Judge,John O. Colvin,[email protected],legacyJudge,legacyJudgesChambers,true,(123) 123-1234
```
2. Remove their chambers from the list of valid sections in `add-user.ts`
3. In `getJudgesChambers.ts`, add `isLegacy: process.env.USTC_ENV === 'prod',` to their chambers section. This marks their chambers section as legacy in deployed environments so that they no longer show up in select inputs for selecting a Judge's chambers.
4. Check for and fix any smoke tests that rely upon the Judge being offboarded or their chambers. This process leaves the Judge user active in environments relying on 'local' data (e.g. developer machines, CI pipeline), so other tests relying only on 'local' data should not be impacted.
5. Deploy the change. Deployment takes care of all offboarding in environments other than **test** and **prod**
6. Using the environment switcher, source `ustc-test`
2. Check for and fix any smoke tests that rely upon the Judge being offboarded or their chambers. This process leaves the Judge user active in environments relying on 'local' data (e.g. developer machines, CI pipeline), so other tests relying only on 'local' data should not be impacted.
3. Once you deploy to the environment, your changes will take effect.

### To Update the Judge User in Test
1. Using the environment switcher, source `ustc-test`
```
source ./scripts/env/set-env.zsh ustc-test
```
7. run `offboard-judge.sh`, passing in the user ID
2. Run `offboard-judge.sh`, passing in the user ID
```
./scripts/user/offboard-judge-user.sh {judgeUserId}
```
6. If you haven't already, open a PR against `staging` for this change. Apply the "Manual Deploy Step(s) Required" label and include a link to this documentation in the PR's description.
7. At this point, hand off to a USTC engineer.
8. Once this change is deployed to production, run `offboard-judge.sh` as above, but against production.

### To Update the Judge User in Prod
If you have access to prod, run the same script as above, but against production. If you do not have access, hand off to a USTC engineer to do so.

## Additional Resources
- The Judge's id can be retrieved like so:
Expand Down
Loading

0 comments on commit f068e7d

Please sign in to comment.