Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1/6/25 Production Deploy #1517

Merged
merged 11 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
@@ -15,4 +15,4 @@ runs:
python-version: "3.12.3"
- name: Install poetry
shell: bash
run: pip install --upgrade poetry
run: pip install poetry==1.8.5
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -9,10 +9,12 @@ GIT_COMMIT ?= $(shell git rev-parse HEAD)

## DEVELOPMENT

## TODO this line should go under `make generate-version-file`
## poetry self update

.PHONY: bootstrap
bootstrap: ## Set up everything to run the app
make generate-version-file
poetry self update
poetry self add poetry-dotenv-plugin
poetry lock --no-update
poetry install --sync --no-root
28 changes: 12 additions & 16 deletions app/aws/s3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import csv
import datetime
import re
import time
from concurrent.futures import ThreadPoolExecutor
from io import StringIO

import botocore
from boto3 import Session
@@ -395,31 +397,25 @@ def get_job_from_s3(service_id, job_id):


def extract_phones(job):
job = job.split("\r\n")
first_row = job[0]
job.pop(0)
first_row = first_row.split(",")
job_csv_data = StringIO(job)
csv_reader = csv.reader(job_csv_data)
first_row = next(csv_reader)

phone_index = 0
for item in first_row:
# Note: may contain a BOM and look like \ufeffphone number
if item.lower() in [
"phone number",
"\\ufeffphone number",
"\\ufeffphone number\n",
"phone number\n",
]:
for i, item in enumerate(first_row):
if item.lower().lstrip("\ufeff") == "phone number":
phone_index = i
break
phone_index = phone_index + 1

phones = {}
job_row = 0
for row in job:
row = row.split(",")
for row in csv_reader:

if phone_index >= len(row):
phones[job_row] = "Unavailable"
current_app.logger.error(
"Corrupt csv file, missing columns or possibly a byte order mark in the file",
f"Corrupt csv file, missing columns or\
possibly a byte order mark in the file, row looks like {row}",
)

else:
14 changes: 9 additions & 5 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ marshmallow = "==3.22.0"
marshmallow-sqlalchemy = "==1.0.0"
newrelic = "*"
notifications-python-client = "==10.0.0"
oscrypto = "==1.3.0"
oscrypto = { git = "https://github.com/wbond/oscrypto.git", rev = "1547f53" }
packaging = "==24.1"
poetry-dotenv-plugin = "==0.2.0"
psycopg2-binary = "==2.9.9"