Skip to content

Commit

Permalink
[JENKINS-74173][JENKINS-74174][JENKINS-74175] Address CSP violations (#…
Browse files Browse the repository at this point in the history
…234)

* [JENKINS-74174] Migrate legacy `checkUrl` in `AndroidEmulator/global.jelly`

* [JENKINS-74173] Migrate legacy `checkUrl` in `UninstallBuilder/config.jelly`

* [JENKINS-74175] Migrate legacy `checkUrl` in `AndroidEmulator/config.jelly`
  • Loading branch information
yaroslavafenkin authored Jan 2, 2025
1 parent 6957ff5 commit e25e686
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,8 @@ private ValidationResult doCheckScreenDensity(String density, boolean allowVaria
}

public FormValidation doCheckScreenResolution(@QueryParameter String value,
@QueryParameter String density, @QueryParameter String osVersion) {
return doCheckScreenResolution(value, density, osVersion, true).getFormValidation();
@QueryParameter String screenDensity, @QueryParameter String osVersion) {
return doCheckScreenResolution(value, screenDensity, osVersion, true).getFormValidation();

Check warning on line 1033 in src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 1033 is not covered by tests
}

private ValidationResult doCheckScreenResolution(String resolution, String density,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
help="/plugin/android-emulator/help-emulatorNamed.html">
<f:nested>
<f:entry title="${%AVD name}" field="avdName" description="${%Enter the name of an existing Android emulator configuration}">
<f:textbox checkUrl="'descriptorByName/AndroidEmulator/checkAvdName?value='+escape(this.value)"/>
<f:textbox checkUrl="descriptorByName/AndroidEmulator/checkAvdName" checkDependsOn=""/>
</f:entry>
</f:nested>
</f:radioBlock>
Expand All @@ -18,37 +18,35 @@
<f:entry title="${%Android OS version}" help="/plugin/android-emulator/help-osVersion.html">
<f:editableComboBox id="android-emulator.osVersion" field="osVersion"
items="${descriptor.androidVersions}"
checkUrl="'descriptorByName/AndroidEmulator/checkOsVersion?value='+escape(this.value)" />
checkUrl="descriptorByName/AndroidEmulator/checkOsVersion" checkDependsOn="" />
</f:entry>
<f:entry title="${%Screen density}" help="/plugin/android-emulator/help-screenDensity.html">
<f:editableComboBox name="android-emulator.screenDensity" field="screenDensity"
<f:editableComboBox id="android-emulator.screenDensity" field="screenDensity"
items="${descriptor.deviceDensities}"
checkUrl="'descriptorByName/AndroidEmulator/checkScreenDensity?value='+escape(this.value)" />
checkUrl="descriptorByName/AndroidEmulator/checkScreenDensity" checkDependsOn="" />
</f:entry>
<f:entry title="${%Screen resolution}" help="/plugin/android-emulator/help-screenResolution.html">
<f:editableComboBox id="android-emulator.screenResolution" field="screenResolution"
items="${descriptor.deviceResolutions}"
checkUrl="'descriptorByName/AndroidEmulator/checkScreenResolution?value='+ escape(this.value)
+'&amp;density='+ escape(findMatchingFormInput(this,'android-emulator.screenDensity').value)
+'&amp;osVersion='+ escape(document.getElementById('android-emulator.osVersion').value)" />
checkUrl="descriptorByName/AndroidEmulator/checkScreenResolution" checkDependsOn="osVersion screenDensity"/>
</f:entry>
<f:entry title="${%Device Definition}" help="/plugin/android-emulator/help-deviceDefinition.html">
<f:textbox name="android-emulator.deviceDefinition" value="${instance.deviceDefinition}" style="width:6em"
checkUrl="'descriptorByName/AndroidEmulator/checkDeviceDefinition?value='+escape(this.value)" />
checkUrl="descriptorByName/AndroidEmulator/checkDeviceDefinition" checkDependsOn=""/>
</f:entry>
<f:entry title="${%Device locale}" help="/plugin/android-emulator/help-deviceLocale.html">
<f:editableComboBox id="android-emulator.deviceLocale" field="deviceLocale"
items="${descriptor.emulatorLocales}"
checkUrl="'descriptorByName/AndroidEmulator/checkDeviceLocale?value='+escape(this.value)" />
checkUrl="descriptorByName/AndroidEmulator/checkDeviceLocale" checkDependsOn=""/>
</f:entry>
<f:entry title="${%SD card size}" help="/plugin/android-emulator/help-sdCard.html">
<f:textbox name="android-emulator.sdCardSize" value="${instance.sdCardSize}" style="width:6em"
checkUrl="'descriptorByName/AndroidEmulator/checkSdCardSize?value='+escape(this.value)" />
checkUrl="descriptorByName/AndroidEmulator/checkSdCardSize" checkDependsOn=""/>
</f:entry>
<f:entry title="${%Target ABI}" help="/plugin/android-emulator/help-targetAbi.html">
<f:editableComboBox id="android-emulator.targetAbi" field="targetAbi"
items="${descriptor.targetAbis}"
checkUrl="'descriptorByName/AndroidEmulator/checkTargetAbi?value='+escape(this.value)" />
checkUrl="descriptorByName/AndroidEmulator/checkTargetAbi" checkDependsOn="" />
</f:entry>
<f:entry title="${%Emulator name suffix}" help="/plugin/android-emulator/help-avdNameSuffix.html">
<f:textbox name="android-emulator.avdNameSuffix" value="${instance.avdNameSuffix}" style="width:12em" />
Expand Down Expand Up @@ -109,7 +107,7 @@
<f:textbox />
</f:entry>
<f:entry title="${%Emulator executable}" field="executable">
<f:editableComboBox items="${descriptor.executables}" checkUrl="'descriptorByName/AndroidEmulator/checkExecutable?value='+escape(this.value)" />
<f:editableComboBox items="${descriptor.executables}" checkUrl="descriptorByName/AndroidEmulator/checkExecutable" checkDependsOn="" />
</f:entry>
</f:advanced>
</f:section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
<f:entry title="${%Android SDK root}"
description="${%Enter the path to the root of an Android SDK installation}"
help="/plugin/android-emulator/help-sdkRoot.html">
<input class="setting-input validated" name="android-emulator.androidHome"
type="text" value="${descriptor.androidHome}"
checkUrl="'buildWrapper/AndroidEmulator/checkAndroidHome?value='+escape(this.value)" />
<f:textbox name="android-emulator.androidHome" value="${descriptor.androidHome}"
checkUrl="buildWrapper/AndroidEmulator/checkAndroidHome" checkDependsOn=""/>
</f:entry>

<f:entry help="/plugin/android-emulator/help-installSdk.html">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<f:entry title="${%Package ID}">
<f:textbox name="android-emulator.packageId" value="${instance.packageId}"
checkUrl="'descriptorByName/UninstallBuilder/checkPackageId?value='+escape(this.value)"/>
checkUrl="descriptorByName/UninstallBuilder/checkPackageId" checkDependsOn=""/>
<f:description>${%ID of the Android package to be uninstalled}</f:description>
</f:entry>

Expand Down

0 comments on commit e25e686

Please sign in to comment.