Skip to content

Commit

Permalink
stay compatible for PCT (#2552)
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinter69 authored Aug 27, 2024
1 parent 3ad2056 commit aa8c31d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ private boolean canApplyFrom(List<YamlSource> yamlSources) {

@POST
@Restricted(NoExternalUse.class)
public FormValidation doCheckNewSource(@QueryParameter String value) {
public FormValidation doCheckNewSource(@QueryParameter String newSource) {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);
String normalizedSource = Util.fixEmptyAndTrim(value);
String normalizedSource = Util.fixEmptyAndTrim(newSource);
if (normalizedSource == null) {
return FormValidation.ok(); // empty, do nothing
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<f:form method="post" action="replace" name="replace">
<h2>${%Replace configuration source with:}</h2>
<f:entry title="${%Path or URL}" field="newSource" >
<f:textbox checkUrl="checkNewSource" checkDependsOn=""/>
<f:textbox checkUrl="checkNewSource" checkDependsOn="newSource"/>
</f:entry>
<f:block>
<f:submit name="replace" value="${%Apply new configuration}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private void assertConfigViaWebUI(String jenkinsConfig) throws Exception {
// Call the check url
JenkinsRule.WebClient client = r.j.createWebClient();
WebRequest request = new WebRequest(client.createCrumbedUrl("configuration-as-code/checkNewSource"), POST);
NameValuePair param = new NameValuePair("value", f.toURI().toURL().toExternalForm());
NameValuePair param = new NameValuePair("newSource", f.toURI().toURL().toExternalForm());
request.setRequestParameters(Collections.singletonList(param));
WebResponse response = client.loadWebResponse(request);
assertEquals("Failed to POST to " + request.getUrl().toString(), 200, response.getStatusCode());
Expand Down

0 comments on commit aa8c31d

Please sign in to comment.