Skip to content

Simplify buildpack.toml encoding/decoding #179

Description

@sophiewigmore

The code in cargo/config.go is responsible for decoding buildpack.toml files into Go structs, as well was encoding structs into TOML. This code is integral to the jam tool.

There are a couple of concerns around this code, given how integral it is to our tools.

  1. The TOML decoding/encoding is done with the BurntSushi/toml package, which is in an unmaintained/archived status. It's worrisome to use a package in this state.
  2. Due to the nature of the structs involved and the usage of the BurntSushi/toml package we have to convert into JSON as an intermittent step in order to decode/encode correctly. This makes for extremely complicated and hard to maintain code.

While all of this functionality works for our use case, this issue is here to document the technical debt associated with this code.

There is a newer TOML library, github.com/pelletier/go-toml that looks like a promising alternative for our use case. Upon initial investigation, there are a couple outstanding issues around using custom TOML marshalling that prevent us from using it currently. Upon the fix of theses issues this could be an option to resolve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementA new feature or requeststatus/blockedThis issue has been triaged and resolving it is blocked on some other issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions