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

Remove Tagger from Builder interface #1601

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Feb 5, 2019

Tags are now computed by the runner and passed as a map to the builder.
This makes it easier to transform builder into plugins that have basically no notion of tagging

@dgageot dgageot force-pushed the remove-tagger-from-builder-interface branch from 384aa1b to ed84316 Compare February 5, 2019 16:18
@codecov-io
Copy link

codecov-io commented Feb 5, 2019

Codecov Report

Merging #1601 into master will increase coverage by 0.69%.
The diff coverage is 69.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1601      +/-   ##
==========================================
+ Coverage   46.31%   47.01%   +0.69%     
==========================================
  Files         117      117              
  Lines        5106     5118      +12     
==========================================
+ Hits         2365     2406      +41     
+ Misses       2508     2471      -37     
- Partials      233      241       +8
Impacted Files Coverage Δ
pkg/skaffold/build/gcb/cloud_build.go 0% <0%> (ø) ⬆️
pkg/skaffold/build/kaniko/kaniko.go 0% <0%> (ø) ⬆️
pkg/skaffold/runner/timings.go 15.38% <0%> (ø) ⬆️
pkg/skaffold/build/local/local.go 51.72% <100%> (-17.03%) ⬇️
pkg/skaffold/build/prebuilt.go 82.75% <100%> (ø) ⬆️
pkg/skaffold/build/sequence.go 100% <100%> (ø) ⬆️
pkg/skaffold/runner/runner.go 61.74% <73.33%> (+0.8%) ⬆️
pkg/skaffold/build/parallel.go 88.63% <88.88%> (+88.63%) ⬆️
pkg/skaffold/build/local/docker.go 47.5% <0%> (-10%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 36782cc...c6f2b7d. Read the comment docs.

Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

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

so much cleaner 😍 a few nits but it looks great

@@ -57,7 +43,7 @@ func TestLocalRun(t *testing.T) {
var tests = []struct {
description string
api testutil.FakeAPIClient
tagger tag.Tagger
tagger tag.ByImage
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd change this to tags instead of tagger

@@ -46,7 +46,7 @@ func (b *prebuiltImagesBuilder) Labels() map[string]string {
}
}

func (b *prebuiltImagesBuilder) Build(ctx context.Context, out io.Writer, tagger tag.Tagger, artifacts []*latest.Artifact) ([]Artifact, error) {
func (b *prebuiltImagesBuilder) Build(ctx context.Context, out io.Writer, tagsIgnored tag.ByImage, artifacts []*latest.Artifact) ([]Artifact, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if these are actually unused then can we just pass them as _ tag.ByImage?

@@ -16,6 +16,9 @@ limitations under the License.

package tag

// ByImage maps image names to tags
type ByImage map[string]string
Copy link
Contributor

Choose a reason for hiding this comment

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

this name is slightly confusing to me, maybe it makes more sense as ImageTags or ImageToTag?

@@ -254,9 +255,34 @@ func (r *SkaffoldRunner) Run(ctx context.Context, out io.Writer, artifacts []*la
return nil
}

// imageTags generates tags for a list of artifacts
func (r *SkaffoldRunner) imageTags(out io.Writer, artifacts []*latest.Artifact) (tag.ByImage, error) {
tags := make(tag.ByImage)
Copy link
Contributor

Choose a reason for hiding this comment

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

tags := make(tag.ByImage, len(artifacts))?

@dgageot dgageot force-pushed the remove-tagger-from-builder-interface branch from ed84316 to c6f2b7d Compare February 6, 2019 12:55
@dgageot
Copy link
Contributor Author

dgageot commented Feb 6, 2019

@nkubala @priyawadhwa Should be ready for review

Copy link
Contributor

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

so hyped for this! LGTM

@dgageot dgageot merged commit 08d5615 into GoogleContainerTools:master Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants