Skip to content

Commit

Permalink
Merge pull request #1163 from GSA/main
Browse files Browse the repository at this point in the history
07/03/2024 Production Release
  • Loading branch information
ccostino authored Jul 3, 2024
2 parents a416f74 + 7699b3a commit d31d19d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 36 deletions.
18 changes: 8 additions & 10 deletions app/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,10 @@ def process_row_from_job(job_id, job_row_number):
@click.option("-f", "--csv_filename", required=True, help="csv file name")
def download_csv_file_by_name(csv_filename):

bucket_name = (current_app.config["CSV_UPLOAD_BUCKET"]["bucket"],)
access_key = (current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"],)
secret = (current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"],)
region = (current_app.config["CSV_UPLOAD_BUCKET"]["region"],)
bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"]
access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"]
secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"]
region = current_app.config["CSV_UPLOAD_BUCKET"]["region"]
print(s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region))


Expand Down Expand Up @@ -865,14 +865,12 @@ def promote_user_to_platform_admin(user_email_address):

@notify_command(name="purge-csv-bucket")
def purge_csv_bucket():
bucket_name = (current_app.config["CSV_UPLOAD_BUCKET"]["bucket"],)
access_key = (current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"],)
secret = (current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"],)
region = (current_app.config["CSV_UPLOAD_BUCKET"]["region"],)
bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"]
access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"]
secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"]
region = current_app.config["CSV_UPLOAD_BUCKET"]["region"]

print("ABOUT TO RUN PURGE CSV BUCKET")
s3.purge_bucket(bucket_name, access_key, secret, region)
print("RAN PURGE CSV BUCKET")


"""
Expand Down
12 changes: 9 additions & 3 deletions docs/all.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ flask command purge_functional_test_data -u <functional tests user name prefix>
Running on cloud.gov:
```
cf run-task notify-api "flask command purge_functional_test_data -u <functional tests user name prefix>"
cf run-task notify-api --comand "flask command purge_functional_test_data -u <functional tests user name prefix>"
```
Expand Down Expand Up @@ -1339,9 +1339,15 @@ In the api logs, search by job_id. Either you will see evidence of the job fail

## Viewing the csv file

If you need to view the questionable csv file, run the following command:
If you need to view the questionable csv file on production, run the following command:


```
cf run-task notify-api "flask command download_csv_file_by_name -f <file location found in admin logs>"
cf run-task notify-api-production --command "flask command download-csv-file-by-name -f <file location found in admin logs>"
```

locally, just do:

```
poetry run flask command download-csv-file-by-name -f <file location in admin logs>
```
38 changes: 19 additions & 19 deletions poetry.lock

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

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ alembic = "==1.13.2"
amqp = "==5.2.0"
beautifulsoup4 = "==4.12.3"
boto3 = "^1.34.136"
botocore = "^1.34.136"
botocore = "^1.34.138"
cachetools = "==5.3.3"
celery = {version = "==5.4.0", extras = ["redis"]}
certifi = ">=2022.12.7"
Expand Down Expand Up @@ -55,7 +55,7 @@ geojson = "^3.1.0"
govuk-bank-holidays = "^0.14"
numpy = "^1.26.4"
ordered-set = "^4.1.0"
phonenumbers = "^8.13.39"
phonenumbers = "^8.13.40"
python-json-logger = "^2.0.7"
pytz = "^2024.1"
regex = "^2024.5.15"
Expand Down Expand Up @@ -92,7 +92,7 @@ freezegun = "^1.5.1"
honcho = "*"
isort = "^5.13.2"
jinja2-cli = {version = "==0.8.2", extras = ["yaml"]}
moto = "==5.0.9"
moto = "==5.0.10"
pip-audit = "*"
pre-commit = "^3.7.1"
pytest = "^8.2.2"
Expand All @@ -102,7 +102,7 @@ pytest-cov = "^5.0.0"
pytest-xdist = "^3.5.0"
radon = "^6.0.1"
requests-mock = "^1.11.0"
setuptools = "^70.1.1"
setuptools = "^70.2.0"
sqlalchemy-utils = "^0.41.2"
vulture = "^2.10"
detect-secrets = "^1.5.0"
Expand Down

0 comments on commit d31d19d

Please sign in to comment.