Skip to content

Commit

Permalink
Merge branch 'main' into 2567-intake-add-transform-for-cfda_key
Browse files Browse the repository at this point in the history
  • Loading branch information
sambodeme committed Nov 3, 2023
2 parents e410fb4 + 0362ae3 commit 8751814
Show file tree
Hide file tree
Showing 221 changed files with 1,544 additions and 840 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/new-relic-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Record Deployment And Add New Relic Monitor
on:
push:
branches:
- main
- prod
tags:
- v1.*

jobs:
newrelic:
runs-on: ubuntu-latest
name: New Relic Record Deployment
steps:
# This step builds a var with the release tag value to use later
- name: Set Release Version from Tag
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
# This step creates a new Change Tracking Marker
- name: Add New Relic Application Deployment Marker
uses: newrelic/[email protected]
with:
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
guid: ${{ secrets.NEW_RELIC_DEPLOYMENT_ENTITY_GUID }}
version: "${{ env.RELEASE_VERSION }}"
user: "${{ github.actor }}"

22 changes: 13 additions & 9 deletions backend/.profile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ export no_proxy="${S3_ENDPOINT_FOR_NO_PROXY},${S3_FIPS_ENDPOINT_FOR_NO_PROXY},${
export NEW_RELIC_LICENSE_KEY="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "newrelic-creds" ".[][] | select(.name == \$service_name) | .credentials.NEW_RELIC_LICENSE_KEY")"

# Set the application name for New Relic telemetry.
export NEW_RELIC_APP_NAME="$(echo "$VCAP_APPLICATION" | jq -r .application_name)"
# this did not work on preview, so, since gsa-fac-app works, keeping that there
#export NEW_RELIC_APP_NAME="$(echo "$VCAP_APPLICATION" | jq -r .application_name)-$(echo "$VCAP_APPLICATION" | jq -r .space_name)"
export NEW_RELIC_APP_NAME="$(echo "$VCAP_APPLICATION" | jq -r .application_name)-app"


# Set the environment name for New Relic telemetry.
export NEW_RELIC_ENVIRONMENT="$(echo "$VCAP_APPLICATION" | jq -r .space_name)"
Expand All @@ -28,19 +31,20 @@ export NEW_RELIC_ENVIRONMENT="$(echo "$VCAP_APPLICATION" | jq -r .space_name)"
export NEW_RELIC_LOG=stdout

# Logging level, (critical, error, warning, info and debug). Default to info
export NEW_RELIC_LOG_LEVEL=error
export NEW_RELIC_LOG_LEVEL=info

# https://docs.newrelic.com/docs/security/security-privacy/compliance/fedramp-compliant-endpoints/
export NEW_RELIC_HOST="gov-collector.newrelic.com"
# https://docs.newrelic.com/docs/apm/agents/python-agent/configuration/python-agent-configuration/#proxy
https_proxy_protocol="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.protocol")"
https_proxy_domain="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.domain")"
https_proxy_port="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.port")"
#https_proxy_protocol="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.protocol")"
#https_proxy_domain="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.domain")"
#https_proxy_port="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.port")"

export NEW_RELIC_PROXY_HOST="$https_proxy_protocol://$https_proxy_domain"
export NEW_RELIC_PROXY_PORT="$https_proxy_port"
export NEW_RELIC_PROXY_USER="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.username")"
export NEW_RELIC_PROXY_PASS="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.password")"
#export NEW_RELIC_PROXY_SCHEME="$https_proxy_protocol"
#export NEW_RELIC_PROXY_HOST="$https_proxy_domain"
#export NEW_RELIC_PROXY_PORT="$https_proxy_port"
#export NEW_RELIC_PROXY_USER="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.username")"
#export NEW_RELIC_PROXY_PASS="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.password")"

# We only want to run migrate and collecstatic for the first app instance, not
# for additional app instances, so we gate all of this behind CF_INSTANCE_INDEX
Expand Down
19 changes: 14 additions & 5 deletions backend/audit/file_downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from django.conf import settings
from django.http import Http404
from django.shortcuts import get_object_or_404

from boto3 import client as boto3_client
from botocore.client import ClientError, Config
Expand All @@ -14,11 +13,21 @@

def get_filename(sac, file_type):
if file_type == "report":
file_obj = get_object_or_404(SingleAuditReportFile, sac=sac)
return f"singleauditreport/{file_obj.filename}"
try:
file_obj = SingleAuditReportFile.objects.filter(sac=sac).latest(
"date_created"
)
return f"singleauditreport/{file_obj.filename}"
except SingleAuditReportFile.DoesNotExist:
raise Http404()
else:
file_obj = get_object_or_404(ExcelFile, sac=sac, form_section=file_type)
return f"excel/{file_obj.filename}"
try:
file_obj = ExcelFile.objects.filter(sac=sac, form_section=file_type).latest(
"date_created"
)
return f"excel/{file_obj.filename}"
except ExcelFile.DoesNotExist:
raise Http404()


