Error if we're not the first buildpack#14
Open
schneems wants to merge 1 commit into
Open
Conversation
I had someone using the `heroku/metrics` buildpack which writes to `.profile.d` directory running before this buildpack. Because this buildpack deletes everything at the root, including things from other build packs, the change was not preserved even though it looked like it executed correctly. I'm proposing if we detect that another buildpack has executed (i.e. if the `.profile.d` folder is not empty), that we abort and error with a helpful message: ``` [main 2446fe5] empty Enumerating objects: 1, done. Counting objects: 100% (1/1), done. Writing objects: 100% (1/1), 185 bytes | 185.00 KiB/s, done. Total 1 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Using buildpacks: remote: 1. heroku/metrics remote: 2. https://github.com/schneems/subdir-heroku-buildpack#schneems/don-t-delete-profile-d remote: -----> HerokuRuntimeMetrics app detected remote: -----> Setting up .profile.d to automatically run metrics agent... remote: -----> Subdir buildpack app detected remote: -----> Subdir buildpack in api remote: Another buildpack seems to have run remote: before the subdir buildpack. This remote: may cause unexpected problems. remote: remote: Ensure '$ heroku buildpacks' lists remote: the subdir buildpack first and try remote: again. remote: ! Push rejected, failed to compile Subdir buildpack app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to still-harbor-23981. $ heroku buildpacks === still-harbor-23981 Buildpack URLs 1. heroku/metrics 2. https://github.com/schneems/subdir-heroku-buildpack#schneems/don-t-delete-profile-d ```
36def2c to
99e5ac3
Compare
Contributor
|
I just came across another case which caused confusion when debugging, due to the subdir buildpack not being listed first (which caused the earlier buildpacks to be clobbered). @timanovsky Would you be open to merging this? |
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.
I had someone using the
heroku/metricsbuildpack which writes to.profile.ddirectory running before this buildpack. Because this buildpack deletes everything at the root, including things from other build packs, the change was not preserved even though it looked like it executed correctly.I'm proposing if we detect that another buildpack has executed (i.e. if the
.profile.dfolder is not empty), that we abort and error with a helpful message: