Skip to content

Commit

Permalink
Merge pull request #4524 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm authored Dec 10, 2024
2 parents f286c7f + a92e2e5 commit 873d32a
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 132 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ jobs:
uses: ./.github/workflows/linting.yml
secrets: inherit

# up to date scan of the staging instance
scan-staging:
name: ZAP scan of the staging site
uses: ./.github/workflows/zap-scan.yml
with:
url: "https://fac-staging.app.cloud.gov/"

deploy-infrastructure-production:
name: Deploy infrastructure (production)
needs:
- testing
- scan-staging
uses: ./.github/workflows/terraform-apply-env.yml
with:
environment: "production"
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,10 @@ jobs:
uses: ./.github/workflows/linting.yml
secrets: inherit

scan-dev:
name: Zap Scan
uses: ./.github/workflows/zap-scan.yml
with:
url: "https://fac-dev.app.cloud.gov/"

deploy-infrastructure-staging:
name: Deploy infrastructure (staging)
needs:
- testing
- scan-dev
uses: ./.github/workflows/terraform-apply-env.yml
with:
environment: "staging"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

logger = logging.getLogger(__name__)

AWARD_REFERENCE_PREFIX = "AWARD"


def resize_award_reference(ir):
references = get_range_by_name(ir, "award_reference")
Expand All @@ -19,9 +21,17 @@ def resize_award_reference(ir):


def _format_reference(v):
"""Format the award reference to have 5 digits, padding with zeros if necessary"""
if not v or len(v) >= AWARD_LEN_5_DIGITS:
return v

parts = v.split("-")
if len(parts) != 2 or not parts[0] or not parts[1]:
return v

prefix, number = parts
if prefix.upper() != AWARD_REFERENCE_PREFIX:
return v

if v and len(v) < AWARD_LEN_5_DIGITS:
parts = v.split("-")
padding = "0" * (AWARD_LEN_5_DIGITS - len(v))
return f"{parts[0]}-{padding}{parts[1]}"
return v
padding = "0" * (AWARD_LEN_5_DIGITS - len(v))
return f"{prefix}-{padding}{number}"
7 changes: 7 additions & 0 deletions backend/audit/test_xform_resize_award_references.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ def test_format_reference(self):
self.assertEqual(_format_reference("AWARD-12345"), "AWARD-12345")
self.assertEqual(_format_reference(None), None)
self.assertEqual(_format_reference(""), "")

def test_format_reference_malformed(self):
"""Test the _format_reference function with malformed inputs"""
# Malformed cases should return as is, as the function does not raise exceptions
self.assertEqual(_format_reference("AWARD123"), "AWARD123") # Missing dash
self.assertEqual(_format_reference("123-456"), "123-456") # Incorrect prefix
self.assertEqual(_format_reference("AWARD-"), "AWARD-") # Missing second part
19 changes: 17 additions & 2 deletions backend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@

# APP-level constants
CENSUS_DATA_SOURCE = "CENSUS"
DOLLAR_THRESHOLD = 750000
SUMMARY_REPORT_DOWNLOAD_LIMIT = 1000
DEFAULT_MAX_ROWS = (
10000 # A version of this constant also exists in schemas.scrpits.render.py
Expand Down Expand Up @@ -583,6 +582,22 @@
# https://docs.djangoproject.com/en/dev/ref/settings/#session-save-every-request
SESSION_SAVE_EVERY_REQUEST = True

# Minimum expenditure thresholds
DOLLAR_THRESHOLDS = [
{
"start": None,
"end": datetime(2024, 10, 1),
"minimum": 750000,
"message": "$750,000 or more with a Fiscal Year starting BEFORE October 01, 2024",
},
{
"start": datetime(2024, 10, 1),
"end": None,
"minimum": 1000000,
"message": "$1,000,000 or more with a Fiscal Year starting ON or AFTER October 01, 2024",
},
]

# Times for the maintenance banner to display.
# Requires a 'start' and an 'end'.
# 'template_name' is optional, and defines what will display if maintenance mode is enabled during this timeframe. If no name is given, the 503 error page is used.
Expand All @@ -594,6 +609,6 @@
"start": datetime(2024, 12, 5, 17, tzinfo=timezone.utc),
"end": datetime(2024, 12, 10, 17, tzinfo=timezone.utc),
"template_name": "maintenance_20241210.html",
"message": "FAC.gov will be doing a site upgrade on Tuesday, December 10, 2024 between 12:00 p.m. and 6:00 p.m ET. During this period, the entire website will be unavailable.",
"message": "FAC.gov will be performing maintenance on Tuesday, December 10, 2024 between 12:00 p.m. and 6:00 p.m ET. During this period, the entire website will be unavailable.",
},
]
123 changes: 52 additions & 71 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 873d32a

Please sign in to comment.