Skip to content

Commit

Permalink
Avoid calling unsupported API getLogFile #97
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Jan 2, 2019
1 parent 3d59136 commit febc1ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Generic Webhook Plugin Changelog
Changelog of Generic Webhook Plugin.
## Unreleased
### No issue

**Fixing test case**


[3d59136e2515a0a](https://github.com/jenkinsci/generic-webhook-trigger-plugin/commit/3d59136e2515a0a) Tomas Bjerre *2018-12-12 18:56:45*


## 1.51 (2018-12-12 16:45:53)
### GitHub [#91](https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/91) Ability to include the result from value filter *enhancement*

Expand Down
2 changes: 1 addition & 1 deletion debug.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
mvn versions:update-properties
mvnDebug -q hpi:run -Djava.util.logging.config.file=logging.properties -Djenkins.version=2.138.1 -Denforcer.skip=true
mvnDebug -q hpi:run -Djava.util.logging.config.file=logging.properties -Djenkins.version=2.150.1 -Denforcer.skip=true

2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
mvn versions:update-properties
mvn -q hpi:run -Djava.util.logging.config.file=logging.properties -Djenkins.version=2.138.1 -Denforcer.skip=true
mvn hpi:run -Djava.util.logging.config.file=logging.properties -Djenkins.version=2.150.1 -Denforcer.skip=true
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import hudson.model.EnvironmentContributor;
import hudson.model.Run;
import hudson.model.TaskListener;

import javax.annotation.Nonnull;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map;
import javax.annotation.Nonnull;

@Extension
public class GenericWebhookEnvironmentContributor extends EnvironmentContributor {
Expand Down Expand Up @@ -52,8 +52,7 @@ public void buildEnvironmentFor(

private boolean notLogged(@SuppressWarnings("rawtypes") final Run r) throws IOException {
try (BufferedReader br =
new BufferedReader(
new InputStreamReader(new FileInputStream(r.getLogFile()), Charsets.UTF_8))) {
new BufferedReader(new InputStreamReader(r.getLogInputStream(), Charsets.UTF_8))) {
String line;
while ((line = br.readLine()) != null) {
if (line.contains(CONTRIBUTING_VARIABLES)) {
Expand Down

0 comments on commit febc1ba

Please sign in to comment.