Return frozen empty stand-in from #lifecycle_data on missing row#5263
Open
philippthun wants to merge 1 commit into
Open
Return frozen empty stand-in from #lifecycle_data on missing row#5263philippthun wants to merge 1 commit into
philippthun wants to merge 1 commit into
Conversation
3fdbd0d to
e8d7a18
Compare
The buildpack_lifecycle_data / cnb_lifecycle_data row can be destroyed
independently of the owning app, build, or droplet. When that happens,
calling #lifecycle_data returns nil and callers not guarding further
method invocations hit NoMethodError (e.g. build_presenter.rb on
lifecycle_data.to_hash), resulting in an HTTP 500 response.
Fall back to a frozen empty BuildpackLifecycleDataModel /
CNBLifecycleDataModel instance so callers see a well-shaped object
whose to_hash returns '{ buildpacks: [], stack: nil }'. The freeze
prevents any accidental attempt to persist the stand-in.
Also freeze the docker-branch stand-in for the same reason and
consistency.
Document the possibility of an empty data payload in the buildpack
and cnb sections of the v3 lifecycle doc.
e8d7a18 to
c4c18cb
Compare
jochenehret
approved these changes
Jul 3, 2026
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.
The
buildpack_lifecycle_data/cnb_lifecycle_datarow can be destroyed independently of the owning app, build, or droplet. When that happens, calling#lifecycle_datareturns nil and callers not guarding further method invocations hitNoMethodError(e.g.build_presenter.rbonlifecycle_data.to_hash), resulting in an HTTP 500 response.Fall back to a frozen empty
BuildpackLifecycleDataModel/CNBLifecycleDataModelinstance so callers see a well-shaped object whoseto_hashreturns{ buildpacks: [], stack: nil }. The freeze prevents any accidental attempt to persist the stand-in.Also freeze the docker-branch stand-in for the same reason and consistency.
Document the possibility of an empty data payload in the buildpack and cnb sections of the v3 lifecycle doc.
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests