Skip to content

Commit 44a221f

Browse files
authored
Merge pull request #2559 from GSA/main
05/07/2025 Production Deploy
2 parents 8dd1ae6 + e8c0f98 commit 44a221f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2428
-1702
lines changed

.ds.baseline

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,26 @@
127127
}
128128
],
129129
"results": {
130+
".github/actions/deploy-proxy/action.yml": [
131+
{
132+
"type": "Hex High Entropy String",
133+
"filename": ".github/actions/deploy-proxy/action.yml",
134+
"hashed_secret": "a6c13f5da3788e8d654cd24001dc79a238723248",
135+
"is_verified": false,
136+
"line_number": 18,
137+
"is_secret": false
138+
}
139+
],
140+
".github/workflows/checks.yml": [
141+
{
142+
"type": "Secret Keyword",
143+
"filename": ".github/workflows/checks.yml",
144+
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
145+
"is_verified": false,
146+
"line_number": 68,
147+
"is_secret": false
148+
}
149+
],
130150
"app/assets/js/uswds.min.js": [
131151
{
132152
"type": "Secret Keyword",
@@ -389,26 +409,6 @@
389409
"is_secret": false
390410
}
391411
],
392-
"app/templates/new/components/head.html": [
393-
{
394-
"type": "Base64 High Entropy String",
395-
"filename": "app/templates/new/components/head.html",
396-
"hashed_secret": "ee5048791fc7ff45a1545e24f85bec3317371327",
397-
"is_verified": false,
398-
"line_number": 33,
399-
"is_secret": false
400-
}
401-
],
402-
"app/templates/old/admin_template.html": [
403-
{
404-
"type": "Base64 High Entropy String",
405-
"filename": "app/templates/old/admin_template.html",
406-
"hashed_secret": "ee5048791fc7ff45a1545e24f85bec3317371327",
407-
"is_verified": false,
408-
"line_number": 18,
409-
"is_secret": false
410-
}
411-
],
412412
"deploy-config/sandbox.yml": [
413413
{
414414
"type": "Secret Keyword",
@@ -642,37 +642,7 @@
642642
"line_number": 3266,
643643
"is_secret": false
644644
}
645-
],
646-
"tests/notifications_utils/clients/antivirus/test_antivirus_client.py": [
647-
{
648-
"type": "Secret Keyword",
649-
"filename": "tests/notifications_utils/clients/antivirus/test_antivirus_client.py",
650-
"hashed_secret": "932b25270abe1301c22c709a19082dff07d469ff",
651-
"is_verified": false,
652-
"line_number": 16,
653-
"is_secret": false
654-
}
655-
],
656-
"tests/notifications_utils/clients/encryption/test_encryption_client.py": [
657-
{
658-
"type": "Secret Keyword",
659-
"filename": "tests/notifications_utils/clients/encryption/test_encryption_client.py",
660-
"hashed_secret": "f1e923a9667de11be6a210849a8651c1bfd81605",
661-
"is_verified": false,
662-
"line_number": 13,
663-
"is_secret": false
664-
}
665-
],
666-
"tests/notifications_utils/clients/zendesk/test_zendesk_client.py": [
667-
{
668-
"type": "Secret Keyword",
669-
"filename": "tests/notifications_utils/clients/zendesk/test_zendesk_client.py",
670-
"hashed_secret": "913a73b565c8e2c8ed94497580f619397709b8b6",
671-
"is_verified": false,
672-
"line_number": 16,
673-
"is_secret": false
674-
}
675645
]
676646
},
677-
"generated_at": "2025-04-10T19:38:31Z"
647+
"generated_at": "2025-05-12T16:50:20Z"
678648
}

.github/actions/deploy-proxy/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
default: https://github.com/GSA-TTS/cg-egress-proxy.git
1616
proxy_version:
1717
description: git ref to be deployed
18-
default: main
18+
default: 1500c67157c1a7a6fbbda7a2de172b3d0a67e703
1919
runs:
2020
using: composite
2121
steps:

.github/actions/setup-project/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ runs:
1616
- name: Install poetry
1717
shell: bash
1818
run: pip install poetry==1.8.5
19+
- name: Downgrade virtualenv to compatible version
20+
shell: bash
21+
run: pip install "virtualenv<20.30"
1922
- name: Install application dependencies
2023
shell: bash
2124
run: make bootstrap

.github/workflows/checks.yml

Lines changed: 62 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -51,74 +51,73 @@ jobs:
5151
- name: Check coverage threshold
5252
run: poetry run coverage report --fail-under=90
5353

54-
# TODO FIX THIS!
55-
# end-to-end-tests:
56-
# if: ${{ github.actor != 'dependabot[bot]' }}
54+
end-to-end-tests:
55+
if: ${{ github.actor != 'dependabot[bot]' }}
5756

58-
# permissions:
59-
# checks: write
60-
# pull-requests: write
61-
# contents: write
62-
# runs-on: ubuntu-latest
63-
# environment: staging
64-
# services:
65-
# postgres:
66-
# image: postgres
67-
# env:
68-
# POSTGRES_USER: user
69-
# POSTGRES_PASSWORD: password
70-
# POSTGRES_DB: test_notification_api
71-
# options: >-
72-
# --health-cmd pg_isready
73-
# --health-interval 10s
74-
# --health-timeout 5s
75-
# --health-retries 5
76-
# ports:
77-
# # Maps tcp port 5432 on service container to the host
78-
# - 5432:5432
79-
# redis:
80-
# image: redis
81-
# options: >-
82-
# --health-cmd "redis-cli ping"
83-
# --health-interval 10s
84-
# --health-timeout 5s
85-
# --health-retries 5
86-
# ports:
87-
# # Maps tcp port 6379 on service container to the host
88-
# - 6379:6379
57+
permissions:
58+
checks: write
59+
pull-requests: write
60+
contents: write
61+
runs-on: ubuntu-latest
62+
environment: staging
63+
services:
64+
postgres:
65+
image: postgres
66+
env:
67+
POSTGRES_USER: user
68+
POSTGRES_PASSWORD: password
69+
POSTGRES_DB: test_notification_api
70+
options: >-
71+
--health-cmd pg_isready
72+
--health-interval 10s
73+
--health-timeout 5s
74+
--health-retries 5
75+
ports:
76+
# Maps tcp port 5432 on service container to the host
77+
- 5432:5432
78+
redis:
79+
image: redis
80+
options: >-
81+
--health-cmd "redis-cli ping"
82+
--health-interval 10s
83+
--health-timeout 5s
84+
--health-retries 5
85+
ports:
86+
# Maps tcp port 6379 on service container to the host
87+
- 6379:6379
8988

90-
# steps:
91-
# - uses: actions/checkout@v4
92-
# - uses: ./.github/actions/setup-project
93-
# - uses: jwalton/gh-find-current-pr@v1
94-
# id: findPr
95-
# - name: Check API Server availability
96-
# run: |
97-
# curl --fail -v https://notify-api-staging.app.cloud.gov || exit 1
98-
# - name: Run Admin server
99-
# # If we want to log stuff and see what's broken,
100-
# # insert this line:
101-
# # tail -f admin-server.log &
102-
# # above make e2e-test
89+
steps:
90+
- uses: actions/checkout@v4
91+
- uses: ./.github/actions/setup-project
92+
- uses: jwalton/gh-find-current-pr@v1
93+
id: findPr
94+
- name: Check API Server availability
95+
run: |
96+
curl --fail -v https://notify-api-staging.app.cloud.gov || exit 1
97+
- name: Run Admin server
98+
# If we want to log stuff and see what's broken,
99+
# insert this line:
100+
# tail -f admin-server.log &
101+
# above make e2e-test
103102

104103

105-
# run: |
106-
# make run-flask > admin-server.log 2>&1 &
107-
# tail -f admin-server.log &
108-
# make e2e-test
104+
run: |
105+
make run-flask > admin-server.log 2>&1 &
106+
tail -f admin-server.log &
107+
make e2e-test
109108
110-
# env:
111-
# API_HOST_NAME: https://notify-api-staging.app.cloud.gov/
112-
# SECRET_KEY: ${{ secrets.SECRET_KEY }}
113-
# DANGEROUS_SALT: ${{ secrets.DANGEROUS_SALT }}
114-
# ADMIN_CLIENT_SECRET: ${{ secrets.ADMIN_CLIENT_SECRET }}
115-
# ADMIN_CLIENT_USERNAME: notify-admin
116-
# NOTIFY_ENVIRONMENT: e2etest
117-
# NOTIFY_E2E_AUTH_STATE_PATH: ${{ secrets.NOTIFY_E2E_AUTH_STATE_PATH }}
118-
# NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }}
119-
# NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }}
120-
# NOTIFY_E2E_TEST_URI: http://localhost:6012/
121-
# VCAP_SERVICES: ${{ secrets.VCAP_SERVICES }}
109+
env:
110+
API_HOST_NAME: https://notify-api-staging.app.cloud.gov/
111+
SECRET_KEY: ${{ secrets.SECRET_KEY }}
112+
DANGEROUS_SALT: ${{ secrets.DANGEROUS_SALT }}
113+
ADMIN_CLIENT_SECRET: ${{ secrets.ADMIN_CLIENT_SECRET }}
114+
ADMIN_CLIENT_USERNAME: notify-admin
115+
NOTIFY_ENVIRONMENT: e2etest
116+
NOTIFY_E2E_AUTH_STATE_PATH: ${{ secrets.NOTIFY_E2E_AUTH_STATE_PATH }}
117+
NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }}
118+
NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }}
119+
NOTIFY_E2E_TEST_URI: http://localhost:6012/
120+
VCAP_SERVICES: ${{ secrets.VCAP_SERVICES }}
122121

