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

Unify Jib command wrapper usage #1105

Merged
merged 5 commits into from
Oct 8, 2018

Conversation

briandealwis
Copy link
Member

Create a new CommandWrapper structure to specify the executable and wrapper names. Command lines are generated by a CommandWrapper#CreateCommand() method. I found examples of Maven having a .bat and .cmd wrappers, so we leave the extension determining to the CreateCommand() method.

The builder codepath passes along a context, but the dependency-tracking codepath does not (#1104) so I pass along a dummy context for now.

@codecov-io
Copy link

Codecov Report

Merging #1105 into jib_skaffold will increase coverage by 0.42%.
The diff coverage is 54.83%.

Impacted file tree graph

@@               Coverage Diff                @@
##           jib_skaffold    #1105      +/-   ##
================================================
+ Coverage         42.94%   43.37%   +0.42%     
================================================
  Files                82       78       -4     
  Lines              3600     3341     -259     
================================================
- Hits               1546     1449      -97     
+ Misses             1912     1759     -153     
+ Partials            142      133       -9
Impacted Files Coverage Δ
pkg/skaffold/build/local/jib.go 100% <ø> (+43.75%) ⬆️
pkg/skaffold/runner/runner.go 52.25% <0%> (-6.17%) ⬇️
pkg/skaffold/build/local/jib_gradle.go 42.1% <0%> (ø) ⬆️
pkg/skaffold/build/local/jib_maven.go 35% <0%> (ø) ⬆️
pkg/skaffold/jib/jib_gradle.go 100% <100%> (ø) ⬆️
pkg/skaffold/jib/jib_maven.go 100% <100%> (ø) ⬆️
pkg/skaffold/util/wrapper_unix.go 100% <100%> (ø)
pkg/skaffold/watch/watch.go 84.61% <0%> (-2.89%) ⬇️
pkg/skaffold/runner/timings.go 14.63% <0%> (-0.89%) ⬇️
... and 5 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 b819f27...52e0c2f. Read the comment docs.

@coollog coollog mentioned this pull request Oct 5, 2018
11 tasks
@dgageot dgageot merged commit 780b26d into GoogleContainerTools:jib_skaffold Oct 8, 2018
},
},
{
description: "gradle with wrapper",
jibGradleArtifact: latest.JibGradleArtifact{},
filesInWorkspace: []string{getWrapperGradle()},
filesInWorkspace: []string{"gradle", "gradle.cmd"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be gradlew? Maybe these tests should check the command uses the wrapper?

func (cw CommandWrapper) CreateCommand(ctx context.Context, workingDir string, args []string) *exec.Cmd {
executable := cw.Executable

if cw.Wrapper != "" && !SkipWrapperCheck {
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed SkipWrapperCheck is always false - was this intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

For tests. I should use that in #1152's tests.

@briandealwis briandealwis deleted the jib-unified branch August 30, 2019 20:01
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.

4 participants