Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
@Library('pipeline-library@pull/893/head') _

// While this isn't a plugin, it is much simpler to reuse the pipeline code for CI
// allowing easy windows / linux testing and producing incrementals
// the only feature that buildPlugin has that relates to plugins is allowing you to test against multiple jenkins versions
buildPlugin(
useContainerAgent: false,
useArtifactCachingProxy: false,
configurations: [
[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 21],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public void testBuildMetadata(PluginMetadata expectedMetadata, WireMockRuntimeIn
// Assert output
assertAll(
() -> assertEquals(0, result.getExitCode()),
() -> assertTrue(Files.readAllLines(outputPath.resolve("stdout.txt")).stream()
.anyMatch(line -> line.matches("(.*)GitHub owner: fake-owner(.*)"))),
() -> assertTrue(Files.readAllLines(outputPath.resolve("stdout.txt")).stream()
.anyMatch(line ->
line.matches(".*Metadata was fetched for plugin empty and is available at.*"))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void setupMock() {
byte[] privateKey = sshIdentity.getPrivateKey();
try {
Files.write(keysPath.resolve(plugin), privateKey);
LOG.info("Private key: {}", keysPath.resolve(plugin));
LOG.debug("Private key: {}", keysPath.resolve(plugin));
} catch (IOException e) {
throw new ModernizerException("Error writing private key", e);
}
Expand Down
4 changes: 4 additions & 0 deletions plugin-modernizer-cli/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<appender-ref ref="CONSOLE" />
</root>
<logger name="io.jenkins.tools.pluginmodernizer" level="TRACE" />
<logger name="io.jenkins.tools.pluginmodernizer.cli.utils" level="INFO" />
<logger name="org.testcontainers" level="INFO" />
<logger name="com.github.sparsick.testcontainers" level="INFO" />
<logger name="tc.rockstorm/git-server:2.45" level="WARN" />
<logger name="tc.testcontainers/ryuk:0.9.0" level="WARN" />
<logger name="com.github.dockerjava" level="INFO" />
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ public boolean isApplicable(Plugin plugin, PluginService pluginService) {
return false;
}
if (plugin.getMetadata().hasFlag(this)) {
LOG.debug("Flag {} already set for plugin {}", this, plugin.getName());
LOG.trace("Flag {} already set for plugin {}", this, plugin.getName());
return true;
}
if (isApplicablePlugin == null) {
LOG.debug("No applicable plugin check for flag {}", this);
LOG.trace("No applicable plugin check for flag {}", this);
return false;
}
boolean result = isApplicablePlugin.test(plugin, pluginService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,9 @@ public void fetch(Plugin plugin) {
}
try {
fetchRepository(plugin);
LOG.debug("Fetched repository from {}", repository.getSshUrl());
LOG.debug(
"Fetched repository from {}",
sshKeyAuth ? repository.getSshUrl() : repository.getHttpTransportUrl());
} catch (GitAPIException | URISyntaxException e) {
LOG.error("Failed to fetch the repository", e);
plugin.addError("Failed to fetch the repository", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ public void start() {
// Debug config
LOG.debug("Plugins: {}", config.getPlugins());
LOG.debug("Recipe: {}", config.getRecipe().getName());
LOG.debug("GitHub owner: {}", config.getGithubOwner());
LOG.debug("GitHub owner: {}", getGithubOwner());
if (ghService.isSshKeyAuth()) {
LOG.debug("SSH private key: {}", config.getSshPrivateKey());
LOG.debug("SSH private key: {}", getSshPrivateKeyPath());
} else {
LOG.debug("Using GitHub token for git authentication");
}
Expand Down