123122
validate-new-relic-config:
124123
runs-on: ubuntu-latest

.profile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
export NEW_RELIC_PROXY_HOST=$egress_proxy
77
export http_proxy=$egress_proxy
88
export https_proxy=$egress_proxy
9-
export no_proxy="apps.internal"
9+
export no_proxy="apps.internal,s3-fips.us-gov-west-1.amazonaws.com"

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ NVMSH := $(shell [ -f "$(HOME)/.nvm/nvm.sh" ] && echo "$(HOME)/.nvm/nvm.sh" || e
1717
.PHONY: bootstrap
1818
bootstrap: ## Set up everything to run the app
1919
make generate-version-file
20-
poetry self add poetry-dotenv-plugin
2120
poetry lock --no-update
2221
poetry install --sync --no-root
2322
poetry run playwright install --with-deps
@@ -29,7 +28,6 @@ bootstrap: ## Set up everything to run the app
2928
.PHONY: bootstrap-with-git-hooks
3029
bootstrap-with-git-hooks: ## Sets everything up and accounts for pre-existing git hooks
3130
make generate-version-file
32-
poetry self add poetry-dotenv-plugin
3331
poetry lock --no-update
3432
poetry install --sync --no-root
3533
poetry run playwright install --with-deps
@@ -106,11 +104,11 @@ py-test: ## Run python unit tests
106104
dead-code: ## 60% is our aspirational goal, but currently breaks the build
107105
poetry run vulture ./app ./notifications_utils --min-confidence=100
108106

109-
110107
.PHONY: e2e-test
111108
e2e-test: export NEW_RELIC_ENVIRONMENT=test
112109
e2e-test: ## Run end-to-end integration tests; note that --browser webkit isn't currently working
113-
DEBUG=pw:api,pw:browser poetry run pytest -vv --browser chromium --browser firefox tests/end_to_end
110+
@echo "Running E2E tests in path: $${TESTPATH:-tests/end_to_end}"
111+
@bash -c 'DEBUG=pw:api,pw:browser poetry run pytest -vv --browser chromium --browser firefox "$${TESTPATH:-tests/end_to_end}"'
114112

115113
.PHONY: js-lint
116114
js-lint: ## Run javascript linting scanners

app/__init__.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@
141141
def _csp(config):
142142
asset_domain = config["ASSET_DOMAIN"]
143143
logo_domain = config["LOGO_CDN_DOMAIN"]
144-
return {
144+
api_host_name = config["API_HOST_NAME"]
145+
146+
csp = {
145147
"default-src": ["'self'", asset_domain],
146148
"frame-src": [
147149
"https://www.youtube.com",
@@ -165,13 +167,22 @@ def _csp(config):
165167
"'self'",
166168
"https://gov-bam.nr-data.net",
167169
"https://www.google-analytics.com",
168-
"http://localhost:6011",
169-
"ws://localhost:6011",
170170
],
171171
"style-src": ["'self'", asset_domain],
172172
"img-src": ["'self'", asset_domain, logo_domain],
173173
}
174174

175+
if api_host_name:
176+
csp["connect-src"].append(api_host_name)
177+
# this is for web socket
178+
if api_host_name.startswith("http://"):
179+
ws_url = api_host_name.replace("http://", "ws://")
180+
csp["connect-src"].append(ws_url)
181+
elif api_host_name.startswith("https://"):
182+
ws_url = api_host_name.replace("https://", "wss://")
183+
csp["connect-src"].append(ws_url)
184+
return csp
185+
175186

176187
def create_app(application):
177188
@application.after_request

app/assets/javascripts/autofocus.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

app/assets/javascripts/colourPreview.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)