Skip to content

Commit abfbc35

Browse files
committed
Adapt to new scriptlistener format
1 parent 6bd9763 commit abfbc35

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
1717
<properties>
1818
<changelist>999999-SNAPSHOT</changelist>
19-
<jenkins.version>2.332.1</jenkins.version>
19+
<jenkins.version>2.355-SNAPSHOT</jenkins.version>
2020
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
2121
</properties>
2222
<licenses>

src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SecureGroovyScript.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ public Object evaluate(ClassLoader loader, Binding binding, @CheckForNull TaskLi
397397
String origin = "UNKNOWN";
398398
if (binding.hasVariable("build")) {
399399
Run run = (Run) binding.getVariable("build");
400-
origin = run.getFullDisplayName();
400+
401+
origin = String.format("build '%s'", run.getExternalizableId());
401402
} else {
402403
LOGGER.log(Level.INFO, "Could not determine origin of the groovy script - missing implementation. Please open an issue for this!");
403404
}

src/main/java/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ public synchronized String using(@NonNull String script, @NonNull Language langu
495495
if (script.length() == 0) {
496496
// As a special case, always consider the empty script preapproved, as this is usually the default for new fields,
497497
// and in many cases there is some sensible behavior for an emoty script which we want to permit.
498-
ScriptListener.fireScriptEvent(script, origin);
498+
ScriptListener.fireScriptEvent(script, origin, null);
499499

500500
return script;
501501
}
@@ -504,7 +504,7 @@ public synchronized String using(@NonNull String script, @NonNull Language langu
504504
// Probably need not add to pendingScripts, since generally that would have happened already in configuring.
505505
throw new UnapprovedUsageException(hash);
506506
}
507-
ScriptListener.fireScriptEvent(script, origin);
507+
ScriptListener.fireScriptEvent(script, origin, null);
508508
return script;
509509
}
510510
// Only for testing

0 commit comments

Comments
 (0)