Skip to content

Commit

Permalink
Merge branch 'main' into mdct-2753-enterprise-urls
Browse files Browse the repository at this point in the history
  • Loading branch information
BearHanded committed Aug 2, 2023
2 parents 605373e + b5b72ca commit 27a1004
Show file tree
Hide file tree
Showing 38 changed files with 1,025 additions and 658 deletions.
2 changes: 2 additions & 0 deletions .env_example
Expand Up @@ -2,6 +2,7 @@ API_URL=http://localhost:3030/local
BANNER_TABLE_NAME=local-banners
COGNITO_USER_POOL_CLIENT_ID=4n2andd7qumjgdojec3cbqsemu
COGNITO_USER_POOL_ID=us-east-1_lerDvs4wn
POST_SIGNOUT_REDIRECT=http://localhost:3000/
DATATRANSFORM_ENABLED=false
DATATRANSFORM_UPDATED_ENABLED=false
DISABLE_ESLINT_PLUGIN=true
Expand All @@ -27,6 +28,7 @@ LOGGING_BUCKET=log-bucket
WARMUP_SCHEDULE=60 minutes
WARMUP_CONCURRENCY=5


# Values used for short-circuiting ssm: lookups, most likely won't need locally
VPC_ID=local-nonsense
VPC_SUBNET_A=local-nonsense
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/deploy.yml
Expand Up @@ -22,12 +22,9 @@ jobs:
run: ./.github/build-vars.sh set_values
env:
CODE_CLIMATE_ID: ${{ secrets.CODE_CLIMATE_ID }}
- name: read .nvmrc
id: node_version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: ${{ steps.node_version.outputs.NODE_VERSION }}
node-version-file: ".nvmrc"
- uses: actions/cache@v2
with:
path: |
Expand Down Expand Up @@ -89,12 +86,9 @@ jobs:
run: ./.github/github-lock.sh $branch_name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: read .nvmrc
id: node_version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: ${{ steps.node_version.outputs.NODE_VERSION }}
node-version-file: ".nvmrc"
- uses: actions/cache@v2
with:
path: |
Expand Down Expand Up @@ -131,9 +125,11 @@ jobs:
if: ${{ github.ref != 'refs/heads/production' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Run Cypress Tests
uses: cypress-io/github-action@v4.2.0
uses: cypress-io/github-action@v5
with:
working-directory: tests/cypress
spec: |
Expand All @@ -148,6 +144,7 @@ jobs:
CYPRESS_STATE_USER_PASSWORD: ${{ secrets.CYPRESS_STATE_USER_PASSWORD }}
CYPRESS_ADMIN_USER_EMAIL: ${{ secrets.CYPRESS_ADMIN_USER_EMAIL }}
CYPRESS_ADMIN_USER_PASSWORD: ${{ secrets.CYPRESS_ADMIN_USER_PASSWORD }}

- name: Upload screenshots
uses: actions/upload-artifact@v2
if: failure()
Expand All @@ -163,9 +160,11 @@ jobs:
if: ${{ github.ref != 'refs/heads/production' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Check Project A11y
uses: cypress-io/github-action@v4.2.0
uses: cypress-io/github-action@v5
with:
working-directory: tests/cypress
spec: tests/accessibility/*.feature
Expand All @@ -179,6 +178,7 @@ jobs:
CYPRESS_ADMIN_USER_EMAIL: ${{ secrets.CYPRESS_ADMIN_USER_EMAIL }}
CYPRESS_ADMIN_USER_PASSWORD: ${{ secrets.CYPRESS_ADMIN_USER_PASSWORD }}
RUN_PA11Y: true

- name: Upload screenshots
uses: actions/upload-artifact@v2
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule-jira-sync.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
role-to-assume: ${{ secrets.PRODUCTION_SYNC_OIDC_ROLE }}

- name: Sync Security Hub and Jira
uses: Enterprise-CMCS/security-hub-visibility@v1.0.1
uses: Enterprise-CMCS/mac-fc-security-hub-visibility@v1.0.2
with:
jira-token: ${{ secrets.JIRA_SERVICE_USER_TOKEN }}
jira-username: ${{ secrets.JIRA_SERVICE_USERNAME }}
Expand Down
43 changes: 37 additions & 6 deletions scripts/destroy.sh
Expand Up @@ -87,7 +87,6 @@ if [ "$CI" != "true" ]; then
fi

for i in "${bucketList[@]}"; do
echo $i
set -e

# Suspend bucket versioning.
Expand Down Expand Up @@ -123,29 +122,54 @@ for i in "${bucketList[@]}"; do
fi

# Empty the bucket
echo "emptying bucket: $i"
aws s3 rm s3://$i/ --recursive
done

echo "Removing certificate from stage"

restApiName=$stage-app-api

restApiId=$(aws apigateway get-rest-apis | jq -r ".[] | .[] | select(.name==\"$restApiName\") | .id|tostring")

if [ "$restApiId" != "" ]; then
echo "Removing certificate from stage"

aws apigateway update-stage \
--rest-api-id $restApiId \
--stage-name $stage \
--patch-operations op=replace,path=/clientCertificateId,value="" \
&>/dev/null
restApiArn="arn:aws:apigateway:us-east-1::/restapis/$restApiId/stages/$stage"

echo "Disassociating web acl from api gateway"

aws wafv2 disassociate-web-acl \
--resource-arn $restApiArn &>/dev/null

echo "Removed certificate from stage and disassociated web acl"
fi

echo "Removed certificate from stage"
databaseStackName="database-$stage"

# Trigger a delete for each cloudformation stack
for i in "${stackList[@]}"; do
echo "Triggered stack deletion for stack: $i"
aws cloudformation delete-stack --stack-name $i
# database stack has a bucket that the app-api stack expects to exist while deleting
if [ $i == $databaseStackName ]; then
echo "skipping database delete until app-api is finished"
else
echo "triggering stack deletion for $i"
aws cloudformation delete-stack --stack-name $i
fi
done

# if database stack exists...
# wait for app-api to delete and then delete database stack
if [[ "${stackList[@]}" =~ "$databaseStackName" ]]; then
echo "waiting for app-api stack delete to complete before deleting database stack"
aws cloudformation wait stack-delete-complete --stack-name "app-api-$stage"
echo "triggering stack deletion for $databaseStackName"
aws cloudformation delete-stack --stack-name $databaseStackName
fi

# Delete Client Certificates associated with a branch
certToDestroy=$(aws apigateway get-client-certificates | grep \"app-api-${stage}\" -B 2 |
grep -o '"clientCertificateId": "[^"]*' |
Expand All @@ -166,6 +190,13 @@ if [[ -n $apiGatewayLogGroupExists ]]; then
aws logs delete-log-group --log-group-name $apiGatewayLogGroupName
fi

# Find hanging api-gateway execution logs
apiGatewayExecutionLogRegex="^API-Gateway-Execution-Logs[^/]+\/$stage$"
apiGatewayExecutionLogs=($(aws logs describe-log-groups --query "logGroups[*].logGroupName" --output json | jq -r --arg pattern "$apiGatewayExecutionLogRegex" '.[] | select(test($pattern))'))
if [[ -n $apiGatewayExecutionLogs ]]; then
aws logs delete-log-group --log-group-name $apiGatewayExecutionLogs
fi

# Cleanup bigmac topics for branch
data='{"project":"mcr","stage":"'"$stage"'"}'
pushd services/topics
Expand Down
1 change: 1 addition & 0 deletions services/ui-src/.env_example
Expand Up @@ -5,6 +5,7 @@ COGNITO_IDENTITY_POOL_ID=us-east-1:76708bb0-a458-4ea7-b90e-995ff5da5ab6
COGNITO_IDP_NAME=OktaOIDC
COGNITO_REDIRECT_SIGNIN=http://localhost:3000/
COGNITO_REDIRECT_SIGNOUT=http://localhost:3000/
POST_SIGNOUT_REDIRECT=placeholder
COGNITO_REGION=us-east-1
COGNITO_USER_POOL_CLIENT_ID=4n2andd7qumjgdojec3cbqsemu
COGNITO_USER_POOL_CLIENT_DOMAIN=main-login-4n2andd7qumjgdojec3cbqsemu.auth.us-east-1.amazoncognito.com
Expand Down
2 changes: 2 additions & 0 deletions services/ui-src/serverless.yml
Expand Up @@ -43,6 +43,7 @@ custom:
ui_s3_bucket_name: ${cf:ui-${self:custom.stage}.S3BucketName}
ui_cloudfront_distribution_id: ${cf:ui-${self:custom.stage}.CloudFrontDistributionId}
application_endpoint_url: ${cf:ui-${self:custom.stage}.ApplicationEndpointUrl}
signout_redirect_url: ${env:POST_SIGNOUT_REDIRECT, ssm:/configuration/${self:custom.stage}/cognito/redirectSignout, ssm:/configuration/default/cognito/redirectSignout}
s3Sync:
- bucketName: ${self:custom.ui_s3_bucket_name}
localDir: ./build
Expand All @@ -69,6 +70,7 @@ custom:
export COGNITO_IDP=${self:custom.cognito_idp}
export COGNITO_REDIRECT_SIGNIN=${self:custom.application_endpoint_url}
export COGNITO_REDIRECT_SIGNOUT=${self:custom.application_endpoint_url}
export POST_SIGNOUT_REDIRECT=${self:custom.signout_redirect_url}
export REACT_APP_LD_SDK_CLIENT=${self:custom.ldSdkClient}
export S3_ATTACHMENTS_BUCKET_REGION=${self:custom.s3_attachments_bucket_region}
export S3_ATTACHMENTS_BUCKET_NAME=${self:custom.s3_attachments_bucket_name}
Expand Down
Expand Up @@ -195,6 +195,9 @@ export function renderEntityDetailTables(

const sx = {
root: {
"@media print": {
pageBreakInside: "avoid",
},
marginBottom: "1rem",
width: "100%",
"tr, th": {
Expand Down
Expand Up @@ -25,8 +25,8 @@ describe("ExportedEntityDetailsTable", () => {

const expectedTextContent = [
"N/A",
"mock modal overlay text field",
"1",
"mock text field",
"mock number field",
"Not answered; required",
];

Expand Down
Expand Up @@ -125,6 +125,9 @@ export interface Props {

const sx = {
root: {
"@media print": {
pageBreakInside: "avoid",
},
marginBottom: "1rem",
"tr, th": {
verticalAlign: "top",
Expand Down
Expand Up @@ -17,7 +17,11 @@ export const ExportedModalDrawerReportSection = ({
const entityCount = entities?.length;

return (
<Box mt="2rem" data-testid="exportedModalDrawerReportSection">
<Box
mt="2rem"
data-testid="exportedModalDrawerReportSection"
sx={sx.container}
>
<Heading as="h3" sx={sx.dashboardTitle} data-testid="headerCount">
{`${verbiage.dashboardTitle} ${entityCount > 0 ? entityCount : ""}`}
{!entityCount && (
Expand Down Expand Up @@ -50,6 +54,11 @@ export interface Props {
}

const sx = {
container: {
"@media print": {
pageBreakInside: "avoid",
},
},
notAnswered: {
display: "block",
fontSize: "md",
Expand Down
Expand Up @@ -129,6 +129,9 @@ export function renderModalOverlayTableBody(

const sx = {
root: {
"@media print": {
pageBreakInside: "avoid",
},
marginBottom: "1rem",
"tr, th": {
verticalAlign: "bottom",
Expand Down
Expand Up @@ -147,6 +147,9 @@ export interface Props {

const sx = {
root: {
"@media print": {
pageBreakInside: "avoid",
},
marginBottom: "1rem",
"tr, th": {
verticalAlign: "top",
Expand Down
Expand Up @@ -20,7 +20,7 @@ export const ExportedSectionHeading = ({
const sectionSpreadsheet = verbiage?.intro?.spreadsheet;

return (
<Box data-testid="exportedSectionHeading">
<Box data-testid="exportedSectionHeading" sx={sx.container}>
<Heading as="h2" sx={sx.heading}>
{sectionHeading}
</Heading>
Expand All @@ -45,6 +45,11 @@ export interface Props {
}

const sx = {
container: {
"@media print": {
pageBreakInside: "avoid",
},
},
heading: {
margin: "1.5rem 0",
fontSize: "xl",
Expand All @@ -60,5 +65,8 @@ const sx = {
},
spreadsheet: {
margin: "1.5rem 0",
"@media print": {
pageBreakAfter: "avoid",
},
},
};
1 change: 1 addition & 0 deletions services/ui-src/src/components/index.ts
Expand Up @@ -98,6 +98,7 @@ export { ModalDrawerReportPage } from "./reports/ModalDrawerReportPage";
export { ModalOverlayReportPage } from "./reports/ModalOverlayReportPage";
export { ReportPageFooter } from "./reports/ReportPageFooter";
export { ReportContext, ReportProvider } from "./reports/ReportProvider";
export { EntityContext, EntityProvider } from "./reports/EntityProvider";
// statusing
export { StatusTable } from "./statusing/StatusTable";
// tables
Expand Down

0 comments on commit 27a1004

Please sign in to comment.