Skip to content

Migrate from EE 8 to EE 9 #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2025
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ When unset, you need to call` ScriptApproval.configuring` in the `@DataBoundCons
Use `ApprovalContext.withCurrentUser`, and also `withItemAsKey` where applicable (when
there is just one script per job); otherwise at least withItem where applicable, and/or
`withKey` when you can uniquely identify this usage from the context
(`StaplerRequest.findAncestorObject` is helpful here). This lets the system know a
(`StaplerRequest2.findAncestorObject` is helpful here). This lets the system know a
(possibly) new script has been configured by a particular person. You will also need a
`readResolve` that calls configuring to notify the system when a configurable with script
has been loaded from disk (and thus the configurer is unknown). Call
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.88</version>
<version>5.7</version>
<relativePath/>
</parent>

Expand All @@ -16,8 +16,8 @@
<properties>
<changelist>999999-SNAPSHOT</changelist>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.387</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
</properties>
<licenses>
Expand Down Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>2543.vfb_1a_5fb_9496d</version>
<version>3893.v213a_42768d35</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.interceptor.RequirePOST;

/**
Expand Down Expand Up @@ -155,7 +155,7 @@ public SecureGroovyScript configuring(ApprovalContext context) {
}

private static @CheckForNull Item currentItem() {
StaplerRequest req = Stapler.getCurrentRequest();
StaplerRequest2 req = Stapler.getCurrentRequest2();
return req != null ? req.findAncestorObject(Item.class) : null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

/**
* Offers a link to {@link ScriptApproval}.
Expand Down Expand Up @@ -69,7 +69,7 @@ private ScriptApprovalNote(int length) {
public ConsoleAnnotator<Object> annotate(Object context, MarkupText text, int charPos) {
if (Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
String url = ScriptApproval.get().getUrlName();
StaplerRequest req = Stapler.getCurrentRequest();
StaplerRequest2 req = Stapler.getCurrentRequest2();
if (req != null) {
// if we are serving HTTP request, we want to use app relative URL
url = req.getContextPath() + "/" + url;
Expand Down
Loading