def file_exists(filename):
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"endpoint": "additional_eins",
"report_id": "2021TEST000134732",
"report_id": "2021-12-TSTDAT-0000134732",
"rows": [],
"singletons": {
"auditee_uei": "BADBADBADBAD"
Expand All @@ -14,7 +14,7 @@
},
{
"endpoint": "corrective_action_plans",
"report_id": "2021TEST000134732",
"report_id": "2021-12-TSTDAT-0000134732",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -59,7 +59,7 @@
},
{
"endpoint": "federal_awards",
"report_id": "2021TEST000134732",
"report_id": "2021-12-TSTDAT-0000134732",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -1303,7 +1303,7 @@
},
{
"endpoint": "findings_text",
"report_id": "2021TEST000134732",
"report_id": "2021-12-TSTDAT-0000134732",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -1348,7 +1348,7 @@
},
{
"endpoint": "findings",
"report_id": "2021TEST000134732",
"report_id": "2021-12-TSTDAT-0000134732",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -1459,7 +1459,7 @@
},
{
"endpoint": "notes_to_sefa",
"report_id": "2021TEST000134732",
"report_id": "2021-12-TSTDAT-0000134732",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -1491,7 +1491,7 @@
},
{
"endpoint": "secondary_auditor",
"report_id": "2021TEST000134732",
"report_id": "2021-12-TSTDAT-0000134732",
"rows": [],
"singletons": {
"auditee_uei": "BADBADBADBAD"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[
{
"endpoint": "additional_eins",
"report_id": "2022TEST000147110",
"report_id": "2022-06-TSTDAT-0000147110",
"rows": [],
"singletons": {
"auditee_uei": "ZUFJEU4NMK52"
}
},
{
"endpoint": "additional_ueis",
"report_id": "2022TEST000147110",
"report_id": "2022-06-TSTDAT-0000147110",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -234,7 +234,7 @@
},
{
"endpoint": "corrective_action_plans",
"report_id": "2022TEST000147110",
"report_id": "2022-06-TSTDAT-0000147110",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -1203,7 +1203,7 @@
},
{
"endpoint": "federal_awards",
"report_id": "2022TEST000147110",
"report_id": "2022-06-TSTDAT-0000147110",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -10737,7 +10737,7 @@
},
{
"endpoint": "findings_text",
"report_id": "2022TEST000147110",
"report_id": "2022-06-TSTDAT-0000147110",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -11706,7 +11706,7 @@
},
{
"endpoint": "findings",
"report_id": "2022TEST000147110",
"report_id": "2022-06-TSTDAT-0000147110",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -19985,7 +19985,7 @@
},
{
"endpoint": "notes_to_sefa",
"report_id": "2022TEST000147110",
"report_id": "2022-06-TSTDAT-0000147110",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -20057,7 +20057,7 @@
},
{
"endpoint": "secondary_auditor",
"report_id": "2022TEST000147110",
"report_id": "2022-06-TSTDAT-0000147110",
"rows": [],
"singletons": {
"auditee_uei": "ZUFJEU4NMK52"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"endpoint": "additional_eins",
"report_id": "2022TEST000171944",
"report_id": "2022-08-TSTDAT-0000171944",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -1202,7 +1202,7 @@
},
{
"endpoint": "additional_ueis",
"report_id": "2022TEST000171944",
"report_id": "2022-08-TSTDAT-0000171944",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -2171,7 +2171,7 @@
},
{
"endpoint": "corrective_action_plans",
"report_id": "2022TEST000171944",
"report_id": "2022-08-TSTDAT-0000171944",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -2540,7 +2540,7 @@
},
{
"endpoint": "federal_awards",
"report_id": "2022TEST000171944",
"report_id": "2022-08-TSTDAT-0000171944",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -168186,7 +168186,7 @@
},
{
"endpoint": "findings_text",
"report_id": "2022TEST000171944",
"report_id": "2022-08-TSTDAT-0000171944",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -168555,7 +168555,7 @@
},
{
"endpoint": "findings",
"report_id": "2022TEST000171944",
"report_id": "2022-08-TSTDAT-0000171944",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -172770,7 +172770,7 @@
},
{
"endpoint": "notes_to_sefa",
"report_id": "2022TEST000171944",
"report_id": "2022-08-TSTDAT-0000171944",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -172932,7 +172932,7 @@
},
{
"endpoint": "secondary_auditor",
"report_id": "2022TEST000171944",
"report_id": "2022-08-TSTDAT-0000171944",
"rows": [
{
"fields": [
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[
{
"endpoint": "additional_eins",
"report_id": "2022TEST000181744",
"report_id": "2022-09-TSTDAT-0000181744",
"rows": [],
"singletons": {
"auditee_uei": "MKEJWVSEURF3"
}
},
{
"endpoint": "additional_ueis",
"report_id": "2022TEST000181744",
"report_id": "2022-09-TSTDAT-0000181744",
"rows": [],
"singletons": {
"auditee_uei": "MKEJWVSEURF3"
}
},
{
"endpoint": "corrective_action_plans",
"report_id": "2022TEST000181744",
"report_id": "2022-09-TSTDAT-0000181744",
"rows": [],
"singletons": {
"auditee_uei": "MKEJWVSEURF3"
}
},
{
"endpoint": "federal_awards",
"report_id": "2022TEST000181744",
"report_id": "2022-09-TSTDAT-0000181744",
"rows": [
{
"fields": [
Expand Down Expand Up @@ -5075,21 +5075,21 @@
},
{
"endpoint": "findings_text",
"report_id": "2022TEST000181744",
"report_id": "2022-09-TSTDAT-0000181744",
"rows": [],
"singletons": {
"auditee_uei": "MKEJWVSEURF3"
}
},
{
"endpoint": "findings",
"report_id": "2022TEST000181744",
"report_id": "2022-09-TSTDAT-0000181744",
"rows": [],
"singletons": {}
},
{
"endpoint": "notes_to_sefa",
"report_id": "2022TEST000181744",
"report_id": "2022-09-TSTDAT-0000181744",
"rows": [
{
"fields": [
Expand All @@ -5111,7 +5111,7 @@
},
{
"endpoint": "secondary_auditor",
"report_id": "2022TEST000181744",
"report_id": "2022-09-TSTDAT-0000181744",
"rows": [],
"singletons": {
"auditee_uei": "MKEJWVSEURF3"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 8751814

Please sign in to comment.