Conversation
b336fd4 to
871e068
Compare
Previously if an app was missing the necessary Python package manager files, buildpack detection would fail with the generic error message provided by the build system (see previous version of test fixtures for an example). This error message required users to click through to the Dev Center documentation to find out what files need to be present for a Python app to work on Heroku, and there are quite a few support tickets where users have struggled to resolve this themselves (see GUS work item for ticket links). Now a custom error message is displayed, similar to what the Node.js and PHP buildpacks do: https://github.com/heroku/heroku-buildpack-nodejs/blob/main/bin/detect https://github.com/heroku/heroku-buildpack-php/blob/main/bin/detect This error message lists some common reasons why the files might not be found (such as them not being in the root directory), and also prints a directory listing of the root directory to help the user (and support) understand what is happening. Lastly, the detection logic has been made more permissive, so that Python apps that are missing some of the required files (but have other misc Python related files) still pass detection, allowing us to perform the stricter file check during the build phase instead. This is particularly important for the "new app with no buildpacks set" case, where in the case of buildpack detect failure a custom detect error message is not shown by the build system (since it's not viable to show the custom message from half a dozen language buildpacks simultaneously), but a build phase error message is. These changes also bring the classic Python buildpack more in line with the Python CNB implementation: https://github.com/heroku/buildpacks-python/blob/447c7dd978bc3069fb1baa0005a83e4720ba1e63/src/detect.rs#L4-L25 https://github.com/heroku/buildpacks-python/blob/447c7dd978bc3069fb1baa0005a83e4720ba1e63/src/errors.rs#L71-L81 GUS-W-7924407.
871e068 to
d55511b
Compare
joshwlewis
approved these changes
Jun 28, 2024
joshwlewis
reviewed
Jun 28, 2024
colincasey
approved these changes
Jun 28, 2024
50d6474 to
3c1380d
Compare
3c1380d to
7b43c16
Compare
Merged
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously if an app was missing the necessary Python package manager files, buildpack detection would fail with the generic error message provided by the build system (see previous version of test fixtures for an example).
This error message required users to click through to the Dev Center documentation to find out what files need to be present for a Python app to work on Heroku, and there are quite a few support tickets where users have struggled to resolve this themselves (see GUS work item for ticket links).
Now a custom error message is displayed, similar to what the Node.js and PHP buildpacks do:
https://github.com/heroku/heroku-buildpack-nodejs/blob/main/bin/detect
https://github.com/heroku/heroku-buildpack-php/blob/main/bin/detect
This error message lists some common reasons why the files might not be found (such as them not being in the root directory), and also prints a directory listing of the root directory to help the user (and support) understand what is happening.
Lastly, the detection logic has been made more permissive, so that Python apps that are missing some of the required files (but have other misc Python related files) still pass detection, allowing us to perform the stricter file check during the build phase instead. This is particularly important for the "new app with no buildpacks set" case, where in the case of buildpack detect failure a custom detect error message is not shown by the build system (since it's not viable to show the custom message from half a dozen language buildpacks simultaneously), but a build phase error message is.
These changes also bring the classic Python buildpack more in line with the Python CNB implementation:
https://github.com/heroku/buildpacks-python/blob/447c7dd978bc3069fb1baa0005a83e4720ba1e63/src/detect.rs#L4-L25
https://github.com/heroku/buildpacks-python/blob/447c7dd978bc3069fb1baa0005a83e4720ba1e63/src/errors.rs#L71-L81
GUS-W-7924407.