before_code stringlengths 30 149k | reviewer_comment stringlengths 16 20.6k | after_code stringlengths 30 163k | diff_context stringlengths 0 22.4k | file_path stringlengths 6 155 | comment_line int64 0 26 | language stringclasses 19
values | quality_score float64 0.07 1 | comment_type stringclasses 9
values | comment_length int64 16 20.6k | before_lines int64 2 4.61k | after_lines int64 2 4.4k | is_negative bool 2
classes | pr_title stringlengths 7 140 | pr_number int64 18 61.2k | repo_name stringclasses 29
values | repo_stars int64 321 56k | repo_language stringclasses 14
values | reviewer_username stringclasses 378
values | author_username stringclasses 739
values | user stringlengths 361 200k | assistant stringlengths 16 20.6k | system stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Assert.assertEquals(2, manifestTemplate.getSchemaVersion());
Assert.assertTrue(manifestTemplate.getLayers().size() > 0);
}
@Test
public void testPull_ociManifest() throws IOException, RegistryException {
RegistryClient registryClient =
RegistryClient.factory(EventHandlers.NONE, "gcr.io", "dis... | minor: how about we say something like "at the specified sha`? This can prevent the comment from becoming stale if the variable name changes. | assertThat(manifestTemplate.getSchemaVersion()).isEqualTo(2);
assertThat(manifestTemplate.getLayers()).isNotEmpty();
}
@Test
public void testPull_ociManifest() throws IOException, RegistryException {
RegistryClient registryClient =
RegistryClient.factory(EventHandlers.NONE, "gcr.io", "distrol... | @@ -80,31 +112,41 @@ public void testPull_v22ManifestList() throws IOException, RegistryException {
RegistryClient.factory(EventHandlers.NONE, "gcr.io", "distroless/base", httpClient)
.newRegistryClient();
- // Ensure ":latest" is a manifest list
+ // Ensures call to image at KNOWN_MANIFES... | jib-core/src/integration-test/java/com/google/cloud/tools/jib/registry/ManifestPullerIntegrationTest.java | 26 | Java | 0.571 | suggestion | 141 | 51 | 51 | false | ci: update integration tests that expect docker manifest format from distroless image | 3,965 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | emmileaf | Review this pull request change.
Language: Java
File: jib-core/src/integration-test/java/com/google/cloud/tools/jib/registry/ManifestPullerIntegrationTest.java
PR Title: ci: update integration tests that expect docker manifest format from distroless image
BEFORE CODE: Assert.assertEquals(2, manifestTemplate.get... | minor: how about we say something like "at the specified sha`? This can prevent the comment from becoming stale if the variable name changes. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Mockito.when(manifestList.getDigestsForPlatform("arch1", "os1"))
.thenReturn(Arrays.asList("sha256:digest1"));
Mockito.when(manifestList.getDigestsForPlatform("arch2", "os2"))
.thenReturn(Arrays.asList("sha256:digest2"));
ImageMetadataTemplate imageMetadata =
new ImageMetadataTempla... | ```suggestion
public void testGetCachedBaseImages_manifestListCached_onlyPlatforms()
``` | Mockito.when(manifestList.getDigestsForPlatform("arch1", "os1"))
.thenReturn(Arrays.asList("sha256:digest1"));
Mockito.when(manifestList.getDigestsForPlatform("arch2", "os2"))
.thenReturn(Arrays.asList("sha256:digest2"));
ImageMetadataTemplate imageMetadata =
new ImageMetadataTempla... | @@ -457,15 +463,15 @@ public void testGetCachedBaseImages_v22ManifestListCached_partialMatches()
}
@Test
- public void testGetCachedBaseImages_v22ManifestListCached_onlyPlatforms()
+ public void testGetCachedBaseImages_nanifestListCached_onlyPlatforms() | jib-core/src/test/java/com/google/cloud/tools/jib/builder/steps/PullBaseImageStepTest.java | 26 | Java | 0.571 | performance | 92 | 51 | 51 | false | Fix V22ManifestListTemplate cast when pulling an oci index manifest | 3,974 | GoogleContainerTools/jib | 11,032 | Java | emmileaf | rquinio | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/builder/steps/PullBaseImageStepTest.java
PR Title: Fix V22ManifestListTemplate cast when pulling an oci index manifest
BEFORE CODE: Mockito.when(manifestList.getDigestsForPlatform("arch1", "os1"))
.th... | ```suggestion
public void testGetCachedBaseImages_manifestListCached_onlyPlatforms()
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
private ListProperty<String> entrypoint;
private List<String> extraClasspath = Collections.emptyList();
private boolean expandClasspathDependencies;
private final Property<String> mainClass;
@Nullable private List<String> args;
private ImageFormat format = ImageFormat.Docker;
private List<String> ports = ... | Just a similar concern here for updating nullability for this public getter: https://github.com/GoogleContainerTools/jib/pull/3936#discussion_r1156115328 | private ListProperty<String> entrypoint;
private List<String> extraClasspath = Collections.emptyList();
private boolean expandClasspathDependencies;
private final Property<String> mainClass;
@Nullable private List<String> args;
private ImageFormat format = ImageFormat.Docker;
private List<String> ports = ... | @@ -63,25 +63,29 @@ public ContainerParameters(ObjectFactory objectFactory) {
creationTime = objectFactory.property(String.class).convention("EPOCH");
mainClass = objectFactory.property(String.class);
jvmFlags = objectFactory.listProperty(String.class);
+ entrypoint = objectFactory.listProperty(String... | jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/ContainerParameters.java | 26 | Java | 0.5 | suggestion | 153 | 51 | 51 | false | use gradle lazy Provider for entrypoint container parameter | 4,003 | GoogleContainerTools/jib | 11,032 | Java | emmileaf | wakingrufus | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/ContainerParameters.java
PR Title: use gradle lazy Provider for entrypoint container parameter
BEFORE CODE: private ListProperty<String> entrypoint;
private List<String> extraClasspath = Colle... | Just a similar concern here for updating nullability for this public getter: https://github.com/GoogleContainerTools/jib/pull/3936#discussion_r1156115328 | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/**
* Adds a {@link TarArchiveEntry} if its extraction path does not exist yet. Also adds all of
* the parent directories on the extraction path, if the parent does not exist. Parent will have
* modification time set to {@link FileEntriesLayer#DEFAULT_MODIFICATION_TIME}.
*
* @param tarArchi... | This is not true. Jib intentionally doesn't allow setting the mod time of directories. Let's just remove the comment. | /**
* Adds a {@link TarArchiveEntry} if its extraction path does not exist yet. Also adds all of
* the parent directories on the extraction path, if the parent does not exist. Parent will have
* modification time set to {@link FileEntriesLayer#DEFAULT_MODIFICATION_TIME}.
*
* @param tarArchi... | @@ -76,11 +77,14 @@ private void add(TarArchiveEntry tarArchiveEntry) throws IOException {
if (namePath.getParent() != namePath.getRoot()) {
Path tarArchiveParentDir = Verify.verifyNotNull(namePath.getParent());
TarArchiveEntry dir = new TarArchiveEntry(DIRECTORY_FILE, tarArchiveParentDir.toStr... | jib-core/src/main/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilder.java | 26 | Java | 0.429 | suggestion | 117 | 51 | 51 | false | Update apache-commons to 1.26.0 and set PAX headers to address build reproducibility issue | 4,204 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | izogfif | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilder.java
PR Title: Update apache-commons to 1.26.0 and set PAX headers to address build reproducibility issue
BEFORE CODE: /**
* Adds a {@link TarArchiveEntry} if its extractio... | This is not true. Jib intentionally doesn't allow setting the mod time of directories. Let's just remove the comment. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Path source, AbsoluteUnixPath destination, FilePermissions permissions, String ownership)
throws IOException {
return new FileEntry(
source,
destination,
permissions,
// Here we make sure to use a default modification time
// since JIB will set modification time f... | Just revert this file back to its original state. The original author misunderstood this part. The PR shouldn't touch this file, and the existing tests will verify the correctness of your changes. | Path layerDirectory = Paths.get(Resources.getResource("core/layer").toURI());
Path blobA = Paths.get(Resources.getResource("core/blobA").toURI());
ReproducibleLayerBuilder layerBuilder =
new ReproducibleLayerBuilder(
ImmutableList.copyOf(
FileEntriesLayer.builder()
... | @@ -84,12 +85,43 @@ private static void verifyNextTarArchiveEntryIsDirectory(
assertThat(extractionPathEntry.getMode()).isEqualTo(TarArchiveEntry.DEFAULT_DIR_MODE);
}
- private static FileEntry defaultLayerEntry(Path source, AbsoluteUnixPath destination) {
+ /**
+ * Verifies that the modification time has... | jib-core/src/test/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilderTest.java | 26 | Java | 0.429 | security | 196 | 51 | 51 | false | Update apache-commons to 1.26.0 and set PAX headers to address build reproducibility issue | 4,204 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | izogfif | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilderTest.java
PR Title: Update apache-commons to 1.26.0 and set PAX headers to address build reproducibility issue
BEFORE CODE: Path source, AbsoluteUnixPath destination, FilePermi... | Just revert this file back to its original state. The original author misunderstood this part. The PR shouldn't touch this file, and the existing tests will verify the correctness of your changes. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
@Test
public void testExtract_symlinks() throws URISyntaxException, IOException {
Path source = Paths.get(Resources.getResource("core/symlinks.tar").toURI());
Path destination = temporaryFolder.getRoot().toPath();
TarExtractor.extract(source, destination);
Assert.assertTrue(Files.isDirectory(d... | @izogfif Is there is a reason we're testing with millisecond precision here? Curious since we opted for nanosecond precision above (ReproducibleLayerBuilder) |
@Test
public void testExtract_symlinks() throws URISyntaxException, IOException {
Path source = Paths.get(Resources.getResource("core/symlinks.tar").toURI());
Path destination = temporaryFolder.getRoot().toPath();
TarExtractor.extract(source, destination);
Assert.assertTrue(Files.isDirectory(desti... | @@ -92,16 +94,20 @@ public void testExtract_modificationTimePreserved() throws URISyntaxException, I
TarExtractor.extract(source, destination);
+ // We have to use millisecond precision here. Taken from Instant.parse.
+ final DateTimeFormatter parser =
+ new DateTimeFormatterBuilder().parseCaseIns... | jib-core/src/test/java/com/google/cloud/tools/jib/tar/TarExtractorTest.java | 26 | Java | 0.357 | suggestion | 158 | 51 | 51 | false | Update apache-commons to 1.26.0 and set PAX headers to address build reproducibility issue | 4,204 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | izogfif | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/tar/TarExtractorTest.java
PR Title: Update apache-commons to 1.26.0 and set PAX headers to address build reproducibility issue
BEFORE CODE: }
@Test
public void testExtract_symlinks() throws URISyntaxExcept... | @izogfif Is there is a reason we're testing with millisecond precision here? Curious since we opted for nanosecond precision above (ReproducibleLayerBuilder) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
HttpRequestTester.verifyBody(
"Hello world",
new URL("http://" + HttpRequestTester.fetchDockerHostForHttpRequest() + ":8080"));
}
@Test
public void testJar_baseImageSpecified()
throws IOException, URISyntaxException, InterruptedException {
Path jarPath = Paths.get(Resources.getReso... | How about we log this message? | .run();
containerName = output.trim();
HttpRequestTester.verifyBody(
"Hello world",
new URL("http://" + HttpRequestTester.fetchDockerHostForHttpRequest() + ":8080"));
}
@Test
public void testJar_baseImageSpecified()
throws IOException, URISyntaxException, InterruptedExc... | @@ -315,4 +336,45 @@ public void testJar_baseImageSpecified()
String output = new Command("docker", "run", "--rm", "cli-gcr-base").run();
assertThat(output).isEqualTo("Hello World");
}
+
+ public static void createJarFile(String name, String className, String classPath, String mainClass) throws IOExceptio... | jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java | 26 | Java | 0.071 | question | 31 | 51 | 51 | false | chore: Dynamically create test jars for JarCommandTest | 4,210 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | meltsufin | Review this pull request change.
Language: Java
File: jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java
PR Title: chore: Dynamically create test jars for JarCommandTest
BEFORE CODE:
HttpRequestTester.verifyBody(
"Hello world",
new URL("http://" + HttpRequestTe... | How about we log this message? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
@Test
public void testJar_baseImageSpecified()
throws IOException, URISyntaxException, InterruptedException {
Path jarPath = Paths.get(Resources.getResource("jarTest/standard/noDependencyJar.jar").toURI());
Integer exitCode =
new CommandLine(new JibCli())
.execute(
... | This looks like a good candidate for `Preconditions.checkNotNull`? | "Hello world",
new URL("http://" + HttpRequestTester.fetchDockerHostForHttpRequest() + ":8080"));
}
@Test
public void testJar_baseImageSpecified()
throws IOException, URISyntaxException, InterruptedException {
Path jarPath = Paths.get(Resources.getResource("jarTest/standard/noDependency... | @@ -315,4 +336,45 @@ public void testJar_baseImageSpecified()
String output = new Command("docker", "run", "--rm", "cli-gcr-base").run();
assertThat(output).isEqualTo("Hello World");
}
+
+ public static void createJarFile(String name, String className, String classPath, String mainClass) throws IOExceptio... | jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java | 26 | Java | 0.5 | question | 67 | 51 | 51 | false | chore: Dynamically create test jars for JarCommandTest | 4,210 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | meltsufin | Review this pull request change.
Language: Java
File: jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java
PR Title: chore: Dynamically create test jars for JarCommandTest
BEFORE CODE: }
@Test
public void testJar_baseImageSpecified()
throws IOException, URISyntaxExceptio... | This looks like a good candidate for `Preconditions.checkNotNull`? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
new CommandLine(new JibCli())
.execute(
"jar",
"--target=docker://cli-gcr-base",
"--from=gcr.io/google-appengine/openjdk:8",
jarPath.toString());
assertThat(exitCode).isEqualTo(0);
String output = new Command("docker", "run", "-... | How about we use an if-else statement that proceeds with the jar building stage below if `task.call()` is true otherwise logs an error message if the compilation fails? | Path jarPath = Paths.get(Resources.getResource("jarTest/standard/noDependencyJar.jar").toURI());
Integer exitCode =
new CommandLine(new JibCli())
.execute(
"jar",
"--target=docker://cli-gcr-base",
"--from=gcr.io/google-appengine/openjdk:8",
... | @@ -315,4 +336,45 @@ public void testJar_baseImageSpecified()
String output = new Command("docker", "run", "--rm", "cli-gcr-base").run();
assertThat(output).isEqualTo("Hello World");
}
+
+ public static void createJarFile(String name, String className, String classPath, String mainClass) throws IOExceptio... | jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java | 26 | Java | 0.714 | bug | 169 | 51 | 51 | false | chore: Dynamically create test jars for JarCommandTest | 4,210 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | meltsufin | Review this pull request change.
Language: Java
File: jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java
PR Title: chore: Dynamically create test jars for JarCommandTest
BEFORE CODE: new CommandLine(new JibCli())
.execute(
"jar",
... | How about we use an if-else statement that proceeds with the jar building stage below if `task.call()` is true otherwise logs an error message if the compilation fails? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
boolean success = task.call();
assertThat(success).isTrue();
// Create a manifest file
Manifest manifest = new Manifest();
Attributes attributes = new Attributes();
attributes.putValue("Manifest-Version", "1.0");
if (classPath != null) {
attributes.putValue("Class-Path", classPath);
... | Alternatively, a `try with resources` block could also help us with automatically closing these streams without an explicit call to close().
```
try (InputStream in = Files.newInputStream(source);
OutputStream out = Files.newOutputStream(dest)) {
// read from in, write to out
}
``` | Iterable<? extends JavaFileObject> compilationUnits =
fileManager.getJavaFileObjectsFromFiles(Collections.singletonList(javaFilePath.toFile()));
Iterable<String> options = Arrays.asList("-source", "1.8", "-target", "1.8");
JavaCompiler.CompilationTask task =
compiler.getTask(null, fileManage... | @@ -315,4 +336,45 @@ public void testJar_baseImageSpecified()
String output = new Command("docker", "run", "--rm", "cli-gcr-base").run();
assertThat(output).isEqualTo("Hello World");
}
+
+ public static void createJarFile(String name, String className, String classPath, String mainClass) throws IOExceptio... | jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java | 26 | Java | 0.857 | suggestion | 296 | 29 | 33 | false | chore: Dynamically create test jars for JarCommandTest | 4,210 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | meltsufin | Review this pull request change.
Language: Java
File: jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java
PR Title: chore: Dynamically create test jars for JarCommandTest
BEFORE CODE: boolean success = task.call();
assertThat(success).isTrue();
// Create a manifest file... | Alternatively, a `try with resources` block could also help us with automatically closing these streams without an explicit call to close().
```
try (InputStream in = Files.newInputStream(source);
OutputStream out = Files.newOutputStream(dest)) {
// read from in, write to out
}
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
containerBuilder
.setEntrypoint(computeEntrypoint(commonContainerConfigCliOptions))
.setFileEntriesLayers(processor.createLayers())
.setExposedPorts(commonContainerConfigCliOptions.getExposedPorts())
.setVolumes(commonContainerConfigCliOptions.getVolumes())
.setEnvironm... | Where are we detecting that it's version 12 of Jetty? | }
containerBuilder
.setEntrypoint(computeEntrypoint(commonContainerConfigCliOptions))
.setFileEntriesLayers(processor.createLayers())
.setExposedPorts(commonContainerConfigCliOptions.getExposedPorts())
.setVolumes(commonContainerConfigCliOptions.getVolumes())
.setEnvironm... | @@ -77,12 +77,24 @@ private static List<String> computeEntrypoint(
CommonContainerConfigCliOptions commonContainerConfigCliOptions)
throws InvalidImageReferenceException {
List<String> entrypoint = commonContainerConfigCliOptions.getEntrypoint();
+ String baseImage = fetchBaseImage(commonContainer... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/war/WarFiles.java | 26 | Java | 0.214 | question | 53 | 42 | 33 | false | fix: modify default entrypoint for WAR containerization to be compatible with Jetty 12+ | 4,216 | GoogleContainerTools/jib | 11,032 | Java | meltsufin | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/war/WarFiles.java
PR Title: fix: modify default entrypoint for WAR containerization to be compatible with Jetty 12+
BEFORE CODE: }
containerBuilder
.setEntrypoint(computeEntrypoint(commonContai... | Where are we detecting that it's version 12 of Jetty? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (!commonContainerConfigCliOptions.getProgramArguments().isEmpty()) {
containerBuilder.setProgramArguments(programArguments);
}
containerBuilder
.setEntrypoint(computeEntrypoint(commonContainerConfigCliOptions))
.setFileEntriesLayers(processor.createLayers())
.setExposedPorts... | What if the `baseImage` is jetty but due to the default rather than being specified by CLI options? | if (!commonContainerConfigCliOptions.getProgramArguments().isEmpty()) {
containerBuilder.setProgramArguments(programArguments);
}
containerBuilder
.setEntrypoint(computeEntrypoint(commonContainerConfigCliOptions))
.setFileEntriesLayers(processor.createLayers())
.setExposedPorts... | @@ -77,12 +77,24 @@ private static List<String> computeEntrypoint(
CommonContainerConfigCliOptions commonContainerConfigCliOptions)
throws InvalidImageReferenceException {
List<String> entrypoint = commonContainerConfigCliOptions.getEntrypoint();
+ String baseImage = fetchBaseImage(commonContainer... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/war/WarFiles.java | 26 | Java | 0.357 | question | 99 | 44 | 35 | false | fix: modify default entrypoint for WAR containerization to be compatible with Jetty 12+ | 4,216 | GoogleContainerTools/jib | 11,032 | Java | meltsufin | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/war/WarFiles.java
PR Title: fix: modify default entrypoint for WAR containerization to be compatible with Jetty 12+
BEFORE CODE: if (!commonContainerConfigCliOptions.getProgramArguments().isEmpty()) {
... | What if the `baseImage` is jetty but due to the default rather than being specified by CLI options? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
JibContainerBuilder containerBuilder =
ContainerBuilders.create(baseImage, Collections.emptySet(), commonCliOptions, logger);
List<String> programArguments = commonContainerConfigCliOptions.getProgramArguments();
if (!commonContainerConfigCliOptions.getProgramArguments().isEmpty()) {
container... | Can this line move to inside the if statement on line 84? | JibContainerBuilder containerBuilder =
ContainerBuilders.create(baseImage, Collections.emptySet(), commonCliOptions, logger);
List<String> programArguments = commonContainerConfigCliOptions.getProgramArguments();
if (!commonContainerConfigCliOptions.getProgramArguments().isEmpty()) {
container... | @@ -77,12 +77,24 @@ private static List<String> computeEntrypoint(
CommonContainerConfigCliOptions commonContainerConfigCliOptions)
throws InvalidImageReferenceException {
List<String> entrypoint = commonContainerConfigCliOptions.getEntrypoint();
+ String baseImage = fetchBaseImage(commonContainer... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/war/WarFiles.java | 26 | Java | 0.286 | question | 57 | 47 | 38 | false | fix: modify default entrypoint for WAR containerization to be compatible with Jetty 12+ | 4,216 | GoogleContainerTools/jib | 11,032 | Java | meltsufin | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/war/WarFiles.java
PR Title: fix: modify default entrypoint for WAR containerization to be compatible with Jetty 12+
BEFORE CODE: JibContainerBuilder containerBuilder =
ContainerBuilders.create(base... | Can this line move to inside the if statement on line 84? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Callable<E>> callables) {
return callables.stream().map(executorService::submit).collect(Collectors.toList());
}
private String computeArchitecture(String architecture) {
if (architecture.equals("x86_64")) {
return "amd64";
}... | Shall we error out if no matching found? |
return new WriteTarFileStep(
buildContext, progressDispatcherFactory, outputPath, builtImage)
.call();
});
}
private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Callable<E>> callables) {
return callables.stream().map(executorS... | @@ -647,4 +649,28 @@ private void writeTarFile(
private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Callable<E>> callables) {
return callables.stream().map(executorService::submit).collect(Collectors.toList());
}
+
+ private String computeArchitecture(String architecture) {
+ if (archit... | jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java | 26 | Java | 0.214 | question | 40 | 29 | 42 | false | feat: determine platform details from local docker installation for jibDockerBuild | 4,249 | GoogleContainerTools/jib | 11,032 | Java | blakeli0 | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java
PR Title: feat: determine platform details from local docker installation for jibDockerBuild
BEFORE CODE: private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Cal... | Shall we error out if no matching found? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/**
* Saves an image tarball from the Docker daemon.
*
* @see <a
* href="https://docs.docker.com/engine/reference/commandline/save/">https://docs.docker.com/engine/reference/commandline/save</a>
* @param imageReference the image to save
* @param outputPath the destination path to save the output... | This could be just docker info details, `os and architecture` are implementation details of `DockerInfoDetails`, and we could add more attributes later. | /**
* Saves an image tarball from the Docker daemon.
*
* @see <a
* href="https://docs.docker.com/engine/reference/commandline/save/">https://docs.docker.com/engine/reference/commandline/save</a>
* @param imageReference the image to save
* @param outputPath the destination path to save the output... | @@ -69,4 +69,15 @@ void save(ImageReference imageReference, Path outputPath, Consumer<Long> written
* @throws InterruptedException if the {@code docker inspect} process was interrupted
*/
ImageDetails inspect(ImageReference imageReference) throws IOException, InterruptedException;
+
+ /**
+ * Gets the os ... | jib-core/src/main/java/com/google/cloud/tools/jib/api/DockerClient.java | 26 | Java | 0.571 | suggestion | 152 | 36 | 36 | false | feat: determine platform details from local docker installation for jibDockerBuild | 4,249 | GoogleContainerTools/jib | 11,032 | Java | blakeli0 | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/api/DockerClient.java
PR Title: feat: determine platform details from local docker installation for jibDockerBuild
BEFORE CODE: /**
* Saves an image tarball from the Docker daemon.
*
* @see <a
* ... | This could be just docker info details, `os and architecture` are implementation details of `DockerInfoDetails`, and we could add more attributes later. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
results.baseImagesAndBuiltImages.get().values().iterator().next().get();
return new WriteTarFileStep(
buildContext, progressDispatcherFactory, outputPath, builtImage)
.call();
});
}
private <E> List<Future<E>> scheduleCallables(Im... | Maybe add `osType` and `architecture` to the log? | results.baseImagesAndBuiltImages.get().values().iterator().next().get();
return new WriteTarFileStep(
buildContext, progressDispatcherFactory, outputPath, builtImage)
.call();
});
}
private <E> List<Future<E>> scheduleCallables(Im... | @@ -647,4 +656,29 @@ private void writeTarFile(
private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Callable<E>> callables) {
return callables.stream().map(executorService::submit).collect(Collectors.toList());
}
+
+ private String computeArchitecture(String architecture) {
+ if (archit... | jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java | 26 | Java | 0.357 | question | 49 | 38 | 43 | false | feat: determine platform details from local docker installation for jibDockerBuild | 4,249 | GoogleContainerTools/jib | 11,032 | Java | blakeli0 | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java
PR Title: feat: determine platform details from local docker installation for jibDockerBuild
BEFORE CODE: results.baseImagesAndBuiltImages.get().values().iterator(... | Maybe add `osType` and `architecture` to the log? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/*
* Copyright 2024 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | Add unit tests for different scenarios, e.g. `OSType` does not exist etc. | /*
* Copyright 2024 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | @@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | jib-core/src/main/java/com/google/cloud/tools/jib/api/DockerInfoDetails.java | 25 | Java | 0.5 | nitpick | 73 | 41 | 41 | false | feat: determine platform details from local docker installation for jibDockerBuild | 4,249 | GoogleContainerTools/jib | 11,032 | Java | blakeli0 | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/api/DockerInfoDetails.java
PR Title: feat: determine platform details from local docker installation for jibDockerBuild
BEFORE CODE: /*
* Copyright 2024 Google LLC.
*
* Licensed under the Apache License, Versi... | Add unit tests for different scenarios, e.g. `OSType` does not exist etc. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
private void writeTarFile(
Path outputPath, ProgressEventDispatcher.Factory progressDispatcherFactory) {
results.buildResult =
executorService.submit(
() -> {
Verify.verify(
results.baseImagesAndBuiltImages.get().size() == 1,
"multi-plat... | Where do we get the mapping between the architecture from docker info and the architecture needed for docker build? Are `x86_64 ` and `aarch64 ` all we need? Also please add unit tests for all the cases. |
private void writeTarFile(
Path outputPath, ProgressEventDispatcher.Factory progressDispatcherFactory) {
results.buildResult =
executorService.submit(
() -> {
Verify.verify(
results.baseImagesAndBuiltImages.get().size() == 1,
"multi-plat... | @@ -647,4 +656,29 @@ private void writeTarFile(
private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Callable<E>> callables) {
return callables.stream().map(executorService::submit).collect(Collectors.toList());
}
+
+ private String computeArchitecture(String architecture) {
+ if (archit... | jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java | 26 | Java | 0.571 | question | 203 | 48 | 51 | false | feat: determine platform details from local docker installation for jibDockerBuild | 4,249 | GoogleContainerTools/jib | 11,032 | Java | blakeli0 | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java
PR Title: feat: determine platform details from local docker installation for jibDockerBuild
BEFORE CODE:
private void writeTarFile(
Path outputPath, ProgressEventDispatche... | Where do we get the mapping between the architecture from docker info and the architecture needed for docker build? Are `x86_64 ` and `aarch64 ` all we need? Also please add unit tests for all the cases. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Callable<E>> callables) {
return callables.stream().map(executorService::submit).collect(Collectors.toList());
}
private String computeArchitecture(String architecture) {
if (architecture.equals("x86_64")) {
return "amd64";
... | I see that they are already tested in `JibIntegrationTest`, but ideally I think the different cases should be tested in `StepsRunnerTest` since we don't have to run docker engine. I'll leave it to you to decide if the refactoring it needed. |
private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Callable<E>> callables) {
return callables.stream().map(executorService::submit).collect(Collectors.toList());
}
@VisibleForTesting
String normalizeArchitecture(String architecture) {
// Create mapping based on https://docs.docker.c... | @@ -647,4 +656,29 @@ private void writeTarFile(
private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Callable<E>> callables) {
return callables.stream().map(executorService::submit).collect(Collectors.toList());
}
+
+ private String computeArchitecture(String architecture) {
+ if (archit... | jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java | 26 | Java | 0.643 | refactor | 241 | 31 | 36 | false | feat: determine platform details from local docker installation for jibDockerBuild | 4,249 | GoogleContainerTools/jib | 11,032 | Java | blakeli0 | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java
PR Title: feat: determine platform details from local docker installation for jibDockerBuild
BEFORE CODE:
private <E> List<Future<E>> scheduleCallables(ImmutableList<? extends Ca... | I see that they are already tested in `JibIntegrationTest`, but ideally I think the different cases should be tested in `StepsRunnerTest` since we don't have to run docker engine. I'll leave it to you to decide if the refactoring it needed. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Assert.assertEquals("Hello World\n", output);
}
@Test
public void testBasicMultiPlatform_toDockerDaemon()
throws IOException, InterruptedException, ExecutionException, RegistryException,
CacheDirectoryCreationException, InvalidImageReferenceException {
Jib.from(
RegistryImage.... | TODO(@mpeddada1): Add test for single image build with different os/arch. | String toImage = dockerHost + ":5000/docker-to-docker";
Jib.from(DockerDaemonImage.named(dockerHost + ":5000/busybox"))
.setEntrypoint("echo", "Hello World")
.containerize(Containerizer.to(DockerDaemonImage.named(toImage)));
String output = new Command("docker", "run", "--rm", toImage).run(... | @@ -343,27 +342,38 @@ public void testBasicMultiPlatform_toDockerDaemon()
}
@Test
- public void testBasicMultiPlatform_toDockerDaemon_noMatchingImage() {
- ExecutionException exception =
- assertThrows(
- ExecutionException.class,
- () ->
- Jib.from(
- ... | jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java | 26 | Java | 0.214 | suggestion | 75 | 51 | 51 | false | fix: allow pushing images with different arch/os to docker daemon | 4,268 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java
PR Title: fix: allow pushing images with different arch/os to docker daemon
BEFORE CODE: Assert.assertEquals("Hello World\n", output);
}
@Test
public void testBa... | TODO(@mpeddada1): Add test for single image build with different os/arch. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
private static final String HELPFUL_SUGGESTIONS_PREFIX = "Build image failed";
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (isSkipped()) {
getLog().info("Skipping containerization because jib-maven-plugin: skip = true");
return;
}
if ("pom".equ... | No issues found. | private static final String HELPFUL_SUGGESTIONS_PREFIX = "Build image failed";
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (isSkipped()) {
getLog().info("Skipping containerization because jib-maven-plugin: skip = true");
return;
}
if ("pom".equ... | @@ -104,6 +104,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
new MavenSettingsServerCredentials(
getSession().getSettings(), getSettingsDecrypter(), eventDispatcher),
projectProperties);
+ ProxyProvider.init(getSession().getSetting... | jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildImageMojo.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add proxy authentication | 1,337 | GoogleContainerTools/jib | 11,032 | Java | mmmheeren | Review this pull request change.
Language: Java
File: jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildImageMojo.java
PR Title: Add proxy authentication
BEFORE CODE: private static final String HELPFUL_SUGGESTIONS_PREFIX = "Build image failed";
@Override
public void execute() throws MojoE... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.cloud.tools.jib.api;
import com.google.cloud.tools.jib.configuration.ImageConfiguration;
import java.nio.file.Path;
import java.util.Set;
/**
* A simple test proxy to access the innards of Contain... | No issues found. | * License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.cloud.tools.jib.api;
import com.google.cloud.tools.jib.configuration.ImageConfiguration;
import java.nio.file.Path;
import java.util.Set;
/**
* A simple test proxy to access the innards of Contain... | @@ -0,0 +1,73 @@
+/*
+ * Copyright 2020 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | jib-cli/src/test/java/com/google/cloud/tools/jib/api/ContainerizerTestProxy.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Build Command for building from cli | 2,818 | GoogleContainerTools/jib | 11,032 | Java | loosebazooka | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/api/ContainerizerTestProxy.java
PR Title: Build Command for building from cli
BEFORE CODE: * License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.c... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@Nullable private CredentialRetriever knownCredentialRetriever;
@Nullable private CredentialRetriever inferredCredentialRetriever;
@Nullable private String credentialHelper;
private final Properties systemProperties;
private final Map<String, String> environment;
@VisibleForTesting
DefaultCredentialRetri... | No issues found. | @Nullable private CredentialRetriever knownCredentialRetriever;
@Nullable private CredentialRetriever inferredCredentialRetriever;
@Nullable private String credentialHelper;
private final Properties systemProperties;
private final Map<String, String> environment;
@VisibleForTesting
DefaultCredentialRetri... | @@ -73,7 +73,8 @@ public class DefaultCredentialRetrievers {
* CredentialRetriever}s
* @return a new {@link DefaultCredentialRetrievers}
*/
- static DefaultCredentialRetrievers init(CredentialRetrieverFactory credentialRetrieverFactory) {
+ public static DefaultCredentialRetrievers init(
+ Creden... | jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/DefaultCredentialRetrievers.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add credentials for `from` image in BuildFile | 2,840 | GoogleContainerTools/jib | 11,032 | Java | loosebazooka | Review this pull request change.
Language: Java
File: jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/DefaultCredentialRetrievers.java
PR Title: Add credentials for `from` image in BuildFile
BEFORE CODE: @Nullable private CredentialRetriever knownCredentialRetriever;
@Nullable private... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
"0:0"),
newEntry(testRoot, "project/wild.card", "/target/eo/wild.card", "644", 0, "0:0")));
checkLayer(
layers.get(3),
"excludes only shortcut",
ImmutableSet.of(
newEntry(testRoot, "project", "/target/eo", "755", 0, "0:0"),
newEntry(testRo... | No issues found. | "0:0"),
newEntry(testRoot, "project/wild.card", "/target/eo/wild.card", "644", 0, "0:0")));
checkLayer(
layers.get(3),
"excludes only shortcut",
ImmutableSet.of(
newEntry(testRoot, "project", "/target/eo", "755", 0, "0:0"),
newEntry(testRo... | @@ -96,27 +96,50 @@ public void testToLayers_properties() throws IOException, URISyntaxException {
@Test
public void testToLayers_includeExcludes() throws IOException, URISyntaxException {
Path testRoot = getLayersTestRoot("includesExcludesTest");
- List<FileEntriesLayer> layers = parseLayers(testRoot, 5)... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/buildfile/LayersTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Fill in directories for files added by filter. | 2,849 | GoogleContainerTools/jib | 11,032 | Java | loosebazooka | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/buildfile/LayersTest.java
PR Title: Fill in directories for files added by filter.
BEFORE CODE: "0:0"),
newEntry(testRoot, "project/wild.card", "/target/eo/wild.card", "644", 0, "0:... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
.stream()
.map(FileEntry::getExtractionPath)
.collect(Collectors.toList()))
.isEqualTo(
ImmutableList.of(
AbsoluteUnixPath.get("/app/dependencies/dependency1"),
AbsoluteUnixPath.get("/app/dependencies/dependency2"),
... | No issues found. | .stream()
.map(FileEntry::getExtractionPath)
.collect(Collectors.toList()))
.isEqualTo(
ImmutableList.of(
AbsoluteUnixPath.get("/app/dependencies/dependency1"),
AbsoluteUnixPath.get("/app/dependencies/dependency2"),
... | @@ -103,16 +103,17 @@ public void testExplodeMode_standard_withClassPathInManifest()
Path destDir = temporaryFolder.newFolder().toPath();
List<FileEntriesLayer> layers = JarProcessor.explodeStandardJar(standardJar, destDir);
- assertThat(layers.size()).isEqualTo(3);
+ assertThat(layers.size()).isEqual... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarProcessorTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add snapshot dependencies layer in explode mode for standard jar. | 2,858 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarProcessorTest.java
PR Title: Add snapshot dependencies layer in explode mode for standard jar.
BEFORE CODE: .stream()
.map(FileEntry::getExtractionPath)
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// Constructs the image.
Image.Builder imageBuilder = Image.builder(buildContext.getTargetFormat());
// Base image layers
baseImageLayers.forEach(imageBuilder::addLayer);
// Passthrough config and count non-empty history entries
int nonEmptyLayerCount = 0;
for (HistoryEntry h... | No issues found. | // Constructs the image.
Image.Builder imageBuilder = Image.builder(buildContext.getTargetFormat());
// Base image layers
baseImageLayers.forEach(imageBuilder::addLayer);
// Passthrough config and count non-empty history entries
int nonEmptyLayerCount = 0;
for (HistoryEntry h... | @@ -24,8 +24,11 @@
import com.google.cloud.tools.jib.image.Image;
import com.google.cloud.tools.jib.image.LayerPropertyNotFoundException;
import com.google.cloud.tools.jib.image.json.HistoryEntry;
+import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
+import com.go... | jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/BuildImageStep.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add option to expand wildcard in entrypoint runtime classpath | 2,866 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/BuildImageStep.java
PR Title: Add option to expand wildcard in entrypoint runtime classpath
BEFORE CODE: // Constructs the image.
Image.Builder imageBuilder = Image.builder(buildContext.... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* Copyright 2020 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | No issues found. | * Copyright 2020 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | @@ -0,0 +1,52 @@
+/*
+ * Copyright 2020 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/jar/JarFiles.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Implement class to generate JibContainerBuilder from contents of jar file | 2,869 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/jar/JarFiles.java
PR Title: Implement class to generate JibContainerBuilder from contents of jar file
BEFORE CODE: * Copyright 2020 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "Licen... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// https://github.com/GoogleContainerTools/jib/issues/2821 is fixed.
assertThat(resourcesLayer.getName()).isEqualTo("resources");
List<AbsoluteUnixPath> actualResourcesPaths =
resourcesLayer
.getEntries()
.stream()
.map(FileEntry::getExtractionPath)
.c... | No issues found. | // https://github.com/GoogleContainerTools/jib/issues/2821 is fixed.
assertThat(resourcesLayer.getName()).isEqualTo("resources");
List<AbsoluteUnixPath> actualResourcesPaths =
resourcesLayer
.getEntries()
.stream()
.map(FileEntry::getExtractionPath)
.c... | @@ -63,10 +63,12 @@ public void testDetermineJarType_standard() throws IOException, URISyntaxExcepti
}
@Test
- public void testExplodeMode_standard_emptyJar() throws IOException, URISyntaxException {
+ public void testCreateExplodedModeLayersForStandardJar_emptyJar()
+ throws IOException, URISyntaxExcept... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarProcessorTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Rename JarProcessor method and adjust method access | 2,872 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarProcessorTest.java
PR Title: Rename JarProcessor method and adjust method access
BEFORE CODE: // https://github.com/GoogleContainerTools/jib/issues/2821 is fixed.
assertThat(resourcesLayer.getNa... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Mockito.verify(mockOut).println("warn");
Mockito.verifyNoMoreInteractions(mockOut);
}
@Test
public void testLog_lifecycle_plainConsole() {
createLoggerAndSendMessages(Verbosity.lifecycle, ConsoleOutput.plain);
Mockito.verify(mockErr).println("error");
Mockito.verifyNoMoreInteractions(mockErr... | No issues found. | Mockito.verify(mockOut).println("warn");
Mockito.verifyNoMoreInteractions(mockOut);
}
@Test
public void testLog_lifecycle_plainConsole() {
createLoggerAndSendMessages(Verbosity.lifecycle, ConsoleOutput.plain);
Mockito.verify(mockErr).println("error");
Mockito.verifyNoMoreInteractions(mockErr... | @@ -18,7 +18,7 @@
import static com.google.common.truth.Truth.assertThat;
-import com.google.cloud.tools.jib.api.LogEvent;
+import com.google.cloud.tools.jib.api.LogEvent.Level;
import com.google.cloud.tools.jib.plugins.common.logging.ConsoleLogger;
import com.google.cloud.tools.jib.plugins.common.logging.Single... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/cli2/logging/CliLoggerTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Fix broken Jib CLI logging | 2,876 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/cli2/logging/CliLoggerTest.java
PR Title: Fix broken Jib CLI logging
BEFORE CODE: Mockito.verify(mockOut).println("warn");
Mockito.verifyNoMoreInteractions(mockOut);
}
@Test
public void testLog_... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Mockito.verify(mockOut).println("[WARN] warn");
Mockito.verifyNoMoreInteractions(mockOut);
}
@Test
public void testLog_lifecycle_plainConsole() {
createLoggerAndSendMessages(Verbosity.lifecycle, ConsoleOutput.plain);
Mockito.verify(mockErr).println("[ERROR] error");
Mockito.verifyNoMoreInter... | No issues found. | Mockito.verify(mockOut).println("[WARN] warn");
Mockito.verifyNoMoreInteractions(mockOut);
}
@Test
public void testLog_lifecycle_plainConsole() {
createLoggerAndSendMessages(Verbosity.lifecycle, ConsoleOutput.plain);
Mockito.verify(mockErr).println("[ERROR] error");
Mockito.verifyNoMoreInter... | @@ -71,7 +71,7 @@ public void testLog_quiet_plainConsole() {
public void testLog_error_plainConsole() {
createLoggerAndSendMessages(Verbosity.error, ConsoleOutput.plain);
- Mockito.verify(mockErr).println("error");
+ Mockito.verify(mockErr).println("[ERROR] error");
Mockito.verifyNoMoreInteractions... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/cli2/logging/CliLoggerTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Give better error message on Jib CLI | 2,877 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/cli2/logging/CliLoggerTest.java
PR Title: Give better error message on Jib CLI
BEFORE CODE: Mockito.verify(mockOut).println("[WARN] warn");
Mockito.verifyNoMoreInteractions(mockOut);
}
@Test
pub... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
names = {"--to-credential-helper"},
paramLabel = "<credential-helper>",
description =
"credential helper for communicating with target registry, either a path to the helper, or a suffix for an executable named `docker-credential-<suffix>`")
@SuppressWarnings("NullAway.Init") // i... | No issues found. | names = {"--to-credential-helper"},
paramLabel = "<credential-helper>",
description =
"credential helper for communicating with target registry, either a path to the helper, or a suffix for an executable named `docker-credential-<suffix>`")
@SuppressWarnings("NullAway.Init") // i... | @@ -39,7 +39,7 @@
showAtFileInUsageHelp = true,
synopsisSubcommandLabel = "COMMAND",
description = "A tool for creating container images",
- subcommands = {Build.class})
+ subcommands = {Build.class, Jar.class})
public class JibCli {
@CommandLine.Spec | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/cli2/JibCli.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add jar cli sub-command to the jib cli | 2,878 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/cli2/JibCli.java
PR Title: Add jar cli sub-command to the jib cli
BEFORE CODE: names = {"--to-credential-helper"},
paramLabel = "<credential-helper>",
description =
"credent... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
import com.google.cloud.tools.jib.api.LogEvent.Level;
import com.google.cloud.tools.jib.cli.buildfile.BuildFiles;
import com.google.cloud.tools.jib.cli.cli2.logging.CliLogger;
import com.google.cloud.tools.jib.plugins.common.logging.ConsoleLogger;
import com.google.cloud.tools.jib.plugins.common.logging.SingleThreadedE... | No issues found. | import com.google.cloud.tools.jib.api.LogEvent.Level;
import com.google.cloud.tools.jib.cli.buildfile.BuildFiles;
import com.google.cloud.tools.jib.cli.cli2.logging.CliLogger;
import com.google.cloud.tools.jib.plugins.common.logging.ConsoleLogger;
import com.google.cloud.tools.jib.plugins.common.logging.SingleThreadedE... | @@ -25,6 +25,7 @@
import com.google.cloud.tools.jib.plugins.common.logging.SingleThreadedExecutor;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.time.Duration;
import java.util.concurrent.Callable;
import picocli.CommandLine;
import picocli.CommandLine.Model.CommandSpec;
@@ -80,6 +81,8 @@ pu... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/cli2/Build.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add integration testing for jib cli jar command. | 2,885 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/cli2/Build.java
PR Title: Add integration testing for jib cli jar command.
BEFORE CODE: import com.google.cloud.tools.jib.api.LogEvent.Level;
import com.google.cloud.tools.jib.cli.buildfile.BuildFiles;
import... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
import com.google.cloud.tools.jib.plugins.common.logging.ConsoleLoggerBuilder;
import com.google.cloud.tools.jib.plugins.common.logging.SingleThreadedExecutor;
import com.google.common.annotations.VisibleForTesting;
import java.io.PrintWriter;
/** A simple CLI logger that logs to the command line based on the configur... | No issues found. | import com.google.cloud.tools.jib.plugins.common.logging.ConsoleLoggerBuilder;
import com.google.cloud.tools.jib.plugins.common.logging.SingleThreadedExecutor;
import com.google.common.annotations.VisibleForTesting;
import java.io.PrintWriter;
/** A simple CLI logger that logs to the command line based on the configur... | @@ -20,7 +20,7 @@
import com.google.cloud.tools.jib.plugins.common.logging.ConsoleLoggerBuilder;
import com.google.cloud.tools.jib.plugins.common.logging.SingleThreadedExecutor;
import com.google.common.annotations.VisibleForTesting;
-import java.io.PrintStream;
+import java.io.PrintWriter;
/** A simple CLI logge... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/cli2/logging/CliLogger.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Modify CliLogger to use PrintWriter | 2,887 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/cli2/logging/CliLogger.java
PR Title: Modify CliLogger to use PrintWriter
BEFORE CODE: import com.google.cloud.tools.jib.plugins.common.logging.ConsoleLoggerBuilder;
import com.google.cloud.tools.jib.plugins.c... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
resourcesLayer
.getEntries()
.stream()
.map(FileEntry::getExtractionPath)
.collect(Collectors.toList());
assertThat(actualResourcesPaths)
.containsExactly(
AbsoluteUnixPath.get("/app/explodedJar/META-INF/"),
AbsoluteUnixPath.get... | No issues found. | resourcesLayer
.getEntries()
.stream()
.map(FileEntry::getExtractionPath)
.collect(Collectors.toList());
assertThat(actualResourcesPaths)
.containsExactly(
AbsoluteUnixPath.get("/app/explodedJar/META-INF/"),
AbsoluteUnixPath.get... | @@ -45,6 +45,7 @@ public class JarModeProcessorTest {
private static final String STANDARD_JAR_WITH_ONLY_CLASSES =
"jar/standard/standardJarWithOnlyClasses.jar";
private static final String STANDARD_JAR_EMPTY = "jar/standard/emptyStandardJar.jar";
+ private static final String STANDARD_SINGLE_DEPENDENCY_J... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarModeProcessorTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Modify standard jar exploded mode to not maintain original directory structure when adding dependencies to container. | 2,893 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarModeProcessorTest.java
PR Title: Modify standard jar exploded mode to not maintain original directory structure when adding dependencies to container.
BEFORE CODE: resourcesLayer
.ge... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// tar saved with 'docker save busybox -o busybox.tar'
Path path = Paths.get(Resources.getResource("core/busybox-docker.tar").toURI());
String toImage = "localhost:5000/basic-dockersavedfile";
JibContainer jibContainer =
Jib.from(TarImage.at(path).named("ignored"))
.setEntrypoint("e... | No issues found. | // tar saved with 'docker save busybox -o busybox.tar'
Path path = Paths.get(Resources.getResource("core/busybox-docker.tar").toURI());
String toImage = "localhost:5000/basic-dockersavedfile";
JibContainer jibContainer =
Jib.from(TarImage.at(path).named("ignored"))
.setEntrypoint("e... | @@ -34,13 +34,13 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
-import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.junit.After;
import org.junit.Assert... | jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Migrate away from Docker Hub in integration tests | 2,910 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java
PR Title: Migrate away from Docker Hub in integration tests
BEFORE CODE: // tar saved with 'docker save busybox -o busybox.tar'
Path path = Paths.get(Resources.getR... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
package hello;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
return "Hello world";
}
}
| No issues found. | package hello;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
return "Hello world";
}
}
| @@ -0,0 +1,13 @@
+package hello;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class HelloController {
+
+ @RequestMapping("/")
+ public String index() {
+ return "Hello world";
+ }
+} | jib-cli/src/integration-test/resources/jarTest/spring-boot/springBootLayered/src/main/java/hello/HelloController.java | 0 | Java | 1 | none | 16 | 14 | 14 | true | Add integration tests for explode mode of spring boot jar | 2,926 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/integration-test/resources/jarTest/spring-boot/springBootLayered/src/main/java/hello/HelloController.java
PR Title: Add integration tests for explode mode of spring boot jar
BEFORE CODE: package hello;
import org.springframework.web.bind.annotation.... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
@Test
public void testToJibContainerBuilder_explodedLayeredSpringBoot_basicInfo()
throws IOException, URISyntaxException, InvalidImageReferenceException {
Path springBootJar = Paths.get(Resources.getResource(SIMPLE_SPRING_BOOT_LAYERED).toURI());
Path temporaryParentDirectory = temporaryFolder.get... | No issues found. | }
@Test
public void testToJibContainerBuilder_explodedLayeredSpringBoot_basicInfo()
throws IOException, URISyntaxException, InvalidImageReferenceException {
Path springBootJar = Paths.get(Resources.getResource(SIMPLE_SPRING_BOOT_LAYERED).toURI());
Path temporaryParentDirectory = temporaryFolder.get... | @@ -40,9 +40,9 @@
public class JarFilesTest {
private static final String SIMPLE_STANDARD_JAR = "jar/standard/basicStandardJar.jar";
private static final String SIMPLE_SPRING_BOOT_LAYERED =
- "jar/springboot/springboot_simple_layered.jar";
+ "jar/spring-boot/springboot_simple_layered.jar";
private s... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarFilesTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Implement packaged mode for spring boot jar | 2,927 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarFilesTest.java
PR Title: Implement packaged mode for spring boot jar
BEFORE CODE: }
@Test
public void testToJibContainerBuilder_explodedLayeredSpringBoot_basicInfo()
throws IOException, UR... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
required = true,
description = "username for communicating with target image registry")
@SuppressWarnings("NullAway.Init") // initialized by picocli
String username;
@CommandLine.Option(
names = "--to-password",
arity = "0..1",
interactive = true,
required = ... | No issues found. | required = true,
description = "username for communicating with target image registry")
@SuppressWarnings("NullAway.Init") // initialized by picocli
String username;
@CommandLine.Option(
names = "--to-password",
arity = "0..1",
interactive = true,
required = ... | @@ -70,11 +70,11 @@ public class CommonCliOptions {
private Path baseImageCache;
@CommandLine.Option(
- names = "--application-cache",
+ names = "--project-cache",
paramLabel = "<cache-directory>",
- description = "A path to an application cache")
+ description = "A path to the projec... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/cli2/CommonCliOptions.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add new Utility to determine cache location | 2,929 | GoogleContainerTools/jib | 11,032 | Java | loosebazooka | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/cli2/CommonCliOptions.java
PR Title: Add new Utility to determine cache location
BEFORE CODE: required = true,
description = "username for communicating with target image registry")
@Suppre... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
EchoRed() {
echo "$(tput setaf 1; tput bold)$1$(tput sgr0)"
}
EchoGreen() {
echo "$(tput setaf 2; tput bold)$1$(tput sgr0)"
}
Die() {
EchoRed "$1"
exit 1
}
DieUsage() {
Die "Usage: ./jib-build-plan/scripts/prepare_release.sh <release version> [<post-release-version>]"
}
# Usage: CheckVersion <version>
Chec... | No issues found. | EchoRed() {
echo "$(tput setaf 1; tput bold)$1$(tput sgr0)"
}
EchoGreen() {
echo "$(tput setaf 2; tput bold)$1$(tput sgr0)"
}
Die() {
EchoRed "$1"
exit 1
}
DieUsage() {
Die "Usage: ./jib-build-plan/scripts/prepare_release.sh <release version> [<post-release-version>]"
}
# Usage: CheckVersion <version>
Chec... | @@ -47,11 +47,10 @@ BRANCH=build_plan_release_v${VERSION}
git checkout -b ${BRANCH}
# Changes the version for release and creates the commits/tags.
-echo | ./gradlew :jib-build-plan:release -Prelease.releaseVersion=${VERSION} ${POST_RELEASE_VERSION:+"-Prelease.newVersion=${POST_RELEASE_VERSION}"}
-
-# Pushes the re... | jib-build-plan/scripts/prepare_release.sh | 0 | Shell | 1 | none | 16 | 51 | 51 | true | Use `-Prelease.useAutomaticVersion=true` for non-interactive release and remove unnecessary branch and tag pushes | 2,936 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Shell
File: jib-build-plan/scripts/prepare_release.sh
PR Title: Use `-Prelease.useAutomaticVersion=true` for non-interactive release and remove unnecessary branch and tag pushes
BEFORE CODE: EchoRed() {
echo "$(tput setaf 1; tput bold)$1$(tput sgr0)"
}
EchoGreen() {
ec... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
public void initCaches() {
Mockito.when(cacheDirectories.getBaseImageCache()).thenReturn(Optional.of(baseImageCache));
Mockito.when(cacheDirectories.getApplicationLayersCache()).thenReturn(applicationCache);
}
@Test
public void testApplyConfiguration_defaults()
throws InvalidImageReferenceExcepti... | No issues found. | public void initCaches() {
Mockito.when(cacheDirectories.getBaseImageCache()).thenReturn(Optional.of(baseImageCache));
Mockito.when(cacheDirectories.getApplicationLayersCache()).thenReturn(applicationCache);
}
@Test
public void testApplyConfiguration_defaults()
throws InvalidImageReferenceExcepti... | @@ -20,7 +20,6 @@
import static com.google.common.truth.Truth8.assertThat;
import com.google.cloud.tools.jib.api.CacheDirectoryCreationException;
-import com.google.cloud.tools.jib.api.Containerizer;
import com.google.cloud.tools.jib.api.ContainerizerTestProxy;
import com.google.cloud.tools.jib.api.InvalidImageRe... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/cli2/ContainerizersTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Use cacheDirectories in cli commands | 2,938 | GoogleContainerTools/jib | 11,032 | Java | loosebazooka | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/cli2/ContainerizersTest.java
PR Title: Use cacheDirectories in cli commands
BEFORE CODE: public void initCaches() {
Mockito.when(cacheDirectories.getBaseImageCache()).thenReturn(Optional.of(baseImageCach... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* @param inferredAuthProvider provides inferred auths for registry images
* @return a new {@link JavaContainerBuilder} with the configured base image
* @throws IncompatibleBaseImageJavaVersionException when the Java version in the base image is
* incompatible with the Java version of the application to ... | No issues found. | * @param inferredAuthProvider provides inferred auths for registry images
* @return a new {@link JavaContainerBuilder} with the configured base image
* @throws IncompatibleBaseImageJavaVersionException when the Java version in the base image is
* incompatible with the Java version of the application to ... | @@ -549,10 +549,12 @@ static List<String> computeEntrypoint(
if (rawEntrypoint.isPresent() && !rawEntrypoint.get().isEmpty()) {
if (rawConfiguration.getMainClass().isPresent()
|| !rawConfiguration.getJvmFlags().isEmpty()
- || !rawExtraClasspath.isEmpty()) {
+ || !rawExtraClasspa... | jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add doc for expandClasspathDependencies and update warning message | 2,949 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java
PR Title: Add doc for expandClasspathDependencies and update warning message
BEFORE CODE: * @param inferredAuthProvider provides inferred auths for re... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Mockito.when(mockJavaPluginConvention.getTargetCompatibility())
.thenReturn(JavaVersion.VERSION_1_3);
Assert.assertEquals(3, gradleProjectProperties.getMajorJavaVersion());
Mockito.when(mockJavaPluginConvention.getTargetCompatibility())
.thenReturn(JavaVersion.VERSION_11);
Assert.asser... | No issues found. |
Mockito.when(mockJavaPluginConvention.getTargetCompatibility())
.thenReturn(JavaVersion.VERSION_1_3);
Assert.assertEquals(3, gradleProjectProperties.getMajorJavaVersion());
Mockito.when(mockJavaPluginConvention.getTargetCompatibility())
.thenReturn(JavaVersion.VERSION_11);
Assert.asser... | @@ -75,7 +75,6 @@
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.api.tasks.SourceSetOutput;
import org.gradle.api.tasks.TaskContainer;
-import org.gradle.api.tasks.TaskDependency;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.jvm.tasks.Jar;
import org.hamcrest.CoreMatchers;
@@ -11... | jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Upgrade build to 6.0.1 | 2,952 | GoogleContainerTools/jib | 11,032 | Java | loosebazooka | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesTest.java
PR Title: Upgrade build to 6.0.1
BEFORE CODE:
Mockito.when(mockJavaPluginConvention.getTargetCompatibility())
.thenReturn(JavaVersion.VERSION_1_3);
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
new CommandLine(new JibCli())
.execute("jar", "--target", "docker://exploded-no-dep-jar", jarPath.toString());
String output = new Command("docker", "run", "--rm", "exploded-no-dep-jar").run();
try (JarFile jarFile = new JarFile(jarPath.toFile())) {
String classPath =
jarFile... | No issues found. | new CommandLine(new JibCli())
.execute("jar", "--target", "docker://exploded-no-dep-jar", jarPath.toString());
String output = new Command("docker", "run", "--rm", "exploded-no-dep-jar").run();
try (JarFile jarFile = new JarFile(jarPath.toFile())) {
String classPath =
jarFile... | @@ -40,12 +40,7 @@
public class JarCommandTest {
- @ClassRule
- public static final TestProject springBootProjectLayered = new TestProject("springBootLayered");
-
- @ClassRule
- public static final TestProject springBootProjectNonLayered =
- new TestProject("springBootNonLayered");
+ @ClassRule public st... | jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | remove dependency on testkit in jibcli | 2,959 | GoogleContainerTools/jib | 11,032 | Java | loosebazooka | Review this pull request change.
Language: Java
File: jib-cli/src/integration-test/java/com/google/cloud/tools/jib/cli/JarCommandTest.java
PR Title: remove dependency on testkit in jibcli
BEFORE CODE: new CommandLine(new JibCli())
.execute("jar", "--target", "docker://exploded-no-dep-jar", jarPa... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/*
* Copyright 2021 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | No issues found. | /*
* Copyright 2021 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | @@ -0,0 +1,31 @@
+/*
+ * Copyright 2021 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | jib-cli/src/test/java/com/google/cloud/tools/jib/api/JibContainerBuilderTestHelper.java | 0 | Java | 1 | none | 16 | 32 | 32 | true | Add option to specify base image for cli jar command | 2,972 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/api/JibContainerBuilderTestHelper.java
PR Title: Add option to specify base image for cli jar command
BEFORE CODE: /*
* Copyright 2021 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "Licens... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
CommandLine.populateCommand(
new Jar(),
"--target=test-image-ref",
"--from-username=test-username",
"--from-password=test-password",
"my-app.jar");
CommonCliOptions commonCliOptions = jarCommand.commonCliOptions;
assertThat(commonCliOptions.ge... | No issues found. | CommandLine.populateCommand(
new Jar(),
"--target=test-image-ref",
"--from-username=test-username",
"--from-password=test-password",
"my-app.jar");
CommonCliOptions commonCliOptions = jarCommand.commonCliOptions;
assertThat(commonCliOptions.ge... | @@ -21,8 +21,13 @@
import static org.junit.Assert.assertThrows;
import com.google.cloud.tools.jib.api.Credential;
+import com.google.cloud.tools.jib.api.Ports;
+import com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath;
+import com.google.cloud.tools.jib.api.buildplan.ImageFormat;
import com.google.cloud.to... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/JarTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add more options to cli jar command | 2,975 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/JarTest.java
PR Title: Add more options to cli jar command
BEFORE CODE: CommandLine.populateCommand(
new Jar(),
"--target=test-image-ref",
"--from-username=test-use... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
assertThat(buildPlan.getLayers().size()).isEqualTo(1);
assertThat(buildPlan.getLayers().get(0).getName()).isEqualTo("classes");
assertThat(((FileEntriesLayer) buildPlan.getLayers().get(0)).getEntries())
.containsExactlyElementsIn(
FileEntriesLayer.builder()
.addEntry(
... | No issues found. | assertThat(buildPlan.getLayers().size()).isEqualTo(1);
assertThat(buildPlan.getLayers().get(0).getName()).isEqualTo("classes");
assertThat(((FileEntriesLayer) buildPlan.getLayers().get(0)).getEntries())
.containsExactlyElementsIn(
FileEntriesLayer.builder()
.addEntry(
... | @@ -80,7 +80,7 @@ public void testToJibContainerBuilder_explodedStandard_basicInfo()
mockStandardExplodedProcessor, mockJarCommand, mockCommonCliOptions, mockLogger);
ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();
- assertThat(buildPlan.getBaseImage()).isEqualTo("gcr.io/d... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarFilesTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Build Failure if JAR requires Java >11 | 2,988 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarFilesTest.java
PR Title: Build Failure if JAR requires Java >11
BEFORE CODE: assertThat(buildPlan.getLayers().size()).isEqualTo(1);
assertThat(buildPlan.getLayers().get(0).getName()).isEqualTo(... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
GlobalConfig.readConfig(configDir);
String configJson =
new String(Files.readAllBytes(configDir.resolve("config.json")), StandardCharsets.UTF_8);
assertThat(configJson).isEqualTo("{\"disableUpdateCheck\":false,\"registryMirrors\":[]}");
}
@Test
public void testReadConfig_emptyJson() throws IO... | No issues found. | GlobalConfig.readConfig(configDir);
String configJson =
new String(Files.readAllBytes(configDir.resolve("config.json")), StandardCharsets.UTF_8);
assertThat(configJson).isEqualTo("{\"disableUpdateCheck\":false,\"registryMirrors\":[]}");
}
@Test
public void testReadConfig_emptyJson() throws IO... | @@ -45,38 +45,54 @@ public void setUp() {
}
@Test
- public void testReadConfig_default() throws IOException {
+ public void testReadConfig_default() throws IOException, InvalidGlobalConfigException {
GlobalConfig globalConfig = GlobalConfig.readConfig(configDir);
+
assertThat(globalConfig.isDisableU... | jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/globalconfig/GlobalConfigTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add registry mirror config to jib-core API and Jib global config | 2,999 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/globalconfig/GlobalConfigTest.java
PR Title: Add registry mirror config to jib-core API and Jib global config
BEFORE CODE: GlobalConfig.readConfig(configDir);
String configJson =... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
localExplodedJarRoot,
nonSnapshotPredicate,
JarLayers.APP_ROOT);
// Snapshot layer
Predicate<Path> isInBootInfLibAndIsSnapshot = isInBootInfLib.and(isSnapshot);
Predicate<Path> snapshotPredicate = isFile.and(isInBootInfLibAndIsSnapshot);
FileEntriesLaye... | No issues found. | localExplodedJarRoot,
nonSnapshotPredicate,
JarLayers.APP_ROOT);
// Snapshot layer
Predicate<Path> isInBootInfLibAndIsSnapshot = isInBootInfLib.and(isSnapshot);
Predicate<Path> snapshotPredicate = isFile.and(isInBootInfLibAndIsSnapshot);
FileEntriesLaye... | @@ -55,7 +55,7 @@ public List<FileEntriesLayer> createLayers() throws IOException {
}
try (JarFile jarFile = new JarFile(jarPath.toFile())) {
Path localExplodedJarRoot = tempDirectoryPath;
- ZipUtil.unzip(jarPath, localExplodedJarRoot);
+ ZipUtil.unzip(jarPath, localExplodedJarRoot, true);
... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/jar/SpringBootExplodedProcessor.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Preserve modification time after unzipping file | 3,008 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/jar/SpringBootExplodedProcessor.java
PR Title: Preserve modification time after unzipping file
BEFORE CODE: localExplodedJarRoot,
nonSnapshotPredicate,
JarLayers.APP_R... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
"--from-password=test-password",
"my-app.jar");
CommonCliOptions commonCliOptions = jarCommand.commonCliOptions;
assertThat(commonCliOptions.getCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getToCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getFromCrede... | No issues found. | "--from-password=test-password",
"my-app.jar");
CommonCliOptions commonCliOptions = jarCommand.commonCliOptions;
assertThat(commonCliOptions.getCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getToCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getFromCrede... | @@ -505,6 +505,14 @@ public void testParse_programArguments() {
assertThat(jarCommand.getProgramArguments()).isEqualTo(ImmutableList.of("arg1", "arg2"));
}
+ @Test
+ public void testParse_entrypoint() {
+ Jar jarCommand =
+ CommandLine.populateCommand(
+ new Jar(), "--target=test-image-... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/JarTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add option to specify entrypoint | 3,009 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/JarTest.java
PR Title: Add option to specify entrypoint
BEFORE CODE: "--from-password=test-password",
"my-app.jar");
CommonCliOptions commonCliOptions = jarCommand.commonCliOptions... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/**
* Returns a {@link JavaContainerBuilder} with the correctly parsed base image configuration.
*
* @param rawConfiguration contains the base image configuration
* @param projectProperties used for providing additional information
* @param inferredAuthProvider provides inferred auths for registry ima... | No issues found. |
/**
* Returns a {@link JavaContainerBuilder} with the correctly parsed base image configuration.
*
* @param rawConfiguration contains the base image configuration
* @param projectProperties used for providing additional information
* @param inferredAuthProvider provides inferred auths for registry ima... | @@ -90,6 +90,7 @@ public class PluginConfigurationProcessor {
* @param rawConfiguration the raw configuration from the plugin
* @param inferredAuthProvider the plugin specific auth provider
* @param projectProperties an plugin specific implementation of {@link ProjectProperties}
+ * @param globalConfig th... | jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add registry mirror support in Jib build plugins | 3,011 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java
PR Title: Add registry mirror support in Jib build plugins
BEFORE CODE:
/**
* Returns a {@link JavaContainerBuilder} with the correctly parsed base... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
assertThat(commonCliOptions.getToUsernamePassword()).isEmpty();
assertThat(commonCliOptions.getFromUsernamePassword()).isEmpty();
}
@Test
public void testParse_fromCredentialHelper() {
Build buildCommand =
CommandLine.populateCommand(
new Build(), "--target=test-image-ref", "--fro... | No issues found. | assertThat(commonCliOptions.getToUsernamePassword()).isEmpty();
assertThat(commonCliOptions.getFromUsernamePassword()).isEmpty();
}
@Test
public void testParse_fromCredentialHelper() {
Build buildCommand =
CommandLine.populateCommand(
new Build(), "--target=test-image-ref", "--fro... | @@ -54,8 +54,9 @@ public void testParse_defaults() {
assertThat(commonCliOptions.getCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getToCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getFromCredentialHelper()).isEmpty();
+ assertThat(buildCommand.buildFileUnprocessed).isNull();... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/BuildTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Use correctly processed options in build command | 3,019 | GoogleContainerTools/jib | 11,032 | Java | loosebazooka | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/BuildTest.java
PR Title: Use correctly processed options in build command
BEFORE CODE: assertThat(commonCliOptions.getToUsernamePassword()).isEmpty();
assertThat(commonCliOptions.getFromUsernamePasswor... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
applicationDirectory.resolve("build/classes/java/main/some.class"));
List<FileEntry> allFileEntries = new ArrayList<>();
allFileEntries.addAll(layers.snapshotsLayer.getEntries());
allFileEntries.addAll(layers.dependenciesLayer.getEntries());
allFileEntries.addAll(layers.classesLayer.getEntr... | No issues found. | applicationDirectory.resolve("build/classes/java/main/some.class"));
List<FileEntry> allFileEntries = new ArrayList<>();
allFileEntries.addAll(layers.snapshotsLayer.getEntries());
allFileEntries.addAll(layers.dependenciesLayer.getEntries());
allFileEntries.addAll(layers.classesLayer.getEntr... | @@ -64,6 +64,7 @@
import org.gradle.api.artifacts.dsl.DependencyHandler;
import org.gradle.api.java.archives.internal.DefaultManifest;
import org.gradle.api.logging.Logger;
+import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.bundling.War;
impo... | jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Configurable gradle configurations | 3,034 | GoogleContainerTools/jib | 11,032 | Java | cromefire | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesTest.java
PR Title: Configurable gradle configurations
BEFORE CODE: applicationDirectory.resolve("build/classes/java/main/some.class"));
List<FileEntry> all... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
import java.util.List;
import java.util.function.Predicate;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
public class StandardExplodedProcessor implements JarProcessor {
private final Path jarPath;
private final Path targetExplodedJarRoot;
public StandardExplodedProcessor(Path jarPath, Path t... | No issues found. | import java.util.List;
import java.util.function.Predicate;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
public class StandardExplodedProcessor implements JarProcessor {
private final Path jarPath;
private final Path targetExplodedJarRoot;
public StandardExplodedProcessor(Path jarPath, Path t... | @@ -19,30 +19,31 @@
import com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer;
import com.google.cloud.tools.jib.plugins.common.ZipUtil;
import com.google.common.collect.ImmutableList;
+import com.google.common.io.MoreFiles;
+import com.google.common.io.RecursiveDeleteOption;
import java.io.IOException;
imp... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/jar/StandardExplodedProcessor.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Modify jib cli jar command to preserve source file path | 3,035 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/jar/StandardExplodedProcessor.java
PR Title: Modify jib cli jar command to preserve source file path
BEFORE CODE: import java.util.List;
import java.util.function.Predicate;
import java.util.jar.Attributes;
im... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
assertThat(commonCliOptions.getCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getToCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getFromCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getUsernamePassword()).isEmpty();
assertThat(commonCliOptions.getToUsernamePassw... | No issues found. | assertThat(commonCliOptions.getCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getToCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getFromCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getUsernamePassword()).isEmpty();
assertThat(commonCliOptions.getToUsernamePassw... | @@ -29,6 +29,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.nio.file.Paths;
+import java.time.Instant;
import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import org.apache.commons.lang3.ArrayUtils;
@@ -64,6 +65,7 @@ public void test... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/JarTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | [jib-cli-jar] Add option to specify creation time of container | 3,050 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/JarTest.java
PR Title: [jib-cli-jar] Add option to specify creation time of container
BEFORE CODE: assertThat(commonCliOptions.getCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getToCredent... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return session
.getProjects()
.stream()
.map(MavenProject::getArtifact)
.filter(artifact -> !artifact.equals(project.getArtifact()))
.filter(artifact -> artifact.getFile() != null)
.collect(Collectors.toSet());
}
@VisibleForTesting
Map<LayerType, List<Path>> cl... | No issues found. | return session
.getProjects()
.stream()
.map(MavenProject::getArtifact)
.filter(artifact -> !artifact.equals(project.getArtifact()))
.filter(artifact -> artifact.getFile() != null)
.collect(Collectors.toSet());
}
@VisibleForTesting
Map<LayerType, List<Path>> cl... | @@ -54,6 +54,7 @@
import java.nio.file.Paths;
import java.time.Duration;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -100,14 +101,16 @@ public class MavenProjectProperties implements ProjectProperties {
* @param session th... | jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Support for getting / injecting shared Maven components in JibMavenPluginExtension | 3,062 | GoogleContainerTools/jib | 11,032 | Java | stefanocke | Review this pull request change.
Language: Java
File: jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java
PR Title: Support for getting / injecting shared Maven components in JibMavenPluginExtension
BEFORE CODE: return session
.getProjects()
.stream()
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Paths.get("path/to/tempDirectory/class1.class"),
AbsoluteUnixPath.get("/app/explodedJar/class1.class"))
.build()
.getEntries());
}
@Test
public void testToJibContainerBuilder_packagedStandard_basicInfo()
throws IOException, InvalidImag... | No issues found. | Paths.get("path/to/tempDirectory/class1.class"),
AbsoluteUnixPath.get("/app/explodedJar/class1.class"))
.build()
.getEntries());
}
@Test
public void testToJibContainerBuilder_packagedStandard_basicInfo()
throws IOException, InvalidImag... | @@ -62,9 +62,34 @@ public class JarFilesTest {
@Mock private ConsoleLogger mockLogger;
+ @Test
+ public void testToJibContainer_defaultBaseImage_java8()
+ throws IOException, InvalidImageReferenceException {
+ Mockito.when(mockStandardExplodedProcessor.getJarJavaVersion()).thenReturn(8);
+ JibContai... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarFilesTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Use AdoptOpenJDK image as default base image in Jib CLI Jar | 3,075 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarFilesTest.java
PR Title: Use AdoptOpenJDK image as default base image in Jib CLI Jar
BEFORE CODE: Paths.get("path/to/tempDirectory/class1.class"),
AbsoluteUnixPat... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@Test
public void testFrom_standardExploded() throws IOException, URISyntaxException {
Path jarPath = Paths.get(Resources.getResource(STANDARD).toURI());
Path explodedJarRoot = temporaryFolder.getRoot().toPath();
when(mockCacheDirectories.getExplodedJarDirectory()).thenReturn(explodedJarRoot);
when... | No issues found. |
@Test
public void testFrom_standardExploded() throws IOException, URISyntaxException {
Path jarPath = Paths.get(Resources.getResource(STANDARD).toURI());
Path explodedJarRoot = temporaryFolder.getRoot().toPath();
when(mockCacheDirectories.getExplodedJarDirectory()).thenReturn(explodedJarRoot);
when... | @@ -43,6 +43,9 @@ public class JarProcessorsTest {
private static final String SPRING_BOOT = "jar/spring-boot/springboot_sample.jar";
private static final String STANDARD = "jar/standard/emptyStandardJar.jar";
+ private static final String STANDARD_WITH_INVALID_CLASS = "jar/standard/jarWithInvalidClass.jar";
+... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarProcessorsTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | [jib-cli-jar] Add clearer error message for when the class file format is invalid. | 3,095 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarProcessorsTest.java
PR Title: [jib-cli-jar] Add clearer error message for when the class file format is invalid.
BEFORE CODE:
@Test
public void testFrom_standardExploded() throws IOException, URIS... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/**
* Should be called using {@link org.gradle.api.plugins.ExtensionContainer#create}.
*
* @param project the injected gradle project
*/
public JibExtension(Project project) {
ObjectFactory objectFactory = project.getObjects();
from = objectFactory.newInstance(BaseImageParameters.class);
t... | No issues found. |
/**
* Should be called using {@link org.gradle.api.plugins.ExtensionContainer#create}.
*
* @param project the injected gradle project
*/
public JibExtension(Project project) {
ObjectFactory objectFactory = project.getObjects();
from = objectFactory.newInstance(BaseImageParameters.class);
t... | @@ -118,16 +118,14 @@ public JibExtension(Project project) {
pluginExtensions = objectFactory.listProperty(ExtensionParameters.class).empty();
extensionParametersSpec =
objectFactory.newInstance(ExtensionParametersSpec.class, pluginExtensions);
- allowInsecureRegistries = objectFactory.property(Bo... | jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/JibExtension.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Avoid potential Gradle issue of mutating immutable property | 3,121 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/JibExtension.java
PR Title: Avoid potential Gradle issue of mutating immutable property
BEFORE CODE:
/**
* Should be called using {@link org.gradle.api.plugins.ExtensionContainer#create}.
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// Check resources
List<AbsoluteUnixPath> expectedResources =
ImmutableList.of(
AbsoluteUnixPath.get("/hello/different-resources/resourceA"),
AbsoluteUnixPath.get("/hello/different-resources/resourceB"),
AbsoluteUnixPath.get("/hello/different-resources/world"));
... | No issues found. |
// Check resources
List<AbsoluteUnixPath> expectedResources =
ImmutableList.of(
AbsoluteUnixPath.get("/hello/different-resources/resourceA"),
AbsoluteUnixPath.get("/hello/different-resources/resourceB"),
AbsoluteUnixPath.get("/hello/different-resources/world"));
... | @@ -62,7 +62,7 @@ public void testToJibContainerBuilder_all()
throws InvalidImageReferenceException, URISyntaxException, IOException,
CacheDirectoryCreationException {
BuildContext buildContext =
- JavaContainerBuilder.fromDistroless()
+ JavaContainerBuilder.from("scratch")
... | jib-core/src/test/java/com/google/cloud/tools/jib/api/JavaContainerBuilderTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Deprecate Distroless methods in jib-core | 3,123 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/api/JavaContainerBuilderTest.java
PR Title: Deprecate Distroless methods in jib-core
BEFORE CODE:
// Check resources
List<AbsoluteUnixPath> expectedResources =
ImmutableList.of(
Absol... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
"mainClass, extraClasspath, jvmFlags, and expandClasspathDependencies are ignored "
+ "when entrypoint is specified"));
}
@Test
public void testEntrypoint_warningOnMainclassForWar()
throws IOException, InvalidCreationTimeException, InvalidImageReferenceException,
... | No issues found. | "mainClass, extraClasspath, jvmFlags, and expandClasspathDependencies are ignored "
+ "when entrypoint is specified"));
}
@Test
public void testEntrypoint_warningOnMainclassForWar()
throws IOException, InvalidCreationTimeException, InvalidImageReferenceException,
... | @@ -355,7 +355,9 @@ public void testEntrypoint_defaultWarPackaging()
BuildContext buildContext = getBuildContext(processCommonConfiguration());
- assertThat(buildContext.getContainerConfiguration().getEntrypoint()).isNull();
+ assertThat(buildContext.getContainerConfiguration().getEntrypoint())
+ ... | jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessorTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Change the default base images from Distroless in Jib build plugins | 3,124 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessorTest.java
PR Title: Change the default base images from Distroless in Jib build plugins
BEFORE CODE: "mainClass, extraClasspath, jvmFlags, and ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/*
* Copyright 2021 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | No issues found. | /*
* Copyright 2021 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | @@ -0,0 +1,35 @@
+/*
+ * Copyright 2021 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/logging/HttpTraceLevel.java | 0 | Java | 1 | none | 16 | 36 | 36 | true | Implement --http-trace in Jib CLI | 3,130 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/logging/HttpTraceLevel.java
PR Title: Implement --http-trace in Jib CLI
BEFORE CODE: /*
* Copyright 2021 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use t... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
split = ",",
description =
"Labels to write into container metadata, example: --labels=label1=value1,label2=value2.")
private Map<String, String> labels = Collections.emptyMap();
@CommandLine.Option(
names = {"-u", "--user"},
paramLabel = "<user>",
description = "The user to... | No issues found. | split = ",",
description =
"Labels to write into container metadata, example: --labels=label1=value1,label2=value2.")
private Map<String, String> labels = Collections.emptyMap();
@CommandLine.Option(
names = {"-u", "--user"},
paramLabel = "<user>",
description = "The user to... | @@ -46,7 +46,11 @@
import picocli.CommandLine;
import picocli.CommandLine.Model.CommandSpec;
-@CommandLine.Command(name = "jar", showAtFileInUsageHelp = true, description = "Containerize a jar")
+@CommandLine.Command(
+ name = "jar",
+ mixinStandardHelpOptions = true,
+ showAtFileInUsageHelp = true,
+ d... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/Jar.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | [Jib-CLI] Print short error message when invalid option is passed in | 3,131 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/Jar.java
PR Title: [Jib-CLI] Print short error message when invalid option is passed in
BEFORE CODE: split = ",",
description =
"Labels to write into container metadata, example: --labels... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
CachedLayer writeCompressed(Blob compressedLayerBlob) throws IOException {
// Creates the layers directory if it doesn't exist.
Files.createDirectories(cacheStorageFiles.getLayersDirectory());
// Creates the temporary directory.
Files.createDirectories(cacheStorageFiles.getTemporaryDirectory());
... | No issues found. | CachedLayer writeCompressed(Blob compressedLayerBlob) throws IOException {
// Creates the layers directory if it doesn't exist.
Files.createDirectories(cacheStorageFiles.getLayersDirectory());
// Creates the temporary directory.
Files.createDirectories(cacheStorageFiles.getTemporaryDirectory());
... | @@ -21,6 +21,7 @@
import com.google.cloud.tools.jib.blob.Blob;
import com.google.cloud.tools.jib.blob.BlobDescriptor;
import com.google.cloud.tools.jib.blob.Blobs;
+import com.google.cloud.tools.jib.cache.Retry.Action;
import com.google.cloud.tools.jib.filesystem.LockFile;
import com.google.cloud.tools.jib.filesys... | jib-core/src/main/java/com/google/cloud/tools/jib/cache/CacheStorageWriter.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Increase retry attempts and fix the issue of exception being consumed | 3,133 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/cache/CacheStorageWriter.java
PR Title: Increase retry attempts and fix the issue of exception being consumed
BEFORE CODE: CachedLayer writeCompressed(Blob compressedLayerBlob) throws IOException {
// Creat... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language gover... | No issues found. | * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language gover... | @@ -0,0 +1,63 @@
+/*
+ * Copyright 2021 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by ... | jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MojoCommonTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Implement update checker for Jib CLI | 3,165 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MojoCommonTest.java
PR Title: Implement update checker for Jib CLI
BEFORE CODE: * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, so... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return from.credHelper;
}
AuthConfiguration getBaseImageAuth() {
// System/pom properties for auth are handled in ConfigurationPropertyValidator
return from.auth;
}
/**
* Gets the target image reference.
*
* @return the configured target image reference
*/
@Nullable
protected Strin... | No issues found. | return from.credHelper;
}
AuthConfiguration getBaseImageAuth() {
// System/pom properties for auth are handled in ConfigurationPropertyValidator
return from.auth;
}
/**
* Gets the target image reference.
*
* @return the configured target image reference
*/
@Nullable
protected Strin... | @@ -21,6 +21,7 @@
import com.google.cloud.tools.jib.plugins.common.ConfigurationPropertyValidator;
import com.google.cloud.tools.jib.plugins.common.PropertyNames;
import com.google.cloud.tools.jib.plugins.common.RawConfiguration.ExtensionConfiguration;
+import com.google.cloud.tools.jib.plugins.common.RawConfigurati... | jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add inclusion/exclusion filtering configuration for ExtraDirectories in Maven and Gradle | 3,171 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java
PR Title: Add inclusion/exclusion filtering configuration for ExtraDirectories in Maven and Gradle
BEFORE CODE: return from.credHelper;
}
AuthConfiguration getBa... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
/**
* Returns a {@link JavaContainerBuilder} with the correctly parsed base image configuration.
*
* @param rawConfiguration contains the base image configuration
* @param projectProperties used for providing additional information
* @param inferredAuthProvider provides inferred auths for registry... | No issues found. | }
/**
* Returns a {@link JavaContainerBuilder} with the correctly parsed base image configuration.
*
* @param rawConfiguration contains the base image configuration
* @param projectProperties used for providing additional information
* @param inferredAuthProvider provides inferred auths for registry... | @@ -436,6 +436,8 @@ static JibContainerBuilder processCommonConfiguration(
JavaContainerBuilderHelper.extraDirectoryLayerConfiguration(
from,
AbsoluteUnixPath.get(extraDirectory.getInto()),
+ extraDirectory.getIncludesList(),
+ extraDirectory.... | jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | <includes> and <excludes> filtering feature for extraDirectories | 3,173 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java
PR Title: <includes> and <excludes> filtering feature for extraDirectories
BEFORE CODE: }
/**
* Returns a {@link JavaContainerBuilder} with the c... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
verifier.executeGoals(Arrays.asList("clean", "jib:build"));
Assert.fail();
} catch (VerificationException ex) {
MatcherAssert.assertThat(
ex.getMessage(),
CoreMatchers.containsString(
"Obtaining project build output files failed; make sure you have compiled your ... | No issues found. | verifier.executeGoals(Arrays.asList("clean", "jib:build"));
Assert.fail();
} catch (VerificationException ex) {
MatcherAssert.assertThat(
ex.getMessage(),
CoreMatchers.containsString(
"Obtaining project build output files failed; make sure you have compiled your ... | @@ -16,6 +16,8 @@
package com.google.cloud.tools.jib.maven;
+import static com.google.common.truth.Truth.assertThat;
+
import com.google.cloud.tools.jib.Command;
import com.google.cloud.tools.jib.IntegrationTestingConfiguration;
import com.google.cloud.tools.jib.api.Credential;
@@ -218,8 +220,8 @@ private stati... | jib-maven-plugin/src/integration-test/java/com/google/cloud/tools/jib/maven/BuildImageMojoIntegrationTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add CHANGELOG and integration tests for extra directories filtering | 3,176 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-maven-plugin/src/integration-test/java/com/google/cloud/tools/jib/maven/BuildImageMojoIntegrationTest.java
PR Title: Add CHANGELOG and integration tests for extra directories filtering
BEFORE CODE: verifier.executeGoals(Arrays.asList("clean", "jib:bui... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@ClassRule public static final TestProject emptyTestProject = new TestProject("empty");
/**
* Asserts that the test project has the required exposed ports and labels.
*
* @param imageReference the image to test
* @throws IOException if the {@code docker inspect} command fails to run
* @throws Inter... | No issues found. |
@ClassRule public static final TestProject emptyTestProject = new TestProject("empty");
/**
* Asserts that the test project has the required exposed ports and labels.
*
* @param imageReference the image to test
* @throws IOException if the {@code docker inspect} command fails to run
* @throws Inter... | @@ -16,6 +16,8 @@
package com.google.cloud.tools.jib.gradle;
+import static com.google.common.truth.Truth.assertThat;
+
import com.google.cloud.tools.jib.Command;
import com.google.cloud.tools.jib.IntegrationTestingConfiguration;
import com.google.cloud.tools.jib.api.InvalidImageReferenceException;
@@ -69,7 +71... | jib-gradle-plugin/src/integration-test/java/com/google/cloud/tools/jib/gradle/EmptyProjectIntegrationTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Cleanups and fixes | 3,178 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/integration-test/java/com/google/cloud/tools/jib/gradle/EmptyProjectIntegrationTest.java
PR Title: Cleanups and fixes
BEFORE CODE:
@ClassRule public static final TestProject emptyTestProject = new TestProject("empty");
/**
* Assert... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
assertThat(commonCliOptions.getToCredentialHelper()).hasValue("test-cred-helper");
assertThat(commonCliOptions.getFromCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getUsernamePassword()).isEmpty();
assertThat(commonCliOptions.getToUsernamePassword()).isEmpty();
assertThat(commonCliOptio... | No issues found. | assertThat(commonCliOptions.getToCredentialHelper()).hasValue("test-cred-helper");
assertThat(commonCliOptions.getFromCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getUsernamePassword()).isEmpty();
assertThat(commonCliOptions.getToUsernamePassword()).isEmpty();
assertThat(commonCliOptio... | @@ -68,6 +68,7 @@ public void testParse_defaults() {
assertThat(commonCliOptions.isStacktrace()).isFalse();
assertThat(commonCliOptions.getHttpTrace()).isEqualTo(HttpTraceLevel.off);
assertThat(commonCliOptions.isSerialize()).isFalse();
+ assertThat(commonCliOptions.getImageJsonPath()).isEmpty();
}... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/BuildTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | [jib-cli] Add option to create an output JSON file that contains image metadata for the built image | 3,187 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/BuildTest.java
PR Title: [jib-cli] Add option to create an output JSON file that contains image metadata for the built image
BEFORE CODE: assertThat(commonCliOptions.getToCredentialHelper()).hasValue("test... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
TaskContainer tasks = project.getTasks();
Task warTask = tasks.getByPath(":war");
Task bootWarTask = tasks.getByPath(":bootWar");
assertThat(warTask).isNotNull();
assertThat(bootWarTask).isNotNull();
for (String taskName : KNOWN_JIB_TASKS) {
Set<Object> taskDependencies = tasks.getByPath(... | No issues found. | TaskContainer tasks = project.getTasks();
Task warTask = tasks.getByPath(":war");
Task bootWarTask = tasks.getByPath(":bootWar");
assertThat(warTask).isNotNull();
assertThat(bootWarTask).isNotNull();
for (String taskName : KNOWN_JIB_TASKS) {
Set<Object> taskDependencies = tasks.getByPath(... | @@ -35,6 +35,7 @@
import org.gradle.api.tasks.TaskProvider;
import org.gradle.jvm.tasks.Jar;
import org.gradle.testfixtures.ProjectBuilder;
+import org.gradle.testkit.runner.BuildResult;
import org.gradle.testkit.runner.GradleRunner;
import org.gradle.testkit.runner.UnexpectedBuildFailure;
import org.junit.After;... | jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/JibPluginTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Use Gradle Property and Provider to enable lazy evaluation for jib.container.labels (#3094) | 3,242 | GoogleContainerTools/jib | 11,032 | Java | NaitYoussef | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/JibPluginTest.java
PR Title: Use Gradle Property and Provider to enable lazy evaluation for jib.container.labels (#3094)
BEFORE CODE: TaskContainer tasks = project.getTasks();
Task warTask... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Paths.get("path/to/tempDirectory/class1.class"),
AbsoluteUnixPath.get("/app/explodedJar/class1.class"))
.build()
.getEntries());
}
@Test
public void testToJibContainerBuilder_packagedStandard_basicInfo()
throws IOException, InvalidImag... | No issues found. | Paths.get("path/to/tempDirectory/class1.class"),
AbsoluteUnixPath.get("/app/explodedJar/class1.class"))
.build()
.getEntries());
}
@Test
public void testToJibContainerBuilder_packagedStandard_basicInfo()
throws IOException, InvalidImag... | @@ -17,6 +17,7 @@
package com.google.cloud.tools.jib.cli.jar;
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.Mockito.when;
import com.google.cloud.tools.jib.api.InvalidImageReferenceException;
@@ -40,7 +41,6 @@
import java.... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarFilesTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Implement class to create JibContainerBuilder from the contents of a WAR file | 3,248 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarFilesTest.java
PR Title: Implement class to create JibContainerBuilder from the contents of a WAR file
BEFORE CODE: Paths.get("path/to/tempDirectory/class1.class"),
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
NumberFormatException, InvalidContainerizingModeException,
InvalidFilesModificationTimeException, InvalidCreationTimeException {
when(rawConfiguration.getEntrypoint())
.thenReturn(Optional.of(Arrays.asList("custom", "entrypoint")));
when(rawConfiguration.getJvmFlags()).thenReturn(Col... | No issues found. | NumberFormatException, InvalidContainerizingModeException,
InvalidFilesModificationTimeException, InvalidCreationTimeException {
when(rawConfiguration.getEntrypoint())
.thenReturn(Optional.of(Arrays.asList("custom", "entrypoint")));
when(rawConfiguration.getJvmFlags()).thenReturn(Col... | @@ -496,6 +496,54 @@ public void testClasspathArgumentFile()
assertThat(jvmArgFiles)
.comparingElementsUsing(EXTRACTION_PATH_OF)
.containsExactly("/app/jib-classpath-file", "/app/jib-main-class-file");
+
+ String classpath =
+ new String(
+ Files.readAllBytes(appCacheDirector... | jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessorTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Don't fail on main class inference if custom entrypoint | 3,296 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessorTest.java
PR Title: Don't fail on main class inference if custom entrypoint
BEFORE CODE: NumberFormatException, InvalidContainerizingModeException,
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
.stream()
.map(MavenProject::getArtifact)
.filter(artifact -> !artifact.equals(project.getArtifact()))
.filter(artifact -> artifact.getFile() != null)
.collect(Collectors.toSet());
}
@VisibleForTesting
Map<LayerType, List<Path>> classifyDependencies(
Set<Artifact> de... | No issues found. | .stream()
.map(MavenProject::getArtifact)
.filter(artifact -> !artifact.equals(project.getArtifact()))
.filter(artifact -> artifact.getFile() != null)
.collect(Collectors.toSet());
}
@VisibleForTesting
Map<LayerType, List<Path>> classifyDependencies(
Set<Artifact> de... | @@ -314,11 +314,11 @@ public JibContainerBuilder createJibContainerBuilder(
} catch (IOException ex) {
throw new IOException(
"Obtaining project build output files failed; make sure you have "
- + (containerizingMode == ContainerizingMode.PACKAGED ? "packaged" : "compiled")
+ ... | jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add packaging condition to format exception message correctly in MavenProjectProperties#createJibContainerBuilder | 3,306 | GoogleContainerTools/jib | 11,032 | Java | JacekDuszenko | Review this pull request change.
Language: Java
File: jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java
PR Title: Add packaging condition to format exception message correctly in MavenProjectProperties#createJibContainerBuilder
BEFORE CODE: .stream()
.map(Ma... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
"my-app.jar");
CommonCliOptions commonCliOptions = jarCommand.commonCliOptions;
assertThat(commonCliOptions.getCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getToCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getFromCredentialHelper()).isEmpty();
assertThat(comm... | No issues found. | "my-app.jar");
CommonCliOptions commonCliOptions = jarCommand.commonCliOptions;
assertThat(commonCliOptions.getCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getToCredentialHelper()).isEmpty();
assertThat(commonCliOptions.getFromCredentialHelper()).isEmpty();
assertThat(comm... | @@ -21,6 +21,7 @@
import static org.junit.Assert.assertThrows;
import com.google.cloud.tools.jib.api.Credential;
+import com.google.cloud.tools.jib.api.InvalidImageReferenceException;
import com.google.cloud.tools.jib.api.Ports;
import com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath;
import com.google.... | jib-cli/src/test/java/com/google/cloud/tools/jib/cli/JarTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Remove duplicate code from Jib CLI | 3,310 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/JarTest.java
PR Title: Remove duplicate code from Jib CLI
BEFORE CODE: "my-app.jar");
CommonCliOptions commonCliOptions = jarCommand.commonCliOptions;
assertThat(commonCliOptions.getCreden... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
InvalidAppRootException, InvalidWorkingDirectoryException, InvalidPlatformException,
InvalidContainerVolumeException, IncompatibleBaseImageJavaVersionException,
NumberFormatException, InvalidContainerizingModeException,
InvalidFilesModificationTimeException, InvalidCreationTimeEx... | No issues found. | InvalidAppRootException, InvalidWorkingDirectoryException, InvalidPlatformException,
InvalidContainerVolumeException, IncompatibleBaseImageJavaVersionException,
NumberFormatException, InvalidContainerizingModeException,
InvalidFilesModificationTimeException, InvalidCreationTimeEx... | @@ -413,6 +413,31 @@ public void testComputeEntrypoint_expandClasspathDependencies()
.inOrder();
}
+ @Test
+ public void testComputeEntrypoint_expandClasspathDependencies_sizeAddedForDuplicateJars()
+ throws MainClassInferenceException, InvalidAppRootException, IOException,
+ InvalidContai... | jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessorTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add jar size suffix to target dependency paths on image when dependency jars have same artifact ID and version | 3,336 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessorTest.java
PR Title: Add jar size suffix to target dependency paths on image when dependency jars have same artifact ID and version
BEFORE CODE: Inval... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
new FailoverHttpClient(false, true /*insecure*/, false, logger);
try (TestWebServer server = new TestWebServer(true, 2);
Response response = insecureHttpClient.get(new URL(server.getEndpoint()), request)) {
Assert.assertEquals(200, response.getStatusCode());
Assert.assertArrayEquals(
... | No issues found. | new FailoverHttpClient(false, true /*insecure*/, false, logger);
try (TestWebServer server = new TestWebServer(true, 2);
Response response = insecureHttpClient.get(new URL(server.getEndpoint()), request)) {
Assert.assertEquals(200, response.getStatusCode());
Assert.assertArrayEquals(
... | @@ -52,7 +52,7 @@ public class WithServerFailoverHttpClientTest {
public void testGet()
throws IOException, InterruptedException, GeneralSecurityException, URISyntaxException {
FailoverHttpClient insecureHttpClient =
- new FailoverHttpClient(true /*insecure*/, false, logger);
+ new Failover... | jib-core/src/test/java/com/google/cloud/tools/jib/http/WithServerFailoverHttpClientTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Retry network operations with registries on I/O errors | 3,351 | GoogleContainerTools/jib | 11,032 | Java | rmannibucau | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/http/WithServerFailoverHttpClientTest.java
PR Title: Retry network operations with registries on I/O errors
BEFORE CODE: new FailoverHttpClient(false, true /*insecure*/, false, logger);
try (TestWebSe... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Instant.ofEpochSecond(50))))
.build();
Path tarFile = temporaryFolder.newFile().toPath();
try (OutputStream out = new BufferedOutputStream(Files.newOutputStream(tarFile))) {
layer.writeTo(out);
}
try (TarArchiveInputStream in = new TarArchiveInputStream(Files.... | No issues found. | Instant.ofEpochSecond(50))))
.build();
Path tarFile = temporaryFolder.newFile().toPath();
try (OutputStream out = new BufferedOutputStream(Files.newOutputStream(tarFile))) {
layer.writeTo(out);
}
try (TarArchiveInputStream in = new TarArchiveInputStream(Files.... | @@ -16,18 +16,19 @@
package com.google.cloud.tools.jib.image;
+import static com.google.common.truth.Truth.assertThat;
+
import com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath;
import com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer;
import com.google.cloud.tools.jib.api.buildplan.FileEntry;
... | jib-core/src/test/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilderTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Reset user and group for automatically added parent directories while building reproducible layer tars | 3,353 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilderTest.java
PR Title: Reset user and group for automatically added parent directories while building reproducible layer tars
BEFORE CODE: Instant.ofEpochSecond(... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
testTarStreamBuilder.addBlobEntry(
Blobs.from("jib"), "jib".getBytes(StandardCharsets.UTF_8).length, "jib", Instant.EPOCH);
// Writes the BLOB and captures the output.
ByteArrayOutputStream tarByteOutputStream = new ByteArrayOutputStream();
OutputStream compressorStream = new GZIPOutputStream(t... | No issues found. | testTarStreamBuilder.addBlobEntry(
Blobs.from("jib"), "jib".getBytes(StandardCharsets.UTF_8).length, "jib", Instant.EPOCH);
// Writes the BLOB and captures the output.
ByteArrayOutputStream tarByteOutputStream = new ByteArrayOutputStream();
OutputStream compressorStream = new GZIPOutputStream(t... | @@ -161,39 +161,36 @@ public void testToBlob_modificationTime() throws IOException {
}
/** Creates a TarStreamBuilder using TarArchiveEntries. */
- private void setUpWithTarEntries() {
+ private void setUpWithTarEntries() throws IOException {
// Prepares a test TarStreamBuilder.
testTarStreamBuilder... | jib-core/src/test/java/com/google/cloud/tools/jib/tar/TarStreamBuilderTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Allow jib images to be built from TarArchiveEntries on alternative FileSystems | 3,357 | GoogleContainerTools/jib | 11,032 | Java | Sineaggi | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/tar/TarStreamBuilderTest.java
PR Title: Allow jib images to be built from TarArchiveEntries on alternative FileSystems
BEFORE CODE: testTarStreamBuilder.addBlobEntry(
Blobs.from("jib"), "jib".getBytes... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@CommandLine.Mixin
@VisibleForTesting
@SuppressWarnings("NullAway.Init") // initialized by picocli
CommonCliOptions commonCliOptions;
@CommandLine.Mixin
@VisibleForTesting
@SuppressWarnings("NullAway.Init") // initialized by picocli
CommonContainerConfigCliOptions commonContainerConfigCliOptions;
@C... | No issues found. | @CommandLine.Mixin
@VisibleForTesting
@SuppressWarnings("NullAway.Init") // initialized by picocli
CommonCliOptions commonCliOptions;
@CommandLine.Mixin
@VisibleForTesting
@SuppressWarnings("NullAway.Init") // initialized by picocli
CommonContainerConfigCliOptions commonContainerConfigCliOptions;
@C... | @@ -133,6 +133,10 @@ public Integer call() {
JibContainer jibContainer = containerBuilder.containerize(containerizer);
JibCli.writeImageJson(commonCliOptions.getImageJsonPath(), jibContainer);
+ } catch (InterruptedException ex) {
+ JibCli.logTerminatingException(logger, ex, commonCliOptions.isS... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/Jar.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Re-interrupt threads when InterruptedException is caught | 3,378 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/Jar.java
PR Title: Re-interrupt threads when InterruptedException is caught
BEFORE CODE: @CommandLine.Mixin
@VisibleForTesting
@SuppressWarnings("NullAway.Init") // initialized by picocli
CommonCliOpti... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Assert.assertEquals(TEST_HELPFUL_SUGGESTIONS.forHttpHostConnect(), ex.getMessage());
}
}
@Test
public void testBuildImage_unknownHostException()
throws InterruptedException, IOException, CacheDirectoryCreationException, RegistryException,
ExecutionException {
UnknownHostException mo... | No issues found. | Assert.assertEquals(TEST_HELPFUL_SUGGESTIONS.forHttpHostConnect(), ex.getMessage());
}
}
@Test
public void testBuildImage_unknownHostException()
throws InterruptedException, IOException, CacheDirectoryCreationException, RegistryException,
ExecutionException {
UnknownHostException mo... | @@ -81,7 +81,8 @@ public void setUpMocks() {
@Test
public void testBuildImage_pass()
throws BuildStepsExecutionException, IOException, CacheDirectoryCreationException {
- testJibBuildRunner.runBuild();
+ JibContainer buildResult = testJibBuildRunner.runBuild();
+ Assert.assertNull(buildResult);
... | jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | fixes several sonar code-smell for no assertion in test. | 3,379 | GoogleContainerTools/jib | 11,032 | Java | zhumin8 | Review this pull request change.
Language: Java
File: jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java
PR Title: fixes several sonar code-smell for no assertion in test.
BEFORE CODE: Assert.assertEquals(TEST_HELPFUL_SUGGESTIONS.forHttpHostConnect(), ex.getMess... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
try (Response response =
insecureHttpClient.get(new URL("https://insecure:5000"), fakeRequest(null))) {
Assert.fail("Should not fall back to HTTP if port was explicitly given and cannot connect");
} catch (ConnectException ex) {
Assert.assertEquals("my exception", ex.getMessage());
ve... | No issues found. | try (Response response =
insecureHttpClient.get(new URL("https://insecure:5000"), fakeRequest(null))) {
Assert.fail("Should not fall back to HTTP if port was explicitly given and cannot connect");
} catch (ConnectException ex) {
Assert.assertEquals("my exception", ex.getMessage());
ve... | @@ -16,8 +16,7 @@
package com.google.cloud.tools.jib.http;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static com.google.common.truth.Truth.assertThat;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpHeaders;
@@ -28,7 +27... | jib-core/src/test/java/com/google/cloud/tools/jib/http/FailoverHttpClientTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | CHANGELOG and cleanups after the HTTP retry external PR contribution | 3,390 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/http/FailoverHttpClientTest.java
PR Title: CHANGELOG and cleanups after the HTTP retry external PR contribution
BEFORE CODE: try (Response response =
insecureHttpClient.get(new URL("https://insecure:5... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* set to "scratch".
*
* @return an {@link ImageReference} with an empty registry and tag component, and repository set
* to "scratch"
*/
public static ImageReference scratch() {
return new ImageReference("", SCRATCH, null, null);
}
/**
* Returns {@code true} if {@code registry} is a val... | No issues found. | * set to "scratch".
*
* @return an {@link ImageReference} with an empty registry and tag component, and repository set
* to "scratch"
*/
public static ImageReference scratch() {
return new ImageReference("", SCRATCH, null, null);
}
/**
* Returns {@code true} if {@code registry} is a val... | @@ -38,6 +38,7 @@ public class ImageReference {
private static final String DOCKER_HUB_REGISTRY = "registry-1.docker.io";
private static final String DEFAULT_TAG = "latest";
private static final String LIBRARY_REPOSITORY_PREFIX = "library/";
+ private static final String SCRATCH = "scratch";
/**
* Ma... | jib-core/src/main/java/com/google/cloud/tools/jib/api/ImageReference.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Define constants instead of using String literals | 3,402 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/api/ImageReference.java
PR Title: Define constants instead of using String literals
BEFORE CODE: * set to "scratch".
*
* @return an {@link ImageReference} with an empty registry and tag component, and re... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
*/
package com.google.cloud.tools.jib.cli.buildfile;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.List;
import java.... | No issues found. | */
package com.google.cloud.tools.jib.cli.buildfile;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.List;
import java.... | @@ -32,10 +32,10 @@
* <pre>{@code
* name: "my classes layer"
* files:
- * - {@link CopySpec}
- * - {@link CopySpec}
+ * - }{@link CopySpec}{@code
+ * - }{@link CopySpec}{@code
* // optional properties
- * properties: see {@link FilePropertiesSpec}
+ * properties: see }{@link FilePropertiesSpec}{@code
... | jib-cli/src/main/java/com/google/cloud/tools/jib/cli/buildfile/FileLayerSpec.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Eliminate ErrorProne warnings | 3,410 | GoogleContainerTools/jib | 11,032 | Java | rainyShine | Review this pull request change.
Language: Java
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/buildfile/FileLayerSpec.java
PR Title: Eliminate ErrorProne warnings
BEFORE CODE: */
package com.google.cloud.tools.jib.cli.buildfile;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterx... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
import java.io.IOException;
import java.io.OutputStream;
import java.nio.channels.FileLock;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/** Creates and deletes lock files. ... | No issues found. | import java.io.IOException;
import java.io.OutputStream;
import java.nio.channels.FileLock;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/** Creates and deletes lock files. ... | @@ -33,12 +33,12 @@ public class LockFile implements Closeable {
private static final ConcurrentHashMap<Path, Lock> lockMap = new ConcurrentHashMap<>();
- private final Path lockFile;
+ private final Path lockFilePath;
private final FileLock fileLock;
private final OutputStream outputStream;
- private... | jib-core/src/main/java/com/google/cloud/tools/jib/filesystem/LockFile.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Field name changes to fix sonar issues | 3,412 | GoogleContainerTools/jib | 11,032 | Java | zhumin8 | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/filesystem/LockFile.java
PR Title: Field name changes to fix sonar issues
BEFORE CODE: import java.io.IOException;
import java.io.OutputStream;
import java.nio.channels.FileLock;
import java.nio.file.Files;
impor... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
expectedTargetTag, buildContext.getTargetImageConfiguration().getImageQualifier());
Assert.assertEquals(expectedTargetImageTags, buildContext.getAllTargetImageTags());
Assert.assertEquals(
Credential.from("username", "password"),
buildContext
.getTargetImageConfiguration()
... | No issues found. | expectedTargetTag, buildContext.getTargetImageConfiguration().getImageQualifier());
Assert.assertEquals(expectedTargetImageTags, buildContext.getAllTargetImageTags());
Assert.assertEquals(
Credential.from("username", "password"),
buildContext
.getTargetImageConfiguration()
... | @@ -128,6 +128,7 @@ public void testBuilder() throws Exception {
.setApplicationLayersCacheDirectory(expectedApplicationLayersCacheDirectory)
.setBaseImageLayersCacheDirectory(expectedBaseImageLayersCacheDirectory)
.setTargetFormat(ImageFormat.OCI)
+ .setEnablePlatformT... | jib-core/src/test/java/com/google/cloud/tools/jib/configuration/BuildContextTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Build option to add architecture suffix to tags when publishing multi-platform images | 3,523 | GoogleContainerTools/jib | 11,032 | Java | taer | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/configuration/BuildContextTest.java
PR Title: Build option to add architecture suffix to tags when publishing multi-platform images
BEFORE CODE: expectedTargetTag, buildContext.getTargetImageConfiguration... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@Test
public void testSystemPropertiesWithInvalidPlatform() {
sessionProperties.put("jib.from.platforms", "linux /amd64");
assertThrows(IllegalArgumentException.class, testPluginConfiguration::getPlatforms);
}
@Test
public void testSystemPropertiesExtraDirectories() {
sessionProperties.put("jib.... | No issues found. |
@Test
public void testSystemPropertiesWithInvalidPlatform() {
sessionProperties.put("jib.from.platforms", "linux /amd64");
assertThrows(IllegalArgumentException.class, testPluginConfiguration::getPlatforms);
}
@Test
public void testSystemPropertiesExtraDirectories() {
sessionProperties.put("jib.... | @@ -16,10 +16,13 @@
package com.google.cloud.tools.jib.maven;
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth8.assertThat;
+import static org.junit.Assert.assertThrows;
+import static org.mockito.Mockito.when;
+
import com.google.cloud.tools.jib.maven.JibPlugi... | jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Expose jib.from.platforms as property. | 3,526 | GoogleContainerTools/jib | 11,032 | Java | ls-urs-keller | Review this pull request change.
Language: Java
File: jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java
PR Title: Expose jib.from.platforms as property.
BEFORE CODE:
@Test
public void testSystemPropertiesWithInvalidPlatform() {
sessionProperties.put("jib.from.p... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return outputLines.get(2); // this is the JSON output
}
private static void assertFilePaths(Path src, AbsoluteUnixPath dest, FileTemplate template) {
Assert.assertEquals(src.toString(), template.getSrc());
Assert.assertEquals(dest.toString(), template.getDest());
}
@Test
public void testSyncMapM... | No issues found. | return outputLines.get(2); // this is the JSON output
}
private static void assertFilePaths(Path src, AbsoluteUnixPath dest, FileTemplate template) {
Assert.assertEquals(src.toString(), template.getSrc());
Assert.assertEquals(dest.toString(), template.getDest());
}
@Test
public void testSyncMapM... | @@ -126,12 +126,20 @@ public void testSyncMapMojo_multiProjectOutput() throws IOException, Verificatio
generated.get(1));
List<FileTemplate> direct = parsed.getDirect();
- Assert.assertEquals(1, direct.size());
+ Assert.assertEquals(3, direct.size());
assertFilePaths(
m2.resolve(
... | jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/skaffold/SyncMapMojoTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Throw exception if extraDirectories config contains invalid path | 3,550 | GoogleContainerTools/jib | 11,032 | Java | tommysitu | Review this pull request change.
Language: Java
File: jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/skaffold/SyncMapMojoTest.java
PR Title: Throw exception if extraDirectories config contains invalid path
BEFORE CODE: return outputLines.get(2); // this is the JSON output
}
private static ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
assertThat(mainClass).isEqualTo("could-not-infer-a-main-class");
}
@Test
public void testUser()
throws InvalidImageReferenceException, IOException, MainClassInferenceException,
InvalidAppRootException, InvalidWorkingDirectoryException, InvalidPlatformException,
InvalidContainerVolum... | No issues found. | assertThat(mainClass).isEqualTo("could-not-infer-a-main-class");
}
@Test
public void testUser()
throws InvalidImageReferenceException, IOException, MainClassInferenceException,
InvalidAppRootException, InvalidWorkingDirectoryException, InvalidPlatformException,
InvalidContainerVolum... | @@ -869,8 +869,8 @@ public void testGetDefaultBaseImage_warProject()
"8, eclipse-temurin:8-jre",
"9, eclipse-temurin:11-jre",
"11, eclipse-temurin:11-jre",
- "13, azul/zulu-openjdk:17-jre",
- "17, azul/zulu-openjdk:17-jre"
+ "13, eclipse-temurin:17-jre",
+ "17, ecl... | jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessorTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Use Eclipse Temurin for Java 17 | 3,552 | GoogleContainerTools/jib | 11,032 | Java | chanseokoh | Review this pull request change.
Language: Java
File: jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessorTest.java
PR Title: Use Eclipse Temurin for Java 17
BEFORE CODE: assertThat(mainClass).isEqualTo("could-not-infer-a-main-class");
}
@Test
public voi... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
@Input
public boolean getExpandClasspathDependencies() {
if (System.getProperty(PropertyNames.EXPAND_CLASSPATH_DEPENDENCIES) != null) {
return Boolean.valueOf(System.getProperty(PropertyNames.EXPAND_CLASSPATH_DEPENDENCIES));
}
return expandClasspathDependencies;
}
public void setExpandCl... | No issues found. | }
@Input
public boolean getExpandClasspathDependencies() {
if (System.getProperty(PropertyNames.EXPAND_CLASSPATH_DEPENDENCIES) != null) {
return Boolean.valueOf(System.getProperty(PropertyNames.EXPAND_CLASSPATH_DEPENDENCIES));
}
return expandClasspathDependencies;
}
public void setExpandCl... | @@ -173,6 +173,10 @@ public void setFormat(ImageFormat format) {
this.format = format;
}
+ public void setFormat(String format) {
+ this.format = ImageFormat.valueOf(format);
+ }
+
@Input
@Optional
public List<String> getPorts() { | jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/ContainerParameters.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | fix format config on buildSrc kts srcipt | 3,593 | GoogleContainerTools/jib | 11,032 | Java | BiLuoHen | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/ContainerParameters.java
PR Title: fix format config on buildSrc kts srcipt
BEFORE CODE: }
@Input
public boolean getExpandClasspathDependencies() {
if (System.getProperty(PropertyNames.... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException, URISyntaxException {
// tar saved with 'docker save busybox -o busybox.tar'
Path path = Paths.get(Resources.getResource("core/busybox-docker.tar").toU... | No issues found. | throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException, URISyntaxException {
// tar saved with 'docker save busybox -o busybox.tar'
Path path = Paths.get(Resources.getResource("core/busybox-docker.tar").toU... | @@ -53,10 +53,13 @@ public class JibIntegrationTest {
@Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder();
+ private final String dockerHost =
+ System.getenv("DOCKER_IP") != null ? System.getenv("DOCKER_IP") : "localhost";
+
private final RegistryClient registryClient =
Re... | jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Set up docker machine with VirtualBox for migration to big-sur | 3,598 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java
PR Title: Set up docker machine with VirtualBox for migration to big-sur
BEFORE CODE: throws IOException, InterruptedException, InvalidImageReferenceException, Execut... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
public ListenableFuture<?> submit(Runnable task) {
throw new UnsupportedOperationException();
}
@Override
public <T> ListenableFuture<T> submit(Runnable task, T result) {
throw new UnsupportedOperationException();
}
@Override
protected ExecutorService delegate() {
throw n... | No issues found. | public ListenableFuture<?> submit(Runnable task) {
throw new UnsupportedOperationException();
}
@Override
public <T> ListenableFuture<T> submit(Runnable task, T result) {
throw new UnsupportedOperationException();
}
@Override
protected ExecutorService delegate() {
throw n... | @@ -20,8 +20,11 @@
import com.google.cloud.tools.jib.builder.ProgressEventDispatcher;
import com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.ImagesAndRegistryClient;
import com.google.cloud.tools.jib.configuration.BuildContext;
+import com.google.cloud.tools.jib.global.JibSystemProperties;
import com.goo... | jib-core/src/test/java/com/google/cloud/tools/jib/builder/steps/StepsRunnerTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Add imagePushed field to jib-image.json | 3,641 | GoogleContainerTools/jib | 11,032 | Java | wwadge | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/builder/steps/StepsRunnerTest.java
PR Title: Add imagePushed field to jib-image.json
BEFORE CODE: public ListenableFuture<?> submit(Runnable task) {
throw new UnsupportedOperationException();
}
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/*
* Copyright 2018 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | No issues found. | /*
* Copyright 2018 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | @@ -16,16 +16,16 @@
package example;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
impor... | jib-maven-plugin/src/test/resources/maven/projects/war_servlet25/src/main/java/example/HelloWorld.java | 0 | Java | 1 | none | 16 | 49 | 49 | true | remaining javax.servlet instances | 3,664 | GoogleContainerTools/jib | 11,032 | Java | elefeint | Review this pull request change.
Language: Java
File: jib-maven-plugin/src/test/resources/maven/projects/war_servlet25/src/main/java/example/HelloWorld.java
PR Title: remaining javax.servlet instances
BEFORE CODE: /*
* Copyright 2018 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* docker} command.
*
* @return {@code true} if Docker is installed on the user's system and accessible
*/
public static boolean isDefaultDockerInstalled() {
return isDockerInstalled(DEFAULT_DOCKER_CLIENT);
}
/**
* Checks if Docker is installed on the user's system and accessible by running the... | No issues found. | * docker} command.
*
* @return {@code true} if Docker is installed on the user's system and accessible
*/
public static boolean isDefaultDockerInstalled() {
return isDockerInstalled(DEFAULT_DOCKER_CLIENT);
}
/**
* Checks if Docker is installed on the user's system and accessible by running the... | @@ -19,6 +19,8 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.cloud.tools.jib.api.DescriptorDigest;
+import com.google.cloud.tools.jib.api.DockerClient;
+import com.google.cloud.tools.jib.api.ImageDetails;
import com.google.cl... | jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Create `DockerClient` interface | 3,703 | GoogleContainerTools/jib | 11,032 | Java | eddumelendez | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java
PR Title: Create `DockerClient` interface
BEFORE CODE: * docker} command.
*
* @return {@code true} if Docker is installed on the user's system and accessible
*/
public st... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
*/
package com.google.cloud.tools.jib.builder.steps;
import com.google.cloud.tools.jib.api.buildplan.Platform;
import com.google.cloud.tools.jib.configuration.BuildContext;
import com.google.cloud.tools.jib.image.json.ContainerConfigurationTemplate;
import com.google.cloud.tools.jib.image.json.PlatformNotFoundInBase... | No issues found. | */
package com.google.cloud.tools.jib.builder.steps;
import com.google.cloud.tools.jib.api.buildplan.Platform;
import com.google.cloud.tools.jib.configuration.BuildContext;
import com.google.cloud.tools.jib.image.json.ContainerConfigurationTemplate;
import com.google.cloud.tools.jib.image.json.PlatformNotFoundInBase... | @@ -16,11 +16,10 @@
package com.google.cloud.tools.jib.builder.steps;
-import com.google.cloud.tools.jib.api.LogEvent;
import com.google.cloud.tools.jib.api.buildplan.Platform;
import com.google.cloud.tools.jib.configuration.BuildContext;
-import com.google.cloud.tools.jib.event.EventHandlers;
import com.google... | jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/PlatformChecker.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | fix: error when base image doesn't support target platforms | 3,707 | GoogleContainerTools/jib | 11,032 | Java | gsquared94 | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/PlatformChecker.java
PR Title: fix: error when base image doesn't support target platforms
BEFORE CODE: */
package com.google.cloud.tools.jib.builder.steps;
import com.google.cloud.tools.jib.api.... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())
.isEqualTo(fakeProject.getProjectDir().toPath().resolve("test/path"));
}
@Test
public void testExtraDirectories_lazyEvaluation_setFromInto() {
testJibExtension.extraDirectories(
extraDirectories ->
... | No issues found. | assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())
.isEqualTo(fakeProject.getProjectDir().toPath().resolve("test/path"));
}
@Test
public void testExtraDirectories_lazyEvaluation_setFromInto() {
testJibExtension.extraDirectories(
extraDirectories ->
... | @@ -33,6 +33,7 @@
import java.util.List;
import java.util.Properties;
import org.gradle.api.Project;
+import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider;
import org.gradle.api.provider.ProviderFactory;
import org.gradle.testfixtures.ProjectBuilder;
@@ -184,9 +185,9 @@ public void tes... | jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/JibExtensionTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Use Gradle Property and Provider for creationTime and filesModificationTime | 3,709 | GoogleContainerTools/jib | 11,032 | Java | creckord | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/JibExtensionTest.java
PR Title: Use Gradle Property and Provider for creationTime and filesModificationTime
BEFORE CODE: assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).get... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* @throws IOException if an I/O exception occurs
*/
CachedLayer writeCompressed(Blob compressedLayerBlob) throws IOException {
// Creates the layers directory if it doesn't exist.
Files.createDirectories(cacheStorageFiles.getLayersDirectory());
// Creates the temporary directory.
Files.createDi... | No issues found. | * @throws IOException if an I/O exception occurs
*/
CachedLayer writeCompressed(Blob compressedLayerBlob) throws IOException {
// Creates the layers directory if it doesn't exist.
Files.createDirectories(cacheStorageFiles.getLayersDirectory());
// Creates the temporary directory.
Files.createDi... | @@ -50,9 +50,10 @@
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
-import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import javax.annotation.Nullable;
+import org.apache.commons.compress.compressors.CompressorException;
+import org.apach... | jib-core/src/main/java/com/google/cloud/tools/jib/cache/CacheStorageWriter.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Support base image layer compressed with zstd | 3,717 | GoogleContainerTools/jib | 11,032 | Java | rquinio | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/cache/CacheStorageWriter.java
PR Title: Support base image layer compressed with zstd
BEFORE CODE: * @throws IOException if an I/O exception occurs
*/
CachedLayer writeCompressed(Blob compressedLayerBlob)... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/** Configuration of an extra directory. */
public class ExtraDirectoryParameters implements ExtraDirectoriesConfiguration {
private Project project;
private Property<Path> from;
private Property<String> into;
private ListProperty<String> includes;
private ListProperty<String> excludes;
@Inject
public E... | No issues found. | /** Configuration of an extra directory. */
public class ExtraDirectoryParameters implements ExtraDirectoriesConfiguration {
private Project project;
private Property<Path> from;
private Property<String> into;
private ListProperty<String> includes;
private ListProperty<String> excludes;
@Inject
public E... | @@ -24,56 +24,68 @@
import org.gradle.api.Project;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.ListProperty;
+import org.gradle.api.provider.Property;
+import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Internal;
/** Configuratio... | jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/ExtraDirectoryParameters.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Use Gradle Property and Provider to enable lazy evaluation for jib.extraDirectories parameters | 3,737 | GoogleContainerTools/jib | 11,032 | Java | emmileaf | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/ExtraDirectoryParameters.java
PR Title: Use Gradle Property and Provider to enable lazy evaluation for jib.extraDirectories parameters
BEFORE CODE: /** Configuration of an extra directory. */
publ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@Override
public int read() throws IOException {
throw new IOException();
}
});
try {
testDockerClient.load(imageTarball, ignored -> {});
Assert.fail("Write should have failed");
} catch (IOException ex) {
Assert.assertEq... | No issues found. |
@Override
public int read() throws IOException {
throw new IOException();
}
});
try {
testDockerClient.load(imageTarball, ignored -> {});
Assert.fail("Write should have failed");
} catch (IOException ex) {
Assert.assertEq... | @@ -24,11 +24,13 @@
import com.google.cloud.tools.jib.json.JsonTemplateMapper;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.ByteStreams;
+import com.google.common.io.Resources;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
imp... | jib-core/src/test/java/com/google/cloud/tools/jib/docker/CliDockerClientTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Check if file exists when executable path is passed in through jib dockerClient.executable | 3,744 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-core/src/test/java/com/google/cloud/tools/jib/docker/CliDockerClientTest.java
PR Title: Check if file exists when executable path is passed in through jib dockerClient.executable
BEFORE CODE:
@Override
public int read() throws IO... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* @param manifestTemplate the V2.1 manifest
* @throws IOException if an I/O exception occurs
*/
public void writeMetadata(ImageReference imageReference, V21ManifestTemplate manifestTemplate)
throws IOException {
List<ManifestAndConfigTemplate> singleton =
Collections.singletonList(new Manif... | No issues found. | * @param manifestTemplate the V2.1 manifest
* @throws IOException if an I/O exception occurs
*/
public void writeMetadata(ImageReference imageReference, V21ManifestTemplate manifestTemplate)
throws IOException {
List<ManifestAndConfigTemplate> singleton =
Collections.singletonList(new Manif... | @@ -25,6 +25,7 @@
import com.google.cloud.tools.jib.image.json.ContainerConfigurationTemplate;
import com.google.cloud.tools.jib.image.json.ImageMetadataTemplate;
import com.google.cloud.tools.jib.image.json.ManifestAndConfigTemplate;
+import com.google.cloud.tools.jib.image.json.ManifestTemplate;
import com.google... | jib-core/src/main/java/com/google/cloud/tools/jib/cache/Cache.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | Check for existence of layers in cache before returning cached base image | 3,767 | GoogleContainerTools/jib | 11,032 | Java | emmileaf | Review this pull request change.
Language: Java
File: jib-core/src/main/java/com/google/cloud/tools/jib/cache/Cache.java
PR Title: Check for existence of layers in cache before returning cached base image
BEFORE CODE: * @param manifestTemplate the V2.1 manifest
* @throws IOException if an I/O exception occurs... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@Test
public void testBuild_failOffline() {
String targetImage =
IntegrationTestingConfiguration.getTestRepositoryLocation()
+ "/simpleimageoffline:gradle"
+ System.nanoTime();
Exception exception =
assertThrows(
UnexpectedBuildFailure.class,
... | No issues found. |
@Test
public void testBuild_failOffline() {
String targetImage =
IntegrationTestingConfiguration.getTestRepositoryLocation()
+ "/simpleimageoffline:gradle"
+ System.nanoTime();
Exception exception =
assertThrows(
UnexpectedBuildFailure.class,
... | @@ -28,14 +28,13 @@
import com.google.cloud.tools.jib.api.InvalidImageReferenceException;
import com.google.cloud.tools.jib.registry.LocalRegistry;
import com.google.common.base.Splitter;
+import com.google.common.collect.ImmutableList;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import ... | jib-gradle-plugin/src/integration-test/java/com/google/cloud/tools/jib/gradle/SingleProjectIntegrationTest.java | 0 | Java | 1 | none | 16 | 51 | 51 | true | fix: undo kokoro JAVA_TOOL_OPTIONS workaround | 3,827 | GoogleContainerTools/jib | 11,032 | Java | mpeddada1 | Review this pull request change.
Language: Java
File: jib-gradle-plugin/src/integration-test/java/com/google/cloud/tools/jib/gradle/SingleProjectIntegrationTest.java
PR Title: fix: undo kokoro JAVA_TOOL_OPTIONS workaround
BEFORE CODE:
@Test
public void testBuild_failOffline() {
String targetImage =
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.