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

Lists files recursively in jib.getDependencies and other fixes. #1097

Merged
merged 9 commits into from
Oct 8, 2018

Conversation

coollog
Copy link
Contributor

@coollog coollog commented Oct 4, 2018

Resolves issues in #1096:

  • Rename error message to jibMaven and jibGradle.
  • GetDependenciesGradle process JibGradleArtifact.Project
  • runner.dependenciesForArtifact seems to try to resolve absolute deps against workspace
  • GetDependencies* to list files recursively
  • Error if trying to use Maven multi-module in jib.GetDependenciesMaven

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@coollog coollog mentioned this pull request Oct 4, 2018
11 tasks
@coollog coollog changed the base branch from master to jib_skaffold October 4, 2018 18:06
@coollog
Copy link
Contributor Author

coollog commented Oct 4, 2018

/cc @GoogleContainerTools/java-tools

@loosebazooka
Copy link
Member

loosebazooka commented Oct 4, 2018

should we be rebased against that feature branch? ah never mind.

@codecov-io
Copy link

codecov-io commented Oct 4, 2018

Codecov Report

Merging #1097 into jib_skaffold will increase coverage by 0.14%.
The diff coverage is 72.41%.

Impacted file tree graph

@@               Coverage Diff                @@
##           jib_skaffold    #1097      +/-   ##
================================================
+ Coverage         43.37%   43.51%   +0.14%     
================================================
  Files                78       78              
  Lines              3341     3362      +21     
================================================
+ Hits               1449     1463      +14     
- Misses             1759     1764       +5     
- Partials            133      135       +2
Impacted Files Coverage Δ
pkg/skaffold/runner/runner.go 51.78% <0%> (-0.47%) ⬇️
pkg/skaffold/jib/jib_gradle.go 100% <100%> (ø) ⬆️
pkg/skaffold/jib/jib_maven.go 83.33% <33.33%> (-16.67%) ⬇️
pkg/skaffold/jib/jib.go 88% <82.35%> (-12%) ⬇️

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 780b26d...30ce7ed. Read the comment docs.

@coollog coollog changed the title Lists files recursively in jib.getDependencies. Lists files recursively in jib.getDependencies and other fixes. Oct 4, 2018
@googlebot
Copy link

CLAs look good, thanks!

@coollog
Copy link
Contributor Author

coollog commented Oct 4, 2018

Merged #1073 .

// Resolves directories recursively.
info, err := os.Stat(dep)
if err != nil {
if os.IsNotExist(err) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is modeled after the logic in changes.go#stat. I think ignoring non-existent files should be fine here since the files would be ignored by stat anyways. The alternative is to just add the file to the deps list upon this os.Stat error. Thoughts?

@@ -428,7 +428,10 @@ func dependenciesForArtifact(a *latest.Artifact) ([]string, error) {

var p []string
for _, path := range paths {
p = append(p, filepath.Join(a.Workspace, path))
if !filepath.IsAbs(path) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be fine in regards to the other artifacts right? There should be no case where a dep would be absolute yet need to resolve against workspace?

@loosebazooka
Copy link
Member

Logically looks fine to me, would probably want to have someone on @GoogleContainerTools/container-tools check out the go code.

Copy link
Contributor

@dgageot dgageot left a comment

Choose a reason for hiding this comment

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

I’ll have a look tomorrow

@dgageot
Copy link
Contributor

dgageot commented Oct 8, 2018

Sorry, this needs to be rebased

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@googlebot
Copy link

CLAs look good, thanks!

@coollog
Copy link
Contributor Author

coollog commented Oct 8, 2018

This is rebased and good for review.

return nil, errors.Wrapf(err, "unable to stat file %s", dep)
}
if info.IsDir() {
err := filepath.Walk(dep, func(path string, info os.FileInfo, err error) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

godirwalk.Walk is much faster at walking directories (like 10x faster), which is important since this is going to run every second in watch mode.
It's ok to leave that this way but we should take note to improve it in another PR.

@dgageot dgageot merged commit 751476e into GoogleContainerTools:jib_skaffold Oct 8, 2018
@coollog coollog deleted the jib-walk-deps branch October 8, 2018 18:58
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.

5 participants