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

[jib-cli-jar] Add option to specify creation time of container #3050

Merged
merged 7 commits into from
Feb 12, 2021

Conversation

mpeddada1
Copy link
Contributor

Required a bit of refactoring to use the Instants class which was initially implemented for the build command.

@mpeddada1 mpeddada1 requested a review from a team February 11, 2021 17:03
@google-cla google-cla bot added the cla: yes label Feb 11, 2021
Copy link
Member

@chanseokoh chanseokoh left a comment

Choose a reason for hiding this comment

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

Can we add a test that checks the default time of the built image (or something to that effect) when the option was not given?

@codecov
Copy link

codecov bot commented Feb 11, 2021

Codecov Report

Merging #3050 (033bb33) into master (0643c90) will increase coverage by 0.01%.
The diff coverage is 80.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3050      +/-   ##
============================================
+ Coverage     71.07%   71.09%   +0.01%     
- Complexity     2305     2307       +2     
============================================
  Files           278      278              
  Lines          9751     9755       +4     
  Branches        989      989              
============================================
+ Hits           6931     6935       +4     
  Misses         2480     2480              
  Partials        340      340              
Impacted Files Coverage Δ Complexity Δ
.../java/com/google/cloud/tools/jib/cli/Instants.java 91.66% <0.00%> (ø) 1.00 <0.00> (?)
...e/cloud/tools/jib/cli/buildfile/BuildFileSpec.java 100.00% <ø> (ø) 22.00 <0.00> (ø)
...ud/tools/jib/cli/buildfile/FilePropertiesSpec.java 100.00% <ø> (ø) 9.00 <0.00> (ø)
.../main/java/com/google/cloud/tools/jib/cli/Jar.java 42.18% <100.00%> (+2.84%) 13.00 <2.00> (+2.00)
...a/com/google/cloud/tools/jib/cli/jar/JarFiles.java 95.45% <100.00%> (+0.21%) 3.00 <0.00> (ø)

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 0643c90...033bb33. Read the comment docs.

@CommandLine.Option(
names = "--creation-time",
paramLabel = "<creation-time>",
description =
Copy link
Member

Choose a reason for hiding this comment

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

Another option is to provide the default (e.g., 0?). That way, maybe creationTime can never be null?

Either way has pros and cons though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did think about adding a default but I assumed this would be a little redundant since we already have a default value for this field in jib?

Copy link
Member

Choose a reason for hiding this comment

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

Either is fine. At least we can document the default value in the option description.

@mpeddada1 mpeddada1 merged commit 73a6395 into master Feb 12, 2021
@mpeddada1 mpeddada1 deleted the cli-creation-time branch February 12, 2021 15:56
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.

2 participants