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

Fix Heroku builds by locking python-poetry-buildpack version #1871

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

arsalansufi
Copy link
Contributor

Overview

Heroku builds recently started failing. On the left is a successful build, and on the right is a failed build:

heroku

Recent updates to the python-poetry-buildpack seem to be responsible. Simplest fix for now is to lock to a specific version of the buildpack by specifying a commit hash. Others have also used this technique to bypass issues with the buildpack, as noted in this comment. Through trial-and-error, I've found the latest commit that still works for us.

Note that I'm not sure how the app.json file and Heroku console interact. It's possible that, even after merging this, I'll have to manually update the buildpacks section of the console.

Testing

Manually updated the buildpacks section of the console for staging and deployed successfully

Copy link
Contributor

@jonahkagan jonahkagan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine for now.

Did you try updating to a more recent Poetry version?

Is it worth reporting an issue with the buildpack repo?

@arsalansufi
Copy link
Contributor Author

@jonahkagan I timeboxed an attempt to upgrade Poetry and couldn't quite get things working. I updated the POETRY_VERSION Heroku config var to the latest (1.7.1) and ran into the following error when building in Heroku:

Dependency walk failed at consistent-sampler (*) @ git+https://github.com/votingworks/consistent_sampler.git

I updated my local Poetry and tried re-running poetry install in the hopes that that would modify the poetry.lock or pyproject.toml but didn't see any changes.

While I was at it, I did notice a discrepancy between the Poetry version installed for local dev and the one installed by Heroku. I accordingly updated local dev to match Heroku: aa76581.

Re reporting an issue with the buildpack repo, that makes sense to me. Can do.

Will also open a Vx issue for updating Poetry and removing the stopgap fix introduced by this PR, which will likely be rendered unnecessary by updating Poetry.

@arsalansufi arsalansufi merged commit f09814a into main Jan 30, 2024
5 checks passed
@arsalansufi arsalansufi deleted the arsalan/fix-builds branch January 30, 2024 16:05
@arsalansufi
Copy link
Contributor Author

Actually, on second thought, I decided not to open an issue with the buildpack repo. The issue makes sense to me. The buildpack recently added a poetry self add command (link), which isn't supported by our outdated version of Poetry. There was even a recent correction to that line to support older versions of Poetry, but our version is particularly outdated. I think that upgrading Poetry is the right fix.

@jonahkagan
Copy link
Contributor

Thanks for diving deeper. That all makes sense to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants