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

remove the version restriction for gunicorn #2170

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
Loading