Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency mappings #119

Merged
merged 8 commits into from
Feb 25, 2021
Merged

Dependency mappings #119

merged 8 commits into from
Feb 25, 2021

Conversation

fg-j
Copy link

@fg-j fg-j commented Feb 23, 2021

Summary

Adds the ability to look for dependency mappings in bindings. Notably, doesn't change the interface of the postal Service to avoid disrupting existing buildpacks. The interface will likely change once we fully implement Service Bindings support.

Resolves #106

Use Cases

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have added an integration test, if necessary.

@fg-j fg-j requested a review from a team as a code owner February 23, 2021 16:44
@fg-j fg-j marked this pull request as draft February 23, 2021 16:45
@fg-j fg-j marked this pull request as ready for review February 23, 2021 19:43
Copy link
Member

@ryanmoran ryanmoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is implemented, DependencyMappingResolver has become part of the public API for postal. Do we have a usecase that justifies exposing it as part of the public API, or should we make it private? If it can be justified as a useful part of the public API, then I'd like to see documentation included in the code like we have for the other public types and functions:

packit/postal/service.go

Lines 36 to 43 in e6b39a5

// Resolve will pick the best matching dependency given a path to a
// buildpack.toml file, and the id, version, and stack value of a dependency.
// The version value is treated as a SemVer constraint and will pick the
// version that matches that constraint best. If the version is given as
// "default", the default version for the dependency with the given id will be
// used. If there is no default version for that dependency, a wildcard
// constraint will be used.
func (s Service) Resolve(path, id, version, stack string) (Dependency, error) {

postal/dependency_mappings.go Outdated Show resolved Hide resolved
postal/dependency_mappings.go Outdated Show resolved Hide resolved
@ryanmoran ryanmoran self-requested a review February 25, 2021 01:17
ryanmoran
ryanmoran previously approved these changes Feb 25, 2021
@ryanmoran
Copy link
Member

@fg-j @ForestEckhardt Can you rebase this off main? I am getting conflicts that I cannot resolve by just clicking a button.

Sophie Wigmore added 3 commits February 25, 2021 09:30
- This might not be the best solution
- Need to figure out how to fake out the /platform/binding path
Frankie Gallina-Jones added 5 commits February 25, 2021 15:52
to avoid changing Service constructor and Install() interfaces

Signed-off-by: Forest Eckhardt <feckhardt@pivotal.io>
Signed-off-by: Forest Eckhardt <feckhardt@pivotal.io>
Signed-off-by: Forest Eckhardt <feckhardt@pivotal.io>
Signed-off-by: Forest Eckhardt <feckhardt@pivotal.io>
@ryanmoran
Copy link
Member

I don't know what happened in the original rebase, but this ended up weirdly including draft and jam update-builder commits that clearly didn't belong to this PR. I've dropped those commits so its a bit more clear what this PR includes and the history looks more reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support dependency mappings
2 participants