-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3104 from GSA-TTS/main
- Loading branch information
Showing
28 changed files
with
314 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ jobs: | |
body: | | ||
${{ steps.changelog.outputs.changelog }} | ||
draft: false | ||
prerelease: true | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,76 @@ | ||
FROM python:3.10-slim AS builder | ||
############################### | ||
# FOUNDATION | ||
############################### | ||
|
||
FROM python:3.10-slim AS foundation | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN apt-get -y update | ||
RUN apt-get -y install git | ||
|
||
RUN apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive \ | ||
apt-get install --no-install-recommends --assume-yes \ | ||
postgresql-client | ||
|
||
# RUN --mount=type=cache,target=/root/.cache \ | ||
|
||
WORKDIR .. | ||
|
||
RUN \ | ||
apt-get update && \ | ||
apt-get install -yqq apt-transport-https wget gnupg2 | ||
|
||
# Updated nodesource install via: https://github.com/nodesource/distributions#ubuntu-versions | ||
RUN \ | ||
apt-get update -yq && \ | ||
apt install build-essential curl -y && \ | ||
apt-get install -y gcc ca-certificates gnupg && \ | ||
mkdir -p /etc/apt/keyrings && \ | ||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ | ||
NODE_MAJOR=18 && \ | ||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ | ||
apt-get update && \ | ||
apt-get install nodejs -y | ||
RUN apt-get -yq update && \ | ||
apt install -y \ | ||
apt-transport-https \ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
git \ | ||
gcc \ | ||
gnupg \ | ||
gnupg2 \ | ||
postgresql-client \ | ||
wget | ||
|
||
############################### | ||
# STORAGE | ||
############################### | ||
FROM foundation AS storage | ||
RUN apt-get install -yqq groff && \ | ||
apt-get install -yqq zip && \ | ||
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" && \ | ||
unzip awscli-bundle.zip && \ | ||
./awscli-bundle/install -b /usr/local/bin/aws | ||
RUN curl "https://dl.min.io/client/mc/release/linux-amd64/mc" -o "/usr/local/bin/mc" && \ | ||
chmod +x /usr/local/bin/mc | ||
|
||
############################### | ||
# PIP | ||
############################### | ||
FROM storage AS pip | ||
COPY requirements.txt /tmp/requirements.txt | ||
COPY dev-requirements.txt /tmp/dev-requirements.txt | ||
|
||
RUN \ | ||
set -ex && \ | ||
RUN set -ex && \ | ||
pip install --upgrade pip && \ | ||
pip install -r /tmp/requirements.txt && \ | ||
pip install -r /tmp/dev-requirements.txt && \ | ||
rm -rf /root/.cache/ | ||
|
||
RUN \ | ||
apt-get install -yqq groff && \ | ||
apt-get install -yqq zip && \ | ||
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" && \ | ||
unzip awscli-bundle.zip && \ | ||
./awscli-bundle/install -b /usr/local/bin/aws | ||
|
||
RUN \ | ||
curl "https://dl.min.io/client/mc/release/linux-amd64/mc" -o "/usr/local/bin/mc" && \ | ||
chmod +x /usr/local/bin/mc | ||
|
||
COPY package.* /src/ | ||
############################### | ||
# NODE | ||
############################### | ||
FROM pip AS node | ||
WORKDIR /src/ | ||
|
||
ENV NODE_MAJOR 18 | ||
|
||
RUN mkdir -p /etc/apt/keyrings | ||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | ||
# We have to update after adding to the apt sources lists. | ||
RUN apt-get update | ||
RUN apt-get install -y nodejs npm | ||
COPY package.* /src/ | ||
RUN npm install -g [email protected] | ||
# To address run-p error. | ||
RUN npm install -g npm-run-all | ||
RUN npm install | ||
RUN chown -R 1001:123 "/root/.npm" | ||
|
||
COPY . /src/ | ||
|
||
RUN npm run build && python manage.py collectstatic | ||
|
||
# ------------------------------------------------------------ | ||
# Dev/testing layer | ||
# ------------------------------------------------------------ | ||
|
||
FROM builder AS release | ||
RUN npm run build | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
############################### | ||
# DEV | ||
############################### | ||
FROM node AS dev | ||
WORKDIR /src/ | ||
RUN python manage.py collectstatic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added
BIN
+675 KB
.../workbooks/should_fail/federal-awards/has-empty-loan-balance-but-balance-is-required.xlsx
Binary file not shown.
Binary file removed
BIN
-699 KB
backend/audit/fixtures/workbooks/should_pass/cluster_names/tests-cluster-names.xlsx
Binary file not shown.
File renamed without changes.
Binary file added
BIN
+674 KB
...s/should_pass/federal_awards/federal-awards-has-loan-guarantee-and-zero-loan-balance.xlsx
Binary file not shown.
Binary file added
BIN
+675 KB
...xtures/workbooks/should_pass/federal_awards/federal-awards-has-negative-loan-balance.xlsx
Binary file not shown.
Binary file added
BIN
+802 KB
...dit/fixtures/workbooks/should_pass/federal_awards/federal-awards-tests-cluster-names.xlsx
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
# flake8: noqa: F401 | ||
from .util import ( | ||
get_message, | ||
build_cell_error_tuple, | ||
appears_empty, | ||
is_value_marked_na, | ||
get_names_of_all_ranges, | ||
get_range_start_row, | ||
get_missing_value_errors, | ||
invalid_y_or_n_entry, | ||
safe_int_conversion, | ||
list_contains_non_null_values, | ||
build_range_error_tuple, | ||
) | ||
# flake8: noqa: F401 | ||
from .util import ( | ||
get_message, | ||
build_cell_error_tuple, | ||
appears_empty, | ||
is_value_marked_na, | ||
get_names_of_all_ranges, | ||
get_range_start_row, | ||
get_missing_value_errors, | ||
invalid_y_or_n_entry, | ||
make_named_range_uppercase, | ||
safe_int_conversion, | ||
list_contains_non_null_values, | ||
build_range_error_tuple, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
backend/audit/intakelib/transforms/xform_federal_awards_cluster_name_to_uppercase.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import logging | ||
from audit.intakelib.common import make_named_range_uppercase | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# DESCRIPTION | ||
# Convert federal_awards cluster_name to uppercase. | ||
def convert_federal_awards_cluster_name_to_uppercase(ir): | ||
return make_named_range_uppercase(ir, "cluster_name", "check_cluster_names") |
7 changes: 6 additions & 1 deletion
7
backend/audit/intakelib/transforms/xform_loan_balance_need_to_be_integers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import logging | ||
|
||
from django.conf import settings | ||
from audit.intakelib.common import safe_int_conversion | ||
from ..checks.check_cluster_total import NOT_APPLICABLE | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# DESCRIPTION | ||
# Convert end of period loan balance to integers when applicable | ||
def convert_loan_balance_to_integers_or_na(ir): | ||
xform_ir = safe_int_conversion(ir, "loan_balance_at_audit_period_end", {"N/A"}) | ||
xform_ir = safe_int_conversion( | ||
ir, "loan_balance_at_audit_period_end", {NOT_APPLICABLE, settings.GSA_MIGRATION} | ||
) | ||
return xform_ir |
Oops, something went wrong.