Skip to content

Commit

Permalink
WIP: add TODOs
Browse files Browse the repository at this point in the history
Signed-off-by: Natalie Arellano <[email protected]>
  • Loading branch information
natalieparellano committed Sep 22, 2023
1 parent 3d1bb2f commit db7636c
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions buildpack/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ type BuildOutputs struct {
Slices []layers.Slice
}

// BuildExecutor TODO
//
//go:generate mockgen -package testmock -destination ../lifecycle/testmock/build_executor.go github.com/buildpacks/lifecycle/buildpack BuildExecutor
type BuildExecutor interface {
Build(d BpDescriptor, inputs BuildInputs, logger log.Logger) (BuildOutputs, error)
Expand Down
2 changes: 2 additions & 0 deletions buildpack/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const (
KindExtension = "Extension"
)

// Descriptor TODO
//
//go:generate mockgen -package testmock -destination ../lifecycle/testmock/component_descriptor.go github.com/buildpacks/lifecycle/buildpack Descriptor
type Descriptor interface {
API() string
Expand Down
2 changes: 2 additions & 0 deletions buildpack/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ type DetectOutputs struct {
Err error `toml:"-"`
}

// DetectExecutor TODO
//
//go:generate mockgen -package testmock -destination ../lifecycle/testmock/detect_executor.go github.com/buildpacks/lifecycle/buildpack DetectExecutor
type DetectExecutor interface {
Detect(d Descriptor, inputs DetectInputs, logger log.Logger) DetectOutputs
Expand Down
2 changes: 2 additions & 0 deletions buildpack/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type GenerateOutputs struct {
MetRequires []string
}

// GenerateExecutor TODO
//
//go:generate mockgen -package testmock -destination ../lifecycle/testmock/generate_executor.go github.com/buildpacks/lifecycle/buildpack GenerateExecutor
type GenerateExecutor interface {
Generate(d ExtDescriptor, inputs GenerateInputs, logger log.Logger) (GenerateOutputs, error)
Expand Down
2 changes: 2 additions & 0 deletions internal/layer/metadata_restorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"github.com/buildpacks/lifecycle/platform/files"
)

// MetadataRestorer TODO
//
//go:generate mockgen -package testmock -destination ../../lifecycle/testmock/metadata_restorer.go github.com/buildpacks/lifecycle/internal/layer MetadataRestorer
type MetadataRestorer interface {
Restore(buildpacks []buildpack.GroupElement, appMeta files.LayersMetadata, cacheMeta platform.CacheMetadata, layerSHAStore SHAStore) error
Expand Down
2 changes: 2 additions & 0 deletions internal/layer/sbom_restorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"github.com/buildpacks/lifecycle/log"
)

// SBOMRestorer TODO
//
//go:generate mockgen -package testmock -destination ../../lifecycle/testmock/sbom_restorer.go github.com/buildpacks/lifecycle/internal/layer SBOMRestorer
type SBOMRestorer interface {
RestoreFromPrevious(image imgutil.Image, layerDigest string) error
Expand Down
2 changes: 2 additions & 0 deletions lifecycle/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type Platform interface {
API() *api.Version
}

// BuildEnv TODO
//
//go:generate mockgen -package testmock -destination testmock/build_env.go github.com/buildpacks/lifecycle/lifecycle BuildEnv
type BuildEnv interface {
AddRootDir(baseDir string) error
Expand Down
2 changes: 2 additions & 0 deletions lifecycle/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ var (
ErrBuildpack = errors.New("buildpack(s) failed with err")
)

// DetectResolver TODO
//
//go:generate mockgen -package testmock -destination testmock/detect_resolver.go github.com/buildpacks/lifecycle/lifecycle DetectResolver
type DetectResolver interface {
Resolve(done []buildpack.GroupElement, detectRuns *sync.Map) ([]buildpack.GroupElement, []files.BuildPlanEntry, error)
Expand Down
2 changes: 2 additions & 0 deletions lifecycle/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type Exporter struct {
PlatformAPI *api.Version
}

// LayerFactory TODO
//
//go:generate mockgen -package testmock -destination testmock/layer_factory.go github.com/buildpacks/lifecycle/lifecycle LayerFactory
type LayerFactory interface {
DirLayer(id string, dir string, createdBy string) (layers.Layer, error)
Expand Down
2 changes: 2 additions & 0 deletions lifecycle/extender.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ type Extender struct {
Extensions []buildpack.GroupElement // extensions are ordered from group.toml
}

// DockerfileApplier TODO
//
//go:generate mockgen -package testmock -destination testmock/dockerfile_applier.go github.com/buildpacks/lifecycle/lifecycle DockerfileApplier
type DockerfileApplier interface {
ImageFor(reference string) (v1.Image, error)
Expand Down
9 changes: 9 additions & 0 deletions lifecycle/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,34 @@ import (

var Config = &DefaultConfigHandler{}

// CacheHandler TODO
//
//go:generate mockgen -package testmock -destination testmock/cache_handler.go github.com/buildpacks/lifecycle/lifecycle CacheHandler
type CacheHandler interface {
InitCache(imageRef, dir string, deletionEnabled bool) (Cache, error)
}

// DirStore TODO
//
//go:generate mockgen -package testmock -destination testmock/dir_store.go github.com/buildpacks/lifecycle/lifecycle DirStore
type DirStore interface {
Lookup(kind, id, version string) (buildpack.Descriptor, error)
LookupBp(id, version string) (*buildpack.BpDescriptor, error)
LookupExt(id, version string) (*buildpack.ExtDescriptor, error)
}

// TODO: figure out where this goes
//go:generate mockgen -package testmock -destination testmock/image_handler.go github.com/buildpacks/lifecycle/image Handler

// BuildpackAPIVerifier TODO
//
//go:generate mockgen -package testmock -destination testmock/buildpack_api_verifier.go github.com/buildpacks/lifecycle/lifecycle BuildpackAPIVerifier
type BuildpackAPIVerifier interface {
VerifyBuildpackAPI(kind, name, requested string, logger log.Logger) error
}

// ConfigHandler TODO
//
//go:generate mockgen -package testmock -destination testmock/config_handler.go github.com/buildpacks/lifecycle/lifecycle ConfigHandler
type ConfigHandler interface {
ReadAnalyzed(path string, logger log.Logger) (files.Analyzed, error)
Expand Down

0 comments on commit db7636c

Please sign in to comment.