Skip to content

Commit

Permalink
Val -> Prod (#139765)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsummers1 authored Oct 9, 2024
2 parents 7be7e9c + 18c4a91 commit 93f061c
Show file tree
Hide file tree
Showing 61 changed files with 18,026 additions and 13,794 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,18 @@ jobs:
inputs: '{ "topics": "mgmt.connect.cms-carts-seds.carts-bigmac-streams-${{env.BRANCH_NAME}}.config,mgmt.connect.cms-carts-seds.carts-bigmac-streams-${{env.BRANCH_NAME}}.offsets,mgmt.connect.cms-carts-seds.carts-bigmac-streams-${{env.BRANCH_NAME}}.status"}'
ref: refs/heads/master # Otherwise workflow-dispatch tries to operate off of our default name
- name: Destroy
run: ./run destroy --stage $STAGE_PREFIX$branch_name --verify false
run: ./run destroy --stage $STAGE_PREFIX$branch_name --verify false

# Notify the integrations channel when a destroy action fails
notify_on_destroy_failure:
runs-on: ubuntu-latest
needs:
- destroy
if: ${{ failure() }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ":boom: A destroy action has failed on ${{ github.repository }}."
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.INTEGRATIONS_SLACK_WEBHOOK }}
5 changes: 2 additions & 3 deletions .github/workflows/scan_security-hub-jira-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ jobs:
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
role-to-assume: ${{ secrets.PRODUCTION_SYNC_OIDC_ROLE }}
- name: Sync Security Hub and Jira
uses: Enterprise-CMCS/mac-fc-security-hub-visibility@v1.0.5
uses: Enterprise-CMCS/mac-fc-security-hub-visibility@v2.0.9
with:
jira-username: "mdct_github_service_account"
jira-token: ${{ secrets.JIRA_ENT_USER_TOKEN }}
jira-host: jiraent.cms.gov
jira-project-key: CMDCT
jira-ignore-statuses: Done, Closed, Canceled
jira-custom-fields: '{ "customfield_10100": "CMDCT-2280", "customfield_26700" : [{"id": "40101", "value": "CARTS"}] }'
aws-severities: CRITICAL, HIGH, MEDIUM
assign-jira-ticket-to: "MWTW"
jira-assignee: "MWTW"
2 changes: 1 addition & 1 deletion .images/architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
exclude: 'seed-section-base-*'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
Expand Down
2 changes: 1 addition & 1 deletion services/app-api/handlers/apiNames.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
POST /formTemplates - create the sections for a given year for all known states

-- fiscalYearTemplate
GET /fiscalYearTemplate - get the download link for the Fiscal Year Report Template
GET /fiscalYearTemplate/{year} - get the download link for the Fiscal Year Report Template

-- state
GET /state - return info on all states and territories
Expand Down
10 changes: 8 additions & 2 deletions services/app-api/handlers/fiscalYearTemplate/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import handler from "../../libs/handler-lib";
import s3 from "../../libs/s3-lib";
import { ReportPdfs } from "../../types";

export const getFiscalYearTemplateLink = handler(async (_context) => {
const filename = ReportPdfs[2023];
export const getFiscalYearTemplateLink = handler(async (event, _context) => {
if (!event.pathParameters?.year) {
throw new Error("Be sure to include year in the path");
}

const { year } = event.pathParameters;

const filename = ReportPdfs[year];
const url = await s3.getSignedDownloadUrl(
{
Bucket:
Expand Down
22 changes: 22 additions & 0 deletions services/app-api/handlers/fiscalYearTemplate/tests/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,32 @@ describe("Test Get Fiscal Year Template Handlers", () => {
...testEvent,
};

event.pathParameters = { year: "2024" };

const res = await getFiscalYearTemplateLink(event, null);
expect(res.statusCode).toBe(200);
expect(JSON.parse(res.body)).toEqual({
psurl: "mock url",
});
});

test("fetching fiscal year template without params should return server error", async () => {
const event: APIGatewayProxyEvent = {
...testEvent,
};

event.pathParameters = null;

const res = await getFiscalYearTemplateLink(event, null);
expect(res.statusCode).toBe(500);
});

test("fetching fiscal year template without year should return server error", async () => {
const event: APIGatewayProxyEvent = {
...testEvent,
};

const res = await getFiscalYearTemplateLink(event, null);
expect(res.statusCode).toBe(500);
});
});
3 changes: 3 additions & 0 deletions services/app-api/libs/validation/backend-section.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ export const sectionSchema = {
hint: {
type: "string",
},
mask: {
type: "string",
},
questions: {
type: "array",
items: {
Expand Down
10 changes: 5 additions & 5 deletions services/app-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"typescript": "^4.5.4"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.621.0",
"@aws-sdk/client-s3": "^3.621.0",
"@aws-sdk/client-ssm": "^3.621.0",
"@aws-sdk/lib-dynamodb": "^3.621.0",
"@aws-sdk/s3-request-presigner": "^3.621.0",
"@aws-sdk/client-dynamodb": "^3.662.0",
"@aws-sdk/client-s3": "^3.662.0",
"@aws-sdk/client-ssm": "^3.662.0",
"@aws-sdk/lib-dynamodb": "^3.662.0",
"@aws-sdk/s3-request-presigner": "^3.662.0",
"aws-jwt-verify": "^3.1.0",
"dompurify": "^3.1.4",
"jsdom": "^24.1.0",
Expand Down
2 changes: 1 addition & 1 deletion services/app-api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ functions:
handler: handlers/fiscalYearTemplate/get.getFiscalYearTemplateLink
events:
- http:
path: fiscalYearTemplate
path: fiscalYearTemplate/{year}
method: get
cors: true
authorizer: aws_iam
Expand Down
7 changes: 6 additions & 1 deletion services/app-api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,15 @@ export const enum RequestMethods {
/**
* Preseving historic filenames in case we need to make them available on demand or switch between available forms.
*/
export const ReportPdfs = {
interface ReportPdfsInterface {
[key: string]: string;
}

export const ReportPdfs: ReportPdfsInterface = {
2021: "FFY_2021_CARTS_Template.pdf",
2022: "FFY_2022_CARTS_Template.pdf",
2023: "FFY_2023_CARTS_Template.pdf",
2024: "FFY_2024_CARTS_Template.pdf",
};
/* eslint-enable no-unused-vars */

Expand Down
Loading

0 comments on commit 93f061c

Please sign in to comment.