Skip to content

Commit

Permalink
remove the version restriction for gunicorn w/ burnettk
Browse files Browse the repository at this point in the history
  • Loading branch information
jasquat committed Dec 2, 2024
1 parent def33b2 commit ad8fbc7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 35 deletions.
11 changes: 2 additions & 9 deletions spiffworkflow-backend/bin/wait_for_backend_to_be_up
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

function error_handler() {
>&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
echo >&2 "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
exit "$2"
}
trap 'error_handler ${LINENO} $?' ERR
Expand All @@ -15,18 +15,11 @@ backend_base_url="http://localhost:${port}"
echo "waiting for backend to come up at ${backend_base_url} ..."
while [[ "$(curl -s -o /dev/null -w '%{http_code}' "${backend_base_url}/v1.0/status")" != "200" ]]; do
if [[ "$attempts" -gt "$max_attempts" ]]; then
>&2 echo "ERROR: Server not up after $max_attempts attempts. There is probably a problem"
echo >&2 "ERROR: Server not up after $max_attempts attempts. There is probably a problem"
exit 1
fi
attempts=$((attempts + 1))
sleep 1
done

echo "attempting to hit backend with SCRIPT_NAME as well, just to make sure that works, since gunicorn broke this in 22.0.0"
status_code_for_script_name_check="$(curl -s -o /dev/null -w '%{http_code}' -H "SCRIPT_NAME: /api" "${backend_base_url}/api/v1.0/status")"
if [[ "$status_code_for_script_name_check" != "200" ]]; then
>&2 echo "ERROR: Server came up, but the additional check for hitting it at /api with a SCRIPT_NAME header failed. This probably means that celery was upgraded past 22.0.0 and they still haven't fixed the bug linked in pyproject.toml. status code was: ${status_code_for_script_name_check}"
exit 1
fi

echo "backend up"
29 changes: 7 additions & 22 deletions spiffworkflow-backend/poetry.lock

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

5 changes: 1 addition & 4 deletions spiffworkflow-backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ Jinja2 = "^3.1.3"
RestrictedPython = "^7.4"
Flask-SQLAlchemy = "^3"

# 22.0.0 breaks passing in SCRIPT_NAME as a header which breaks status environments
# https://github.com/benoitc/gunicorn/issues/3200
# https://github.com/benoitc/gunicorn/issues/2650
gunicorn = "23.0.0"
gunicorn = "^23.0.0"

# https://github.com/dropbox/sqlalchemy-stubs/pull/251
# someday get off github
Expand Down

0 comments on commit ad8fbc7

Please sign in to comment.