Skip to content

Commit

Permalink
feat: Hl 1573 maintenance improvements (#3650)
Browse files Browse the repository at this point in the history
* fix: OSerror in Sentry

* feat: add support for vscode dev container

* feat: set calculator constants from env variables
  • Loading branch information
rikuke authored Dec 16, 2024
1 parent 7ec0dd9 commit 192dc77
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
6 changes: 6 additions & 0 deletions backend/benefit/.prod/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ logger-req = stdio
log-format = "remote_addr":"%(addr)", "x_forwarded_for":"%(var.HTTP_X_FORWARDED_FOR)", "request_id":"%(var.HTTP_X_REQUEST_ID)", "remote_user":"%(user)", "bytes_sent":%(size), "request_time":%(secs), "status":%(status), "host":"%(json_host)", "request_proto":"%(proto)", "path":"%(json_uri)", "request_length":%(cl), "http_referer":"%(referer)", "http_user_agent":"%(uagent)"
log-req-encoder = format {"time":"${strftime:%%Y:%%m:%%d %%H:%%M:%%S}", "source":"uwsgi-req", ${msg}}
log-req-encoder = nl

# Suppress errors about clients closing sockets, happens with nginx as the ingress when
# http pipes are closed before workers has had the time to serve content to the pipe
ignore-sigpipe = true
ignore-write-errors = true
disable-write-exception = true
8 changes: 4 additions & 4 deletions backend/benefit/calculator/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ class SalaryBenefitCalculator2023(HelsinkiBenefitCalculator):
"""

# The maximum amount of pay subsidy depends on the pay subsidy percent in the pay subsidy decision.
PAY_SUBSIDY_MAX_FOR_100_PERCENT = 2020
PAY_SUBSIDY_MAX_FOR_70_PERCENT = 1770
PAY_SUBSIDY_MAX_FOR_50_PERCENT = 1260
SALARY_BENEFIT_MAX = 800
PAY_SUBSIDY_MAX_FOR_100_PERCENT = settings.PAY_SUBSIDY_MAX_FOR_100_PERCENT
PAY_SUBSIDY_MAX_FOR_70_PERCENT = settings.PAY_SUBSIDY_MAX_FOR_70_PERCENT
PAY_SUBSIDY_MAX_FOR_50_PERCENT = settings.PAY_SUBSIDY_MAX_FOR_50_PERCENT
SALARY_BENEFIT_MAX = settings.SALARY_BENEFIT_MAX
SALARY_BENEFIT_NEW_MAX = settings.SALARY_BENEFIT_NEW_MAX

@property
Expand Down
8 changes: 8 additions & 0 deletions backend/benefit/helsinkibenefit/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@
SALARY_BENEFIT_NEW_MAX=(int, 1500),
INSTALMENT_THRESHOLD=(int, 9600),
FIRST_INSTALMENT_LIMIT=(int, 9000),
PAY_SUBSIDY_MAX_FOR_100_PERCENT=(int, 2020),
PAY_SUBSIDY_MAX_FOR_70_PERCENT=(int, 1770),
PAY_SUBSIDY_MAX_FOR_50_PERCENT=(int, 1260),
SALARY_BENEFIT_MAX=(int, 800),
)
if os.path.exists(env_file):
env.read_env(env_file)
Expand Down Expand Up @@ -572,3 +576,7 @@
SALARY_BENEFIT_NEW_MAX = env.int("SALARY_BENEFIT_NEW_MAX")
INSTALMENT_THRESHOLD = env.int("INSTALMENT_THRESHOLD")
FIRST_INSTALMENT_LIMIT = env.int("FIRST_INSTALMENT_LIMIT")
PAY_SUBSIDY_MAX_FOR_100_PERCENT = env.int("PAY_SUBSIDY_MAX_FOR_100_PERCENT")
PAY_SUBSIDY_MAX_FOR_70_PERCENT = env.int("PAY_SUBSIDY_MAX_FOR_70_PERCENT")
PAY_SUBSIDY_MAX_FOR_50_PERCENT = env.int("PAY_SUBSIDY_MAX_FOR_50_PERCENT")
SALARY_BENEFIT_MAX = env.int("SALARY_BENEFIT_MAX")
5 changes: 4 additions & 1 deletion frontend/Dockerfile-localdevelopment
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM registry.access.redhat.com/ubi9/nodejs-18-minimal AS distbase
USER root

# Install ca-certificates so that Sentry can upload source maps
RUN microdnf update -y && microdnf install -y ca-certificates && microdnf clean all
RUN microdnf update -y && microdnf install -y ca-certificates gzip && microdnf clean all

# Install yarn
RUN curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
Expand Down Expand Up @@ -49,6 +49,9 @@ RUN mkdir -p $PROJECT/$FOLDER/.next \
FROM appbase AS development
# =============================

# Create the directory with correct permissions for VSCode server
RUN mkdir -p /opt/app-root/src/.vscode-server && chown -R default:default /opt/app-root/src

# Copy all files
COPY --chown=default:default . .

Expand Down

0 comments on commit 192dc77

Please sign in to comment.