Skip to content

Git tagger variants (Tags, CommitSha, AbbrevCommitSha)#1902

Merged
balopat merged 6 commits intoGoogleContainerTools:masterfrom
corneliusweig:git-tagger-improvements
Apr 25, 2019
Merged

Git tagger variants (Tags, CommitSha, AbbrevCommitSha)#1902
balopat merged 6 commits intoGoogleContainerTools:masterfrom
corneliusweig:git-tagger-improvements

Conversation

@corneliusweig
Copy link
Copy Markdown
Contributor

@corneliusweig corneliusweig commented Apr 1, 2019

Synopsis

Currently, the git tagger always uses git tags or abbreviated git hashes to generate image tags. Issue #407 suggests, to extends the git tagger with a few variants:

  • Tags (default): use git tags or fall back to abbreviated commit hash
  • CommitSha: use the full git commit sha
  • AbbrevCommitSha: use the abbreviated git commit sha

Config change

To switch between the different variants of the git tagger, the GitTagger config was changed to

tagPolicy:
  #  before
  # gitCommit: {}

  # new
  gitCommit:
   # variant is an enum with valid values (case-insensitive)
   # - Tags
   # - CommitSha
   # - AbbrevCommitSha
    variant: Tags # default

See #407

@corneliusweig corneliusweig force-pushed the git-tagger-improvements branch from 11309cc to fcc5cec Compare April 1, 2019 23:08
@tejal29 tejal29 added the kokoro:run runs the kokoro jobs on a PR label Apr 1, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Apr 1, 2019
@corneliusweig corneliusweig force-pushed the git-tagger-improvements branch from d599e4c to 6213829 Compare April 2, 2019 10:07
@corneliusweig
Copy link
Copy Markdown
Contributor Author

Well, OSX seems to have serious trouble to determine the git path for the TreeSha variant. I'm going to remove TreeSha and AbbrevTreeSha for now and create a separate PR for those, because I have no way to debug this.

@corneliusweig corneliusweig force-pushed the git-tagger-improvements branch from 6213829 to ffaefc8 Compare April 2, 2019 11:39
@corneliusweig corneliusweig changed the title Git tagger variants (Tags, CommitSha, AbbrevCommitSha, TreeSha, AbbrevTreeSha) Git tagger variants (Tags, CommitSha, AbbrevCommitSha) Apr 2, 2019
@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 2, 2019

Codecov Report

Merging #1902 into master will increase coverage by 3.33%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1902      +/-   ##
==========================================
+ Coverage   52.59%   55.92%   +3.33%     
==========================================
  Files         182      173       -9     
  Lines        7893     7565     -328     
==========================================
+ Hits         4151     4231      +80     
+ Misses       3352     2940     -412     
- Partials      390      394       +4
Impacted Files Coverage Δ
pkg/skaffold/schema/latest/config.go 100% <ø> (ø) ⬆️
pkg/skaffold/schema/v1beta8/upgrade.go 66.66% <ø> (ø) ⬆️
pkg/skaffold/runner/runner.go 66.87% <100%> (+4.93%) ⬆️
pkg/skaffold/build/tag/git_commit.go 80% <84%> (+3.8%) ⬆️
pkg/skaffold/build/local/docker.go 56.81% <0%> (-43.19%) ⬇️
pkg/skaffold/jib/jib.go 76.34% <0%> (-7.53%) ⬇️
pkg/skaffold/util/util.go 64.92% <0%> (-3.05%) ⬇️
pkg/skaffold/jib/jib_gradle.go 100% <0%> (ø) ⬆️
pkg/skaffold/jib/jib_maven.go 100% <0%> (ø) ⬆️
pkg/skaffold/schema/v1beta7/config.go 100% <0%> (ø) ⬆️
... and 47 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 fc22668...63d0f58. Read the comment docs.

@corneliusweig corneliusweig force-pushed the git-tagger-improvements branch 3 times, most recently from 63aa411 to 4262cd2 Compare April 5, 2019 13:19
@corneliusweig corneliusweig force-pushed the git-tagger-improvements branch from 4262cd2 to 8f1a18b Compare April 16, 2019 10:32
- Tags (default): use git tags or fall back to abbreviated commit hash
- CommitSha: use the full git commit sha
- AbbrevCommitSha: use the abbreviated git commit sha

Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
@corneliusweig corneliusweig force-pushed the git-tagger-improvements branch from 8f1a18b to 52ec837 Compare April 16, 2019 20:01
Variant is an enum that selects which git tagger variant to use.

Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
@corneliusweig corneliusweig force-pushed the git-tagger-improvements branch from 52ec837 to c6752d4 Compare April 16, 2019 20:10
// GitTagger *beta* tags images with the git tag or commit of the artifact's workspace.
type GitTagger struct{}
type GitTagger struct {
// Variant determines the behavior of the git tagger. Valid variants are
Copy link
Copy Markdown
Contributor Author

@corneliusweig corneliusweig Apr 17, 2019

Choose a reason for hiding this comment

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

Will this doc string list render well in the consumers of this doc?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's not the best, maybe we could remove the dashes?
multiline comments get merged into a single line - you can always check with make preview-docs!
https://github.com/GoogleContainerTools/skaffold/pull/1902/files#diff-4db1e0a21e170b019f0d05230514a5ccR808
http://35.236.122.247:1313/docs/references/yaml/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you can always check with make preview-docs!

So true...
I agree, the dashes really don't help. But I just realized that I can wrap the enum values with backticks, which should help.

@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Apr 17, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Apr 17, 2019
@balopat balopat added the docs-modifications runs the docs preview service on the given PR label Apr 17, 2019
@container-tools-bot
Copy link
Copy Markdown

Please visit http://35.236.122.247:1313 to view changes to the docs.

@container-tools-bot container-tools-bot removed the docs-modifications runs the docs preview service on the given PR label Apr 17, 2019
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
Copy link
Copy Markdown
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.

two small nits, but otherwise LGTM

Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
@corneliusweig corneliusweig requested a review from tejal29 as a code owner April 25, 2019 19:05
// Upgrade upgrades a configuration to the next version.
// Config changes from v1beta7 to v1beta8
// 1. Additions:
// kaniko/resource requirements
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should this be removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Of course not, so lazy of me 🤦‍♂️

Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Apr 25, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Apr 25, 2019
@balopat balopat added the docs-modifications runs the docs preview service on the given PR label Apr 25, 2019
@container-tools-bot
Copy link
Copy Markdown

Please visit http://35.236.71.41:1313 to view changes to the docs.

@container-tools-bot container-tools-bot removed the docs-modifications runs the docs preview service on the given PR label Apr 25, 2019
Copy link
Copy Markdown
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@balopat balopat merged commit 9c47a08 into GoogleContainerTools:master Apr 25, 2019
@corneliusweig corneliusweig deleted the git-tagger-improvements branch April 25, 2019 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants