Giter VIP home page Giter VIP logo

Comments (4)

sclevine avatar sclevine commented on August 16, 2024

The BuildpackMap is constructed from the buildpack.toml files in each buildpack on the filesystem[1]. It has no concept of Optional (even though it re-uses the Buildpack struct with that field).

Each buildpack in BuildpackMap can be referenced multiple times in order.toml or group.toml. When lookup is called in ReadOrder, we copy the optional field value onto the value from the BuildpackMap before returning it, so that you can convert an order.toml file that is missing the info from the buildpack.toml files to a fully-hydrated structure in memory. In the case of group.toml/ReadGroup, the copying of the Optional field is meaningless, because optionality isn't relevant after the detection process (which removes optional buildpacks that failed detection).

This code could be tidied up a bit (perhaps by creating different types of buildpack structs for different use cases), but I think the behavior (and spec[2]) are both accurate. Are you seeing otherwise in the behavior of the lifecycle?

[1] https://github.com/buildpack/lifecycle/blob/master/map.go#L21
[2] https://github.com/buildpack/spec/blob/master/platform.md#data-format

from lifecycle.

ekcasey avatar ekcasey commented on August 16, 2024

@squee1945 @sclevine

Sounds like this is a critique of the code readability rather than a bug. I'm inclined to close unless anyone feels strongly to the contrary (we can certainly refactor for clarity but this issue feels misleading)

from lifecycle.

squee1945 avatar squee1945 commented on August 16, 2024

from lifecycle.

ekcasey avatar ekcasey commented on August 16, 2024

@squee1945 I am closing this issue. Feel free to open an issue or PR on the spec repo if you feel that the specification lacks clarity.

from lifecycle